Common Dialog

For questions about using Classic.

Post » Wed Dec 17, 2008 7:11 am

I am having trouble assigning the file/path refrence to a text box using the common dialog object.

I make a Edit box, one button called BROWSE, and a common dialog.

When I press browse, the common dialog shows the FOLDER selector which is fine. When I press OK, it will not transfer the folder name and path into the edit box.

My code is something like:

Folder Dialog OK
-Edit box text = dialog.folder

Nothing happens D:

Please halp!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Wed Dec 17, 2008 5:05 pm

I think the "Folder Dialog: OK" is broken. Just do this:

+On Button Clicked
-CommonDialog: Show folder selector
-Set edit box to CommonDialog.Folder

The Common Dialog object pauses everything while something is up, so just put the set edit box action right after the show folder selector in the same event. Hope that helps. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Dec 18, 2008 6:45 am

[quote="linkman2004":bu9xysto]I think the "Folder Dialog: OK" is broken. Just do this:

+On Button Clicked
-CommonDialog: Show folder selector
-Set edit box to CommonDialog.Folder

The Common Dialog object pauses everything while something is up, so just put the set edit box action right after the show folder selector in the same event. Hope that helps. :)[/quote:bu9xysto]

Cheers link, I'll give it a shot as soon as I get home. I'll let you know how it goes down. Thanks for the reply mate. :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Dec 18, 2008 3:24 pm

[quote="linkman2004":243406rv]I think the "Folder Dialog: OK" is broken. Just do this:

+On Button Clicked
-CommonDialog: Show folder selector
-Set edit box to CommonDialog.Folder

The Common Dialog object pauses everything while something is up, so just put the set edit box action right after the show folder selector in the same event. Hope that helps. :)[/quote:243406rv]

The on ok is broken...

You can make it all part of the same event

On button click
-Show open dialog
-set edit box to common dialog.First selected file

but be warned that if you exit the Dialog it may cause a crash I know it does in my level editor.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Thu Dec 18, 2008 3:59 pm

Ah, folder selector's fixed.

Why wouldn't you use the On OK for the file dialog.. though? It's there for safety, so your events know a file was picked.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Dec 18, 2008 4:45 pm

..could you post a file replicating the crash, though? :)
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Fri Dec 19, 2008 12:57 am

Ah OK, well if it's fixed then I'll just wait for the next update and leave my events the way they are... I didn't get a chance to mess with it last night as planned since I had to go get my suit refitted for my friends wedding and didn't end up getting home late.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Tue Dec 23, 2008 6:32 pm

[quote="Rich":39t5cdlw]Why wouldn't you use the On OK for the file dialog.. though? It's there for safety, so your events know a file was picked.[/quote:39t5cdlw]

The on ok caused a crash every time i used it...
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Dec 23, 2008 6:55 pm

I'd suggest this was your code as it seems very unlikely a triggered condition could cause a crash.. could you paste an image of the events for the condition?
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests