Re: VEL "experimental" question.
- Posted by Ad Rienks <kwibus at DOLFIJN.NL> Oct 03, 1999
- 320 views
Naflign, I altered your code a bit and have added some comments. The descriptions and examples in 'Experimental.doc' are a bit confusing But this version requires that you first create a control for the OpenDialog function to work. This is a control 'behind the scenes', as I would discribe it. The open a file using OPENDIALOG, you have to set the FILTER attribute each time you use it. To open the dialog, you use ShowDialog, where the first argument is the id, that was returned when you created the OpenDialog control. Are you still with me? From here on, you build further on your program. BTW, what kind of program will it be? A Bitmap Editor? Anyways, I would like to see your progressions while making it -- %< snip >% -- the (updated and commented) Euphoria program. without warning include vel005.e integer Form1,Button1,OpenDialog1,crudvar1 sequence s Form1=3DCreateControl(FORM, 0) s =3D {{CAPTION, "quick mod of demo9"}, {FILENAME, "VEL.ico"}, {COLOR, CWHITE}, {LEFT, 100}, {TOP, 100}, {HEIGHT, 500}, {WIDTH, 600}} SetAttribute(Form1, s) Button1 =3D CreateControl(BUTTON,Form1) s =3D {{CAPTION, "Load Test"}, {TOP, 350}, {LEFT, 250}, {HEIGHT,25}, {WIDTH,75}, {TABORDER, 2}, {TABSTOP, TRUE}, {DEFAULTBTN, TRUE}, {HINT, "The on to the adding of chr's in the map creator"}, {SHOWHINT, TRUE}} SetAttribute(Button1,s) -- First, you should create an (invisible) control for the use of OpenD= ialog OpenDialog1 =3D CreateControl(OPENDIALOG, Form1) procedure Button1OnClick(integer id, integer p, integer q) --The next line causes the error: --OpenDialog1 =3D ShowDialog(OPENDIALOG, Form1) SetAttribute(OpenDialog1, {{FILTER, "Euphoria | .e;*.ew;*.ex;*.exw"= }}) crudvar1 =3D ShowDialog(OpenDialog1, Form1) s =3D GetAttribute(crudvar1, FILENAME) puts(1, s) -- now you should see the name of the file you selected= in a console window end procedure SetEvent(Button1, CLICK_EVENT, routine_id("Button1OnClick")) ShowForm(Form1, MODAL) -- %< snip >% -- end of Euphoria code -- ^ | /-\<| ----- | Gratis e-mail en meer: http://www.dolfijn.nl/ | Een product van Ilse: http://www.ilse.nl/