--A program with mixed commands made with the w32engin.ew library (By Bernie Ryan) --Program based off of his gracious example files and made by Alex Blanchette --I hope you enjoy this program and that all my strenous and obvious commenting --helps you out in some way. This program took 5 hours to write. without warning --This makes sure there will be no pesky "constant so and so was --not used" message include w32engin.ew --Includes the w32engin.ew Euphoria API library constant wtitle = "CME Windows API: Mixed App", --Title of the window, put a comma --after each constant is done so that --the computer knows the next item is --also a constant htitle = "Hey!", --Title of the button that has "Hey!" written on it htext = "That Sucks!", --Text that will appear in a message box when the "Hey!" --titled button is pushed gtitle = "Hehe", --Title of the button that has "Hehe" written on it gtext = "That Rocks!", --Text that will appear in a message box when the "Hehe" --titled button is pushed ctitle = "Close", --Title of the button that has "Close" written on it ltitle = "Selected", --Title of the button that has "Selected" written on it ftitle = "&File", --The title of the "File" menu, use the & to denounce that it --is part of/or the title of a menu fntitle = "&New", --The title of the "New" item in the "File" menu fotitle = "&Open", --The title of the "Open" item in the "File" menu fstitle = "&Save", --The title of the "Save" item in the "File" menu fsatitle = "Save &As", --The title of the "Save As" item in the "File" menu fetitle = "&Exit", --The title of the "Exit" item in the "File" menu etitle = "&Edit", --The title of the "Edit" menu eutitle = "&Undo", --The title of the "Undo" item in the "Edit" menu ectitle = "&Cut", --The title of the "Cut" item in the "Edit" menu ecptitle = "&Copy", --The title of the "Copy" item in the "Edit" menu eptitle = "&Paste", --The title of the "Paste" item in the "Edit" menu edtitle = "&Delete", --The title of the "Delete" item in the "Edit" menu hlptitle = "&Help", --The title of the "Help" menu hlpatitle= "&About", --The title of the "About" item in the "Help" menu hmtitle = "About this mixed app", --The title of the message box that will open --when somebody clicks on the "About" item in --in the "Help" menu hmtext = "Mixed Windows API program\nmade in Euphoria, using\nw32engin.ew made by Alex Blanchette", --The text that will appear in the message box that will open when somebody clicks on the "About" --item in the "Help" menu chtitle = "Checkbox", --Title of the checkbox chbtitle = "Check Value", --Title of the button that will appear near the checkbox and the --textedit field chvalue0 = "Yes", --Value entered inside the message box (opened when "Check Value" button --near the checkbox is clicked if the checkbox is checked chvalue1 = "No", --Value entered inside the message box if the checkbox is not checked chvalue2 = "Is it Checked?", --Title of the message box (opened when "Check Value" button --near the checkbox is clicked chvalue3 = "What did you write?", --Title of the message box (opened when "Check Value" --button near the edittext box is clicked hintext0 = "Move the mouse around!", --The hint text for the window itself hintext1 = "Click me!", --The hint text for the buttons titled "Hey!" and "Hehe" hintext2 = "I'm a list of crap!", --The hint text for the list hintext3 = "I check which crap you selected from the list!", --The hint text for the --"Selected" button underneath the list hintext4 = "Write inside of me please...", --The hint text for the edittext box hintext5 = "I'll tell you what you wrote, just for the heck of it...", --The hint --for the "Check Value" button near the edittext box hintext6 = "Click to close the application.", --The hint text for the "Close" button hintext7 = "Check me!", --The hint text for the checkbox hintext8 = "I'll check if you checked!", --The hint text for the "Value Check" button --near the checkbox sep = "-", --Seperate text for the menus menus = "Menu Item Selected", --Text for message box that opens when a menu item is --selected window = create(Window,wtitle,0,Default,Default,570,250,0), --The window itself, --"570,250" is the size of the window in pixels hbutton = create(PushButton,htitle,window,10,20,80,25,0), --The code to create the --"Hey!" titled button on the window gbutton = create(PushButton,gtitle,window,10,50,80,25,0), --The code to create the --"Hehe" titled button on the window cbutton = create(DefPushButton,ctitle,window,240,160,60,25,0), --The code to create --the "Close" titled button on the window list = create(DropDownList,"",window,100,20,120,140,0), --The code to create the list lbutton = create(PushButton,ltitle,window,100,160,65,25,0), --The code to create the --"Selected" titled button on the window underneath the list check = create(CheckBox,chtitle,window,300,20,120,20,0), --The code to create the --checkbox on the window, above the edittext box ctext = create(EditText,"",window,300,55,120,20,0), --The code to create the edittext --box in the window, underneath the checkbox cbut0 = create(PushButton,chbtitle,window,425,20,120,20,0), --The code to create the --first/top "Check Value" titled button cbut1 = create(PushButton,chbtitle,window,425,55,120,20,0), --The code to create the --second/bottom "Check Value" titled button cr = {13,10}, --The equivalant of the \n command, used as &cr& to create its own \n file = create(Menu,ftitle,window,0,0,0,0,0), --The "File" titled menu on the window filen = create(MenuItem,fntitle,file,0,0,0,0,0), --The "New" titled object inside --the "File" titled menu fileo = create(MenuItem,fotitle,file,0,0,0,0,0), --The "Open" titled object inside --the "File" titled menu files = create(MenuItem,fstitle,file,0,0,0,0,0), --The "Save" titled object inside --the "File" titled menu filesa = create(MenuItem,fsatitle,file,0,0,0,0,0), --The "Save As" titled object inside --the "File" titled menu sep0 = create(MenuItem,sep,file,0,0,0,0,0), --The seperator between the "Save As" titled --object and the "Exit" titled object in the "File" titled menu filee = create(MenuItem,fetitle,file,0,0,0,0,0), --The "Exit" titled object inside --the "File" titled menu edit = create(Menu,etitle,window,0,0,0,0,0), --The "Edit" titled menu on the window editu = create(MenuItem,eutitle,edit,0,0,0,0,0), --The "Undo" titled object inside --the "Edit" titled menu sep1 = create(MenuItem,sep,edit,0,0,0,0,0), --The seperator between the "Undo" titled --object and the "Copy" titled object in the "Edit" titled menu editc = create(MenuItem,ectitle,edit,0,0,0,0,0), --The "Cut" titled object inside --the "Edit" titled menu editcp = create(MenuItem,ecptitle,edit,0,0,0,0,0), --The "Copy" titled object inside --the "Edit" titled menu editp = create(MenuItem,eptitle,edit,0,0,0,0,0), --The "Paste" titled object inside --the "Edit" titled menu editd = create(MenuItem,edtitle,edit,0,0,0,0,0), --The "Delete" titled object inside --the "Edit" titled menu help = create(Menu,hlptitle,window,0,0,0,0,0), --The "Help" menu on the window helpa = create(MenuItem,hlpatitle,help,0,0,0,0,0) --The "About" titled object inside --the "Help" titled menu setEnable(editu,0) --Disables the "Undo" titled object inside the "Edit" titled menu setHint(window,hintext0) --Sets the hint text for the window itself setHint(hbutton,hintext1) --Sets the hint text for the "Hey!" titled button setHint(gbutton,hintext1) --Sets the hint text for the "Hehe" titled button setHint(list,hintext2) --Sets the hint text for the list setHint(lbutton,hintext3) --Sets the hint text for the "Selected" titled button underneath --the list setHint(ctext,hintext4) --Sets the hint for the edittext box underneath the checkbox setHint(cbut1,hintext5) --Sets the hint for the first/top "Check Value" titled button setHint(cbutton,hintext6) --Sets the hint for the "Close" titled button setHint(check,hintext7) --Sets the hint for the checkbox setHint(cbut0,hintext8) --Sets the hint for the second/bottom "Check Value" titled button procedure onClick_cbutton(sequence p) --Procedure to close the window when the "Close" titled --button is clicked p = p closeWindow(window) end procedure onClick[cbutton] = routine_id("onClick_cbutton") --Tells the program that when the "Close" --titled button is clicked, to run the "onClick_cbutton" procedure procedure onClick_hbutton(sequence p) --Procedure to open a message box when the "Hey!" --titled button is clicked atom result p = p result = message_box(htext,htitle,0) end procedure onClick[hbutton] = routine_id("onClick_hbutton") --Tells the program that when the "Hey!" --titled button is clicked, to run the "onClick_hbutton" procedure procedure onClick_gbutton(sequence p) --Procedure to open a message box when the "Hehe" --titled button is clicked atom result p = p result = message_box(gtext,gtitle,0) end procedure onClick[gbutton] = routine_id("onClick_gbutton") --Tells the program that when the "Hehe" --titled button is clicked, to run the "onClick_gbutton" procedure procedure onClick_cbut0(sequence p) --Procedure when the first/top "Check Value" titled --button is clicked, to check if it is clicked and open a message box saying either Yes or --No that it is indeed checked object result p = p if isChecked(check) then result = message_box(chvalue0,chvalue2,0) else result = message_box(chvalue1,chvalue2,0) end if end procedure onClick[cbut0] = routine_id("onClick_cbut0") --Tells the program that when the top/first --"Check Value" titled button is clicked, to run the "onClick_cbut0" procedure procedure onClick_cbut1(sequence p) --Procedure when the second/bottom "Check Value" titled --button is clicked, to copy what is written in the edittext box underneath the checkbox --and print it onto the message box that pops-up integer result p = p result = message_box(getText(ctext),chvalue3,0) end procedure onClick[cbut1] = routine_id("onClick_cbut1") --Tells the program that when the second/bottom --"Check Value" button is clicked, to run the "onClick_cbut1" procedure setTextBkColor(ctext,White) --Sets the background color of the edittext box underneath the --checkbox to the pre-defined color, White (defined in the w32engin.ew libaray) setTextBkColor(list,White) --Sets the background color of the list to the pre-defined color --White procedure onLoad_window(sequence p) --Procedure that creates all the list items p = p addItem(list,"apples") addItem(list,"oranges") addItem(list,"bananas") addItem(list,"pears") addItem(list,"peaches") addItem(list,"grapes") addItem(list,"tangerines") addItem(list,"grapefruits") addItem(list,"cherries") addItem(list,"strawberries") setIndex(list,1) --Sets the pre-selected list item to the first item, in this case -- to the "apples" item end procedure procedure mouse(sequence p) --Procedure for when the mouse moves, doesn't do much but tell --the program when the mouse is on the list p = p end procedure onMouse[list] = routine_id("mouse") --Tells the program when the mouse is on the list procedure onClick_lbutton(sequence p) --Procedure to open a message box when the "Selected" --titled button underneath the list is clicked that tells you the size of the list, the --position in the list of the item you selected, and the actual item you selected integer index object result p = p index = getIndex(list) result = message_box( sprintf("List Size = %d",{getCount(list)})&cr& sprintf("Selected Item Position = %d",{index})&cr& sprintf("Selected Item = %s",{getItem(list,index)}), ltitle,0) end procedure onClick[lbutton] = routine_id("onClick_lbutton") --Tells the program that when the "Selected" --titled button is clicked, to run the "onClick_lbutton" procedure onCreate[list] = routine_id("onLoad_window") --Tells the program that when the list is --created, to run the "onLoad_window" procedure procedure mis(sequence p) --Procedure that opens a message box when a Menu Item is Selected integer result p = p result = message_box(menus,"",0) end procedure onMenu[fileo] = routine_id("mis") --Tells the program that when the "Open" titled object in --the "File" titled menu is clicked, to run the procedure "mis" onMenu[filen] = routine_id("mis") --Tells the program that when the "New" titled object in --the "File" titled menu is clicked, to run the procedure "mis" onMenu[files] = routine_id("mis") --Tells the program that when the "Save" titled object in --the "File" titled menu is clicked, to run the procedure "mis" onMenu[filesa] = routine_id("mis") --Tells the program that when the "Save As" titled object in --the "File" titled menu is clicked, to run the procedure "mis" onMenu[editu] = routine_id("mis") --Tells the program that when the "Undo" titled object in --the "Edit" titled menu is clicked, to run the procedure "mis" onMenu[editc] = routine_id("mis") --Tells the program that when the "Cut" titled object in --the "Edit" titled menu is clicked, to run the procedure "mis" onMenu[editcp] = routine_id("mis") --Tells the program that when the "Copy" titled object in --the "Edit" titled menu is clicked, to run the procedure "mis" onMenu[editp] = routine_id("mis") --Tells the program that when the "Paste" titled object in --the "Edit" titled menu is clicked, to run the procedure "mis" onMenu[editd] = routine_id("mis") --Tells the program that when the "Delete" titled object in --the "Edit" titled menu is clicked, to run the procedure "mis" procedure onMenu_aboutm(sequence p) --Procedure to open a message box when the "About" --titled object in the "Help" titled menu is clicked integer result p = p result = message_box(hmtext,hmtitle,MB_ICONINFORMATION+MB_TASKMODAL) --The icon --of a cloud with a "?" mark inside it end procedure onMenu[helpa] = routine_id("onMenu_aboutm") --Tells the program that when the "About" --titled object inside the "Help" titled menu is clicked to run the "onMenu_aboutm" procedure procedure onMenu_filee(sequence p) --Procedure that closes the window when the "Exit" titled --objectin the "File" titled menu is clicked p = p closeWindow(window) end procedure onMenu[filee] = routine_id("onMenu_filee") --Tells the computer that when the "Exit" titled --object inside the "File" titled menu is clicked, to run the "onMenu_filee" procedure WinMain(window,Normal) --Tells the computer that the main window of the program is the --constant "window" that we created at the beginning of the file, and that it is a "Normal" --styled window