|
Post by metro on Jul 21, 2018 18:25:03 GMT -5
' Simple GUI Design ' Released as Open Source ' Janet Terra ' December 30, 2008 ' Entry for Simple Form Designer Contest ' http://libertybasic.conforums.com/index.cgi?board=contests&action=display&num=1225985247
Nomainwin Dim guiInfo$(1, 18) Dim tempInfo$(1, 18) Dim dInfo$(18) Dim appInfo(10) appInfo(1) = 0 ' Number of Controls appInfo(2) = 0 ' Displayed Control appInfo(3) = 0 ' Generated Code Text Window Open appInfo(4) = 0 ' Preview Window Open appInfo(5) = 1 ' Displayed Control Saved (1 = Yes, 0 = No) appInfo(6) = 0 ' Control Width appInfo(7) = 0 ' Control Height Dim cArray$(10) For i = 1 to 10 cArray$(i) = "Item #";Right$("0";i, 2) Next i Dim wType$(10) Dim wStyle1$(10) Dim wStyle2$(10) Dim wStyle3$(10) Dim wStyle4$(10) Dim cType$(12) Dim cStyle1$(10) Dim cStyle2$(10) Dim cStyle3$(10) Dim cStyle4$(10) Dim FileInfo$(10, 10) Call InitGUIInfo Call wLoadStyles WindowWidth = 800 WindowHeight = 700 UpperLeftX = Int((DisplayWidth - WindowWidth) / 2) UpperLeftY = Int((DisplayHeight - WindowHeight) / 2)
Menu #main, "&File", "&New GUI", NewGUIMenu, _ "&Open GUI", OpenGUIMenu, _ "&Create Code", CreateCodeMenu, _ "Pre&view GUI", PreviewGUIMenu, _ "&Save GUI", SaveAsGUIMenu, |, _ "E&xit", XbyMenu
Stylebits #main.wCaptionTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wCaptionTxt, "Window Caption", 30, 15, 100, 40 Textbox #main.wCaption, 150, 20, 250, 24 Stylebits #main.wFontSelect, _BS_MULTILINE, 0, 0, 0 Button #main.wFontSelect, "Window Font", guiFont, UL, 405, 20, 40, 24 Stylebits #main.wHandleTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wHandleTxt, "Window Handle", 475, 15, 80, 40 Textbox #main.wHandle, 575, 20, 150, 24
Stylebits #main.wPropTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wPropTxt, "Window Properties", 30, 65, 100, 40 Textbox #main.wWidth, 150, 70, 80, 24 Stylebits #main.dW, _BS_MULTILINE, 0, 0, 0 Button #main.dW, "Display Width", wDW, UL, 235, 70, 40, 24 Stylebits #main.wWidthTxt, _ES_CENTER, 0, 0, 0 Statictext #main.wWidthTxt, "Width", 150, 99, 80, 24 Textbox #main.wHeight, 300, 70, 80, 24 Stylebits #main.dH, _BS_MULTILINE, 0, 0, 0 Button #main.dH, "Display Height", wDH, UL, 385, 70, 40, 24 Stylebits #main.wHeightTxt, _ES_CENTER, 0, 0, 0 Statictext #main.wHeightTxt, "Height", 300, 99, 80, 24 Textbox #main.wUlx, 450, 70, 80, 24 Stylebits #main.xC, _BS_MULTILINE, 0, 0, 0 Button #main.xC, "Center Horiz", wCH, UL, 535, 70, 40, 24 Stylebits #main.wUlxTxt, _ES_CENTER, 0, 0, 0 Statictext #main.wUlxTxt, "ULX", 450, 99, 80, 24 Textbox #main.wUly, 600, 70, 80, 24 Stylebits #main.yC, _BS_MULTILINE, 0, 0, 0 Button #main.yC, "Center Vert", wCV, UL, 685, 70, 40, 24 Stylebits #main.wUlyTxt, _ES_CENTER, 0, 0, 0 Statictext #main.wUlyTxt, "ULY", 600, 99, 80, 24
Stylebits #main.wStyle, _ES_READONLY or _WS_HSCROLL, 0, 0, 0 Textbox #main.wStyle, 150, 130, 575, 44 Stylebits #main.wStyleTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wStyleTxt, "Window Stylebits", 50, 175, 80, 40 Combobox #main.wStyle1, wStyle1$(), wStyle, 150, 180, 125, 50 Stylebits #main.wStyle1Txt, _ES_CENTER, 0, 0, 0 Statictext #main.wStyle1Txt, "Add Bits", 150, 205, 124, 24 Combobox #main.wStyle2, wStyle2$(), wStyle, 300, 180, 125, 50 Stylebits #main.wStyle2Txt, _ES_CENTER, 0, 0, 0 Statictext #main.wStyle2Txt, "Remove Bits", 300, 205, 124, 24 Combobox #main.wStyle3, wStyle3$(), wStyle, 450, 180, 125, 50 Stylebits #main.wStyle3Txt, _ES_CENTER, 0, 0, 0 Statictext #main.wStyle3Txt, "Add Extended Bits", 450, 205, 124, 30 Combobox #main.wStyle4, wStyle4$(), wStyle, 600, 180, 125, 50 Stylebits #main.wStyle4Txt, _ES_CENTER, 0, 0, 0 Statictext #main.wStyle4Txt, "Rem Extended Bits", 600, 205, 124, 30
Stylebits #main.wTypeTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wTypeTxt, "Window Type", 30, 245, 100, 30 Combobox #main.wType, wType$(), wType, 150, 240, 150, 50 Stylebits #main.wFore, _BS_MULTILINE, 0, 0, 0 Button #main.wFore, "Fore Color", ForeBackColor, UL, 325, 240, 40, 24 Graphicbox #main.wForeGraph, 365, 240, 20, 24 Stylebits #main.wBack, _BS_MULTILINE, 0, 0, 0 Button #main.wBack, "Back Color", ForeBackColor, UL, 405, 240, 40, 24 Graphicbox #main.wBackGraph, 445, 240, 20, 24 Stylebits #main.wTrapTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.wTrapTxt, "Trapclose", 475, 245, 80, 24 Textbox #main.wTrap, 575, 240, 150, 24
Button #main.cFirst, "|<", ControlNavigation, UL, 150, 280, 40, 24 Button #main.cPrev, "<<", ControlNavigation, UL, 190, 280, 40, 24 Stylebits #main.cNavTxt, _ES_CENTER, 0, 0, 0 Statictext #main.cNavTxt, "Controls", 230, 285, 95, 24 Button #main.cNext, ">>", ControlNavigation, UL, 325, 280, 40, 24 Button #main.cLast, ">|", ControlNavigation, UL, 365, 280, 40, 24 Button #main.cAdd, ">*", ControlNavigation, UL, 405, 280, 40, 24 Button #main.cPreview, "Preview Control", PreviewControl, UL, 465, 280, 120, 24 Button #main.cSave, "Save Control", SaveControl, UL, 605, 280, 120, 24
Stylebits #main.cTextTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cTextTxt, "Control Text", 50, 315, 80, 40 Textbox #main.cText, 150, 320, 250, 24 Stylebits #main.cFontSelect, _BS_MULTILINE, 0, 0, 0 Button #main.cFontSelect, "Control Font", guiFont, UL, 405, 320, 40, 24 Stylebits #main.cHandleTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cHandleTxt, "Control Handle", 475, 315, 80, 40 Textbox #main.cHandle, 575, 320, 150, 24
Stylebits #main.cPropTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cPropTxt, "Control Properties", 50, 365, 80, 40
Textbox #main.cUlx, 150, 370, 50, 24 Stylebits #main.cUlxTxt, _ES_CENTER, 0, 0, 0 Statictext #main.cUlxTxt, "ULX", 150, 399, 50, 24 Textbox #main.cUly, 225, 370, 50, 24 Stylebits #main.cUlyTxt, _ES_CENTER, 0, 0, 0 Statictext #main.cUlyTxt, "ULY", 225, 399, 50, 24 Textbox #main.cWidth, 300, 370, 50, 24 Stylebits #main.cWidthTxt, _ES_CENTER, 0, 0, 0 Statictext #main.cWidthTxt, "Width", 300, 399, 50, 24 Textbox #main.cHeight, 375, 370, 50, 24 Stylebits #main.cHeightTxt, _ES_CENTER, 0, 0, 0 Statictext #main.cHeightTxt, "Height", 375, 399, 50, 24
Stylebits #main.cArrayTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cArrayTxt, "Control Array", 475, 365, 80, 40 Textbox #main.cArray, 575, 370, 150, 24
Stylebits #main.cBitmapTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cBitmapTxt, "Control Bitmap/Color", 40, 425, 90, 40 Stylebits #main.cBack, _BS_MULTILINE, 0, 0, 0 Button #main.cBack, "Control Color", ForeBackColor, UL, -150, 430, 40, 24 Graphicbox #main.cBackGraph, -190, 430, 20, 24 Stylebits #main.cBitmap, _ES_READONLY, 0, 0, 0 Textbox #main.cBitmap, 150, 430, 150, 24 Button #main.cBitmapBrowse, "Browse", cBitmapBrowse, UL, 305, 430, 40, 24 Stylebits #main.cSub1Txt, _ES_RIGHT, 0, 0, 0 Statictext #main.cSub1Txt, "Sub Event 1", 365, 425, 60, 40 Textbox #main.cSub1, 445, 430, 100, 24 Stylebits #main.cSub2Txt, _ES_RIGHT, 0, 0, 0 Statictext #main.cSub2Txt, "Sub Event 2", 545, 425, 60, 40 Textbox #main.cSub2, 625, 430, 100, 24
Stylebits #main.cStyle, _ES_READONLY or _WS_HSCROLL, 0, 0, 0 Textbox #main.cStyle, 150, 480, 575, 44 Stylebits #main.cStyleTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cStyleTxt, "Control Stylebits", 50, 525, 80, 40 Combobox #main.cStyle1, cStyle1$(), cStyle, 150, 530, 125, 50 Stylebits #main.cStyle1Txt, _ES_CENTER, 0, 0, 0 Statictext #main.cStyle1Txt, "Add Bits", 150, 555, 124, 24 Combobox #main.cStyle2, cStyle2$(), cStyle, 300, 530, 125, 50 Stylebits #main.cStyle2Txt, _ES_CENTER, 0, 0, 0 Statictext #main.cStyle2Txt, "Remove Bits", 300, 555, 124, 24 Combobox #main.cStyle3, cStyle3$(), cStyle, 450, 530, 125, 50 Stylebits #main.cStyle3Txt, _ES_CENTER, 0, 0, 0 Statictext #main.cStyle3Txt, "Add Extended Bits", 450, 555, 124, 30 Combobox #main.cStyle4, cStyle4$(), cStyle, 600, 530, 125, 50 Stylebits #main.cStyle4Txt, _ES_CENTER, 0, 0, 0 Statictext #main.cStyle4Txt, "Rem Extended Bits", 600, 555, 124, 30
Stylebits #main.cTypeTxt, _ES_RIGHT, 0, 0, 0 Statictext #main.cTypeTxt, "Control Type", 30, 595, 100, 30 Combobox #main.cType, cType$(), cType, 150, 590, 150, 50
Button #main.code, "Create Code", CreateCode, UL, 325, 590, 120, 24 Button #main.preview, "Preview GUI", PreviewGUI, UL, 465, 590, 120, 24 Button #main.save, "Save GUI", SaveGUI, UL, 605, 590, 120, 24
Open "Simple GUI Creator" for Window_nf as #main #main, "Trapclose XbyTrap" #main, "Font Verdana 10" #main.wCaption, "!Font ";guiInfo$(0, 18) #main.wFontSelect, "!Font Verdana 6" #main.dW, "!Font Verdana 6" #main.dH, "!Font Verdana 6" #main.xC, "!Font Verdana 6" #main.yC, "!Font Verdana 6" #main.wStyle1, "Font Verdana 8" #main.wStyle2, "Font Verdana 8" #main.wStyle3, "Font Verdana 8" #main.wStyle4, "Font Verdana 8" #main.wFore, "!Font Verdana 6" #main.wBack, "!Font Verdana 6" #main.cFirst, "!Font Verdana 10 Bold" #main.cPrev, "!Font Verdana 10 Bold" #main.cNavTxt, "!Font Verdana 10 Bold" #main.cNext, "!Font Verdana 10 Bold" #main.cLast, "!Font Verdana 10 Bold" #main.cAdd, "!Font Verdana 10 Bold" #main.cFontSelect, "!Font Verdana 6" #main.cBack, "!Font Verdana 6" #main.cBitmapBrowse, "!Font Verdana 6" Call NewGUIMenu Wait
Sub XbyMenu Call XbyTrap "#main" End Sub
Sub XbyTrap handle$ If appInfo(3) = 1 Then Close #1 End If Select Case appInfo(4) Case 1 Close #preControl Case 2 Close #preGUI Case 3 Close #preControl Close #preGUI End Select Close #main End End Sub
Sub NewGUIMenu Call NewGUI "#main.new" End Sub
Sub NewGUI handle$ Call InitGUIInfo Call wOpenGUIInfo nControls = 0 appInfo(1) = 0 dControl = 1 appInfo(2) = 1 Call cDefaults Call cEnableDisableControls 0 Call DisplayControl dControl End Sub
Sub SaveAsGUIMenu Call SaveGUI "#main.save" End Sub
Sub SaveGUI handle$ Filedialog "Save Code as ", "*.gui", fGUI$ If fGUI$ = "" Then Exit Sub End If If Instr(fGUI$, ".") = 0 Then fGUI$ = fGUI$;".gui" End If FileExists = FileExists(fGUI$) If FileExists = 1 Then msg$ = fGUI$;" already exists.";Chr$(13); _ "Replace this file?" Confirm msg$; yn$ If yn$ = "no" Then Exit Sub End If End If nControls = appInfo(1) For i = 0 to nControls guiInfo$(i, 0) = "" For j = 1 to 18 guiInfo$(i, 0) = guiInfo$(i, 0);guiInfo$(i, j);Chr$(0) Next j Next i Open fGUI$ for Output as #1 For i = 0 to nControls #1, guiInfo$(i, 0) Next i Close #1 guiInfo$(0, 0) = fGUI$ End Sub
Sub OpenGUIMenu Call OpenGUI "#main.open" End Sub
Sub OpenGUI handle$ Filedialog, "Open", "*.gui", fGUI$ If fGUI$ = "" Then Exit Sub End If FileExists = FileExists(fGUI$) If FileExists = 0 Then Notice "Error finding file." Exit Sub End If ct = 0 Open fGUI$ for Input as #1 While EOF(#1) = 0 ct = ct + 1 Line Input #1, t$ Wend Close #1 nControls = ct - 1 Redim guiInfo$(nControls + 1, 18) guiInfo$(0, 0) = fGUI$ Open fGUI$ for Input as #1 For i = 0 to nControls Line Input #1, t$ For j = 1 to 18 guiInfo$(i, j) = Trim$(Word$(t$, j, Chr$(0))) Next j Next i Close #1 Call wOpenGUIInfo appInfo(1) = nControls dControl = 1 appInfo(2) = 1 Redim dInfo$(18) For i = 1 to 18 dInfo$(i) = guiInfo$(dControl, i) Next i Call DisplayControl dControl guiInfo$(0, 0) = fGUI$ End Sub
Sub CreateCodeMenu Call CreateCode "#main.code" End Sub
Sub CreateCode handle$ WindowWidth = 500 WindowHeight = 400 UpperLeftX = Int((DisplayWidth - WindowWidth) / 2) UpperLeftY = Int((DisplayHeight - WindowHeight) / 2) Call wGuiInfo wStyle$ = guiInfo$(0, 7);", ";guiInfo$(0, 8);", ";guiInfo$(0, 9);", ";guiInfo$(0, 10) Open "Generated Code" for Text as #1 appInfo(3) = 1 #1, "!Trapclose xGeneratedCode" #1, "" #1, "WindowWidth = ";guiInfo$(0, 3) #1, "WindowHeight = ";guiInfo$(0, 4) #1, "" #1, "UpperLeftX = ";guiInfo$(0, 5) #1, "UpperLeftY = ";guiInfo$(0, 6) #1, "" #1, "ForegroundColor$ = ";Chr$(34);guiInfo$(0, 16);Chr$(34) #1, "BackgroundColor$ = ";Chr$(34);guiInfo$(0, 17);Chr$(34) #1, "" nControls = appInfo(1) For i = 1 to nControls style$ = "Stylebits ";guiInfo$(i, 2);", ";guiInfo$(i, 7);", ";guiInfo$(i, 8);", "; _ guiInfo$(i, 9);", ";guiInfo$(i, 10) bClr$ = "" Select Case guiInfo$(i, 11) Case "Bmpbutton" bitmapFile$ = Word$(guiInfo$(i, 15), 2, "!") control$ = "BmpButton ";guiInfo$(i, 2);", "; _ Chr$(34);bitmapFile$;Chr$(34);", ";guiInfo$(i, 13);", UL, "; _ guiInfo$(i, 5);", ";guiInfo$(i, 6) Case "Button" control$ = "Button ";guiInfo$(i, 2);", ";Chr$(34);guiInfo$(i, 1);Chr$(34); _ ", ";guiInfo$(i, 13);", UL, ";guiInfo$(i, 5);", ";guiInfo$(i, 6) cWidth = Val(guiInfo$(i, 3)) cHeight = Val(guiInfo$(i, 4)) If cWidth + cHeight > 0 Then control$ = control$;", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) End If Case "Checkbox" control$ = "Checkbox ";guiInfo$(i, 2);", ";Chr$(34);guiInfo$(i, 1); _ Chr$(34);", ";guiInfo$(i, 13);", ";guiInfo$(i, 14);", ";guiInfo$(i, 5); _ ", ";guiInfo$(i, 6);", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) Case "Combobox" control$ = "Combobox ";guiInfo$(i, 2);", ";guiInfo$(i, 12); _ ", ";guiInfo$(i, 13);", ";guiInfo$(i, 5);", ";guiInfo$(i, 6); _ ", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) If guiInfo$(i, 17) <> "" Then bClr$ = "ComboboxColor$ = ";Chr$(34);guiInfo$(i, 17);Chr$(34) End If Case "Graphicbox" control$ = "Graphicbox ";guiInfo$(i, 2);", ";guiInfo$(i, 5);", "; _ guiInfo$(i, 6);", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) Case "Groupbox" control$ = "Groupbox ";guiInfo$(i, 2);", ";Chr$(34);guiInfo$(i, 1); _ Chr$(34);", ";guiInfo$(i, 5);", ";guiInfo$(i, 6);", ";guiInfo$(i, 3); _ ", ";guiInfo$(i, 4) Case "Listbox" control$ = "Listbox ";guiInfo$(i, 2);", ";guiInfo$(i, 12);", "; _ guiInfo$(i, 13);", ";guiInfo$(i, 5);", ";guiInfo$(i, 6); _ ", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) If guiInfo$(i, 17) <> "" Then bClr$ = "ListboxColor$ = ";Chr$(34);guiInfo$(i, 17);Chr$(34) End If Case "Radiobutton" control$ = "Radiobutton ";guiInfo$(i, 2);", ";Chr$(34);guiInfo$(i, 1); _ Chr$(34);", ";guiInfo$(i, 13);", ";guiInfo$(i, 14);", ";guiInfo$(i, 5); _ ", ";guiInfo$(i, 6);", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) Case "Statictext" control$ = "Statictext ";guiInfo$(i, 2);", ";Chr$(34);guiInfo$(i, 1); _ Chr$(34);", ";guiInfo$(i, 5);", ";guiInfo$(i, 6);", ";guiInfo$(i, 3); _ ", ";guiInfo$(i, 4) Case "Textbox" control$ = "Textbox ";guiInfo$(i, 2);", ";guiInfo$(i, 5);", "; _ guiInfo$(i, 6);", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) If guiInfo$(i, 17) <> "" Then bClr$ = "TextboxColor$ = ";Chr$(34);guiInfo$(i, 17);Chr$(34) End If Case "Texteditor" control$ = "Texteditor ";guiInfo$(i, 2);", ";guiInfo$(i, 5);", "; _ guiInfo$(i, 6);", ";guiInfo$(i, 3);", ";guiInfo$(i, 4) style$ = "" If guiInfo$(i, 17) <> "" Then bClr$ = "TexteditorColor$ = ";Chr$(34);guiInfo$(i, 17);Chr$(34) End If End Select If bClr$ <> "" Then #1, bClr$ End If If style$ <> "" Then #1, style$ End If #1, control$ Next i #1, "" #1, "Stylebits ";guiInfo$(0, 2);", ";wStyle$ #1, "" #1, "Open ";Chr$(34);guiInfo$(0, 1);Chr$(34);" for ";guiInfo$(0, 11);" as ";guiInfo$(0, 2) #1, "Print ";guiInfo$(0, 2);", ";Chr$(34);"Trapclose ";guiInfo$(0, 13);Chr$(34) #1, "" #1, "Print ";guiInfo$(0, 2);", ";Chr$(34);"Font ";guiInfo$(0, 18);Chr$(34) #1, "" For i = 1 to nControls If guiInfo$(i, 18) <> guiInfo$(0, 18) Then Select Case guiInfo$(i, 11) Case "Button", "Groupbox", "Statictext", "Textbox", "Texteditor" #1 guiInfo$(i, 2);", ";Chr$(34);"!Font ";guiInfo$(i, 18);Chr$(34) Case "Checkbox", "Combobox", "Listbox", "Radiobutton" #1 guiInfo$(i, 2);", ";Chr$(34);"Font ";guiInfo$(i, 18);Chr$(34) End Select End If Next i #1, "" #1, "Wait" #1, "" If Instr(guiInfo$(0, 13), "[") > 0 Then #1, guiInfo$(0, 13) #1, "Close ";guiInfo$(0, 2) #1, "End" Else #1, "Sub ";guiInfo$(0, 13);" handle$" #1, "Close ";guiInfo$(0, 2) #1, "End" #1, "End Sub" End If End Sub
Sub xGeneratedCode handle$ Close #1 appInfo(3) = 0 End Sub
Sub PreviewGUIMenu Call PreviewGUI "#main.preview" End Sub
Sub PreviewGUI handle$ Select Case appInfo(4) Case 1 Close #preControl Case 2 Close #preGUI Case 3 Close #preControl Close #preGUI End Select appInfo(4) = 0 Call wGuiInfo If guiInfo$(0, 3) = "DisplayWidth" Then wW = DisplayWidth Else wW = Val(guiInfo$(0, 3)) End If wGUI = wW If guiInfo$(0, 4) = "DisplayHeight" Then wH = DisplayHeight Else wH = Val(guiInfo$(0, 3)) End If hGUI = wH If Instr(guiInfo$(0, 5), "DisplayWidth") > 0 Then UpperLeftX = Int((DisplayWidth - WindowWidth) / 2) Else UpperLeftX = Val(guiInfo$(0, 5)) End If If Instr(guiInfo$(0, 6), "DisplayHeight") > 0 Then UpperLeftY = Int((DisplayHeight - WindowHeight) / 2) Else UpperLeftY = Val(guiInfo$(0, 6)) End If ForegroundColor$ = guiInfo$(0, 16) BackgroundColor$ = guiInfo$(0, 17) wCaption$ = guiInfo$(0, 1) style1$ = guiInfo$(0, 7) style2$ = guiInfo$(0, 8) style3$ = guiInfo$(0, 9) style4$ = guiInfo$(0, 10) wType$ = guiInfo$(0, 11) If Instr(wType$, "_nf") > 0 Then If Instr(style2$, "_WS_SIZEBOX") = 0 Then If style2$ = "0" Then style2$ = "_WS_SIZEBOX" Else style2$ = style2$;" or _WS_SIZEBOX" End If End If End If If Instr(wType$, "_popup") > 0 Then If Instr(style1$, "_WS_POPUP") = 0 Then If style1$ = "0" Then style1$ = "_WS_POPUP" Else style1$ = style1$;" or _WS_POPUP" End If End If If Instr(style2$, "_WS_CAPTION") = 0 Then If style2$ = "0" Then style2$ = "_WS_CAPTION" Else style2$ = style2$;" or _WS_CAPTION" End If End If End If If Instr(wType$, "_fs") > 0 Then WindowWidth = DisplayWidth WindowHeight = DisplayHeight wW = WindowWidth wH = WindowHeight UpperLeftX = Int((DisplayWidth - wW) / 2) UpperLeftY = Int((DisplayHeight - wH) / 2) End If If Instr(wType$, "_nsb") > 0 Then If Instr(style2$, "_WS_HSCROLL") = 0 Then If style2$ = "0" Then style2$ = "_WS_HSCROLL" Else style2$ = style2$;" or _WS_HSCROLL" End If End If If Instr(style2$, "_WS_VSCROLL") = 0 Then If style2$ = "0" Then style2$ = "_WS_VSCROLL" Else style2$ = style2$;" or _WS_VSCROLL" End If End If End If style1 = Eval(style1$) style2 = Eval(style2$) style3 = Eval(style3$) style4 = Eval(style4$) Stylebits #preGUI, style1, style2, style3, style4 nControls = appInfo(1) dControl = appInfo(2) For i = 1 to nControls appInfo(2) = i Call DisplayControl i Call PreviewControl "#main.cCapture" pic$ = "Control";Right$("00";i, 3) cWidth = appInfo(6) cHeight = appInfo(7) NowTime = Time$("ms") DelayTime = NowTime + 100 While NowTime < DelayTime NowTime = Time$("ms") Wend #preControl.g, "Getbmp ";pic$;" 0 0 ";cWidth;" ";cHeight Close #preControl appInfo(4) = 2 Next i appInfo(2) = dControl Call DisplayControl dControl WindowWidth = wGUI WindowHeight = hGUI Select Case Word$(wType$, 1, "_") Case "Window" Graphicbox #preGUI.g, 0, 0, wW, wH Open wCaption$ for Window as #preGUI wControls = 1 Case "Dialog" Graphicbox #preGUI.g, 0, 0, wW, wH Open wCaption$ for Dialog as #preGUI wControls = 1 Case "Graphics" Open wCaption$ for Graphics as #preGUI wControls = 0 Case "Text" If Instr(wType$, "_ins") > 0 Then Open wCaption$ for Text_nsb_ins as #preGUI Else Open wCaption$ for Text as #preGUI End If wControls = 0 End Select If Word$(wType$, 1, "_") = "Text" Then #preGUI, "!Trapclose xPreGUI" Else #preGUI, "Trapclose xPreGUI" End If If wControls = 1 Then #preGUI.g, "Down; Fill ";guiInfo$(0, 17) For i = 1 to nControls x = Val(guiInfo$(i, 5)) y = Val(guiInfo$(i, 6)) pic$ = "Control";Right$("00";i, 3) #preGUI.g, "Drawbmp ";pic$;" ";x;" ";y Next i #preGUI.g, "Flush" End If If appInfo(4) = 1 Then appInfo(4) = 3 Else appInfo(4) = 2 End If End Sub
Sub xPreGUI handle$ nControls = appInfo(1) For i = 1 to nControls pic$ = "Control";Right$("00";i, 3) Unloadbmp pic$ Next i Close #preGUI If appInfo(4) = 3 Then appInfo(4) = 1 Else appInfo(4) = 0 End If End Sub
Sub zPreControl handle$ null = 0 End Sub
Sub xPreControl handle$ Close #preControl If appInfo(4) = 3 Then appInfo(4) = 2 Else appInfo(4) = 0 End If End Sub
Sub PreviewControl handle$ Select Case appInfo(4) Case 1 Close #preControl appInfo(4) = 0 Case 3 Close #preControl appInfo(4) = 2 End Select If handle$ = "#main.cCapture" Then capture = 1 Else capture = 0 End If nControls = appInfo(1) dControl = appInfo(2) Call cGUIInfo dControl If guiInfo$(dControl, 11) = "" Then cType$ = "control" Else cType$ = guiInfo$(dControl, 11) End If CompleteControlInfo = CompleteControlInfo(dControl) If CompleteControlInfo = 0 Then msg$ = "Error";Chr$(13);Chr$(13); _ "Incomplete Information.";Chr$(10);Chr$(13); _ "Cannot preview ";cType$;"." Notice msg$ Exit Sub End If ForegroundColor$ = guiInfo$(0, 16) BackgroundColor$ = guiInfo$(0, 17) cWidth = Val(guiInfo$(dControl, 3)) cHeight = Val(guiInfo$(dControl, 4)) cType$ = guiInfo$(dControl, 11) cText$ = guiInfo$(dControl, 1) cBitmap$ = Word$(guiInfo$(dControl, 15), 2, "!") If cType$ = "Bmpbutton" Then cBitmapCoord$ = BitmapCoord$(cBitmap$) If cBitmapCoord$ = "X-X" Then cType$ = "Button" cText$ = "Bitmap Unavailable" cWidth = 0 cHeight = 0 Else cWidth = Val(Word$(cBitmapCoord$, 1, "-")) cHeight = Val(Word$(cBitmapCoord$, 2, "-")) End If End If wW = Max(100, cWidth + 50) wH = Max(150, cHeight + 100) WindowWidth = wW WindowHeight = wH UpperLeftX = Int((800 - wW) / 2) UpperLeftY = Int((600 - wH) / 2) If capture = 1 Then cUlx = 0 cUly = 0 bUlx = 0 Else cUlx = Min(20, Int(wW / 2 - cWidth / 2)) cUly = 20 bUlx = Int(wW / 2 - 24) End If cColor$ = guiInfo$(dControl, 16) cFont$ = guiInfo$(dControl, 18) cStyle1$ = guiInfo$(dControl, 7) If cStyle1$ = "" Then cStyle1$ = "0" End If cStyle1 = Eval(cStyle1$) cStyle2$ = guiInfo$(dControl, 8) If cStyle2$ = "" Then cStyle2$ = "0" End If cStyle2 = Eval(cStyle2$) cStyle3$ = guiInfo$(dControl, 9) If cStyle3$ = "" Then cStyle3$ = "0" End If cStyle3 = Eval(cStyle3$) cStyle4$ = guiInfo$(dControl, 10) If cStyle4$ = "" Then cStyle4$ = "0" End If cStyle4 = Eval(cStyle4$) Select Case cType$ Case "Bmpbutton" Bmpbutton #preControl.c, cBitmap$, zPreControl, UL, cUlx, cUly font$ = "X" Case "Button" If cWidth + cHeight > 0 Then Button #preControl.c, cText$, zPreControl, UL, cUlx, cUly, cWidth, cHeight Else Button #preControl.c, cText$, zPreControl, UL, cUlx, cUly cWidth = wW cHeight = wH End If If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = "!";cFont$ End If Case "Checkbox" Checkbox #preControl.c, cText$, zPreControl, zPreControl, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = guiInfo$(0, 18) Else font$ = cFont$ End If Case "Combobox" If guiInfo$(dControl, 17) <> "" Then ComboboxColor$ = guiInfo$(dControl, 17) End If Combobox #preControl.c, cArray$(), zPreControl, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = cFont$ End If Case "Graphicbox" Graphicbox #preControl.c, cUlx, cUly, cWidth, cHeight Case "Groupbox" Groupbox #preControl.c, cText$, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = "!";cFont$ End If Case "Listbox" If guiInfo$(dControl, 17) <> "" Then ListboxColor$ = guiInfo$(dControl, 17) End If Listbox #preControl.c, cArray$(), zPreControl, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = cFont$ End If Case "Radiobutton" Radiobutton #preControl.c, cText$, zPreControl, zPreControl, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = guiInfo$(0, 18) Else font$ = cFont$ End If Case "Statictext" Statictext #preControl.c, cText$, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = "!";cFont$ End If Case "Textbox" If guiInfo$(dControl, 17) <> "" Then TextboxColor$ = guiInfo$(dControl, 17) End If Textbox #preControl.c, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = "!";cFont$ End If Case "Texteditor" If guiInfo$(dControl, 17) <> "" Then TexteditorColor$ = guiInfo$(dControl, 17) End If Texteditor #preControl.c, cUlx, cUly, cWidth, cHeight If cFont$ = "" Then font$ = "!";guiInfo$(0, 18) Else font$ = "!";cFont$ End If End Select If capture = 0 Then Button #preControl.def, "Close", xPreControl, UL, bUlx, wH - 75, 40, 30 Else Graphicbox #preControl.g, 0, 0, 1, 1 End If Stylebits #preControl.c, cStyle1, cStyle2, cStyle3, cStyle4 Stylebits #preControl, _WS_POPUP or _WS_DLGFRAME, _WS_CAPTION, 0, 0 Open "" for Dialog_modal as #preControl #preControl, "Trapclose xPreControl" If font$ <> "X" Then If Left$(font$, 1) = "!" Then #preControl.c, "!Font ";Mid$(font$, 2) Else #preControl.c, "Font ";font$ End If End If appInfo(6) = cWidth appInfo(7) = cHeight End Sub
Sub wGuiInfo #main.wCaption, "!Contents? wCaption$" guiInfo$(0, 1) = wCaption$ #main.wHandle, "!Contents? wHandle$" guiInfo$(0, 2) = wHandle$ #main.wWidth, "!Contents? wWidth$" guiInfo$(0, 3) = wWidth$ #main.wHeight, "!Contents? wHeight$" guiInfo$(0, 4) = wHeight$ #main.wUlx, "!Contents? wUlx$" guiInfo$(0, 5) = wUlx$ #main.wUly, "!Contents? wUly$" guiInfo$(0, 6) = wUly$ #main.wStyle, "!Contents? wStyle$" guiInfo$(0, 7) = Trim$(Word$(wStyle$, 1, ",")) guiInfo$(0, 8) = Trim$(Word$(wStyle$, 2, ",")) guiInfo$(0, 9) = Trim$(Word$(wStyle$, 3, ",")) guiInfo$(0, 10) = Trim$(Word$(wStyle$, 4, ",")) wType$ = guiInfo$(0, 11) #main.wTrap, "!Contents? wTrap$" guiInfo$(0, 13) = wTrap$ wFore$ = guiInfo$(0, 16) wBack$ = guiInfo$(0, 17) wFont$ = guiInfo$(0, 18) End Sub
Sub InitGUIInfo Redim guiInfo$(1, 18) guiInfo$(0, 1) = "Title of Application" 'Window Caption guiInfo$(0, 2) = "#main" 'Window Handle guiInfo$(0, 3) = "800" 'WindowWidth guiInfo$(0, 4) = "600" 'WindowHeight guiInfo$(0, 5) = "CenterX" 'ULX guiInfo$(0, 6) = "CenterY" 'ULY guiInfo$(0, 7) = "0" 'Stylebits: AddBits guiInfo$(0, 8) = "0" 'Stylebits: RemoveBits guiInfo$(0, 9) = "0" 'Stylebits: AddExtendedBits guiInfo$(0, 10) = "0" 'Stylebits: RemoveExtendedBits guiInfo$(0, 11) = "Window" 'Window Type guiInfo$(0, 12) = "" 'Associated Array guiInfo$(0, 13) = "[quit]" ' Trapclose guiInfo$(0, 14) = "" ' SubEvent 2 guiInfo$(0, 15) = "" ' Associated Bitmap guiInfo$(0, 16) = "Black" guiInfo$(0, 17) = "Buttonface" guiInfo$(0, 18) = "verdana 10" Redim wType$(19) wType$(1) = "Window" wType$(2) = "Window_nf" wType$(3) = "Window_popup" wType$(4) = "Dialog" wType$(5) = "Dialog_modal" wType$(6) = "Dialog_nf" wType$(7) = "Dialog_nf_modal" wType$(8) = "Dialog_fs" wType$(9) = "Dialog_nf_fs" wType$(10) = "Dialog_popup" wType$(11) = "Graphics" wType$(12) = "Graphics_fs" wType$(13) = "Graphics_nsb" wType$(14) = "Graphics_fs_nsb" wType$(15) = "Graphics_nf_nsb" wType$(16) = "Text" wType$(17) = "Text_fs" wType$(18) = "Text_nsb" wType$(19) = "Text_nsb_ins" Redim cType$(11) cType$(1) = "Bmpbutton" cType$(2) = "Button" cType$(3) = "Checkbox" cType$(4) = "Combobox" cType$(5) = "Graphicbox" cType$(6) = "Groupbox" cType$(7) = "Listbox" cType$(8) = "Radiobutton" cType$(9) = "Statictext" cType$(10) = "Textbox" cType$(11) = "Texteditor" End Sub
Sub wOpenGUIInfo #main.wCaption, "!Font ";guiInfo$(0, 18) #main.wCaption, guiInfo$(0, 1) #main.wHandle, guiInfo$(0, 2) #main.wWidth, guiInfo$(0, 3) #main.wHeight, guiInfo$(0, 4) If guiInfo$(0, 5) = "CenterX" Then #main.wUlx, "Int((DisplayWidth - WindowWidth) / 2)" Else #main.wUlx, guiInfo$(0, 5) End If If guiInfo$(0, 6) = "CenterY" Then #main.wUly, "Int((DisplayHeight - WindowHeight) / 2)" Else #main.wUly, guiInfo$(0, 6) End If wStyle1$ = guiInfo$(0, 7) wStyle2$ = guiInfo$(0, 8) wStyle3$ = guiInfo$(0, 9) wStyle4$ = guiInfo$(0, 10) wStyle$ = wStyle1$;", ";wStyle2$;", ";wStyle3$;", ";wStyle4$ #main.wStyle, wStyle$ wType$ = guiInfo$(0, 11) #main.wType, "Select wType$" #main.wForeGraph, "Cls; Fill ";guiInfo$(0, 16) #main.wForeGraph, "Flush" #main.wBackGraph, "Cls; Fill ";guiInfo$(0, 17) #main.wBackGraph, "Flush" #main.wTrap, guiInfo$(0, 13) #main.wType, "Select Window" End Sub
Sub wLoadStyles Redim wStyle1$(14) Redim wStyle2$(14) wStyle1$(1) = Space$(5);"0" wStyle1$(2) = "_WS_VISIBLE" wStyle1$(3) = "_WS_CAPTION" wStyle1$(4) = "_WS_SYSMENU" wStyle1$(5) = "_WS_DISABLED" wStyle1$(6) = "_WS_BORDER" wStyle1$(7) = "_WS_DLGFRAME" wStyle1$(8) = "_WS_MINIMIZEBOX" wStyle1$(9) = "_WS_MAXIMIZEBOX" wStyle1$(10) = "_WS_POPUP" wStyle1$(11) = "_WS_HSCROLL" wStyle1$(12) = "_WS_VSCROLL" wStyle1$(13) = "" ' _DS_CENTER wStyle1$(14) = "" ' _DS_CENTERMOUSE For i = 1 to 11 wStyle2$(i) = wStyle1$(i) Next i Redim wStyle3$(5) Redim wStyle4$(5) wStyle3$(1) = Space$(5);"0" wStyle3$(2) = "_WS_EX_CLIENTEDGE" wStyle3$(3) = "_WS_EX_STATICEDGE" wStyle3$(4) = "_WS_EX_TOOLWINDOW" wStyle3$(5) = "_WS_EX_TOPMOST" For i = 1 to 5 wStyle4$(i) = wStyle3$(i) Next i End Sub
Sub guiFont handle$ If Instr(handle$, "#main.w") > 0 Then dControl = 0 Else dControl = appInfo(2) End If If guiInfo$(dControl, 18) = "" Then t$ = guiInfo$(0, 18) Else t$ = guiInfo$(dControl, 18) End If Fontdialog, t$, newFont$ If newFont$ = "" Then Exit Sub End If guiInfo$(dControl, 18) = newFont$ If dControl = 0 Then #main.wCaption, "!Font ";newFont$ End If End Sub
Sub wDW handle$ #main.wWidth, "DisplayWidth" End Sub
Sub wDH handle$ #main.wHeight, "DisplayHeight" End Sub
Sub wCH handle$ #main.wUlx, "Int((DisplayWidth - WindowWidth) / 2)" End Sub
Sub wCV handle$ #main.wUly, "Int((DisplayHeight - WindowHeight) / 2)" End Sub
Sub wType handle$ #main.wType, "Selectionindex? index" wType$ = wType$(index) guiInfo$(0, 11) = wType$ If Instr(wType$, "Dialog") > 0 Then wStyle1$(13) = "_DS_CENTER" wStyle1$(14) = "_DS_CENTERMOUSE" wStyle2$(13) = wStyle1$(13) wStyle2$(14) = wStyle1$(14) Else wStyle1$(13) = "" wStyle1$(14) = "" wStyle2$(13) = wStyle1$(13) wStyle2$(14) = wStyle1$(14) End If #main.wStyle1, "Reload" #main.wStyle2, "Reload" End Sub
Sub ForeBackColor handle$ appInfo(3) = 1 WindowWidth = 112 WindowHeight = 112 Select Case handle$ Case "#main.wFore" UpperLeftX = 375 UpperLeftY = 225 Graphicbox #1.gF, 0, 0, 105, 85 gHandle$ = "#1.gF" Case "#main.wBack" UpperLeftX = 460 UpperLeftY = 225 Graphicbox #1.gB, 0, 0, 105, 85 gHandle$ = "#1.gB" Case "#main.cBack" UpperLeftX = 200 UpperLeftY = 400 Graphicbox #1.gC, 0, 0, 105, 85 gHandle$ = "#1.gC" End Select Stylebits #1, 0, _WS_CAPTION, 0, 0 Open "" for Dialog_Modal as #1 #1, "Trapclose xDialogTrap" hue$ = "Buttonface Yellow Brown Red Darkred Pink Darkpink "; _ "Blue Darkblue Green Darkgreen Cyan DarkCyan White "; _ "Black Lightgray Darkgray" #gHandle$, "Down" x = 0 y = 0 For i = 1 to 15 clr$ = Word$(hue$, i) #gHandle$, "Color ";clr$ #gHandle$, "Backcolor ";clr$ #gHandle$, "Place ";x;" ";y #gHandle$, "Boxfilled ";x + 20;" ";y + 20 x = x + 20 If x = 100 Then x = 0 y = y + 20 End If Next i For i = 16 to 17 clr$ = Word$(hue$, i) #gHandle$, "Color ";clr$ #gHandle$, "Backcolor ";clr$ #gHandle$, "Place ";x;" ";y #gHandle$, "Boxfilled ";x + 20;" ";y + 20 x = x + 80 Next i #gHandle$, "Color Black; Backcolor White" #gHandle$, "Font Verdana 8 Bold" #gHandle$, "Place 30 75" #gHandle$, "\Cancel" #gHandle$, "Flush" #gHandle$, "When leftButtonUp xDialogClick" End Sub
Sub xDialogClick handle$, xVar, yVar dControl = appInfo(2) hue$ = "Buttonface Yellow Brown Red Darkred Pink Darkpink "; _ "Blue Darkblue Green Darkgreen Cyan DarkCyan White "; _ "Black Lightgray Darkgray" col = Int(xVar / 20) + 1 col = Min(col, 5) Select Case Case yVar < 20 row = 1 Case yVar < 40 row = 2 Case yVar < 60 row = 3 Case yVar < 80 row = 4 Case Else row = 0 End Select nHue = col + (row - 1) * 5 If nHue = 20 Then nHue = 17 End If clr$ = Word$(hue$, nHue) If clr$ <> "" Then Select Case handle$ Case "#1.gF" #main.wForeGraph, "Cls; Fill ";clr$ #main.wForeGraph, "Flush" guiInfo$(0, 16) = clr$ Case "#1.gB" #main.wBackGraph, "Cls; Fill ";clr$ #main.wBackGraph, "Flush" guiInfo$(0, 17) = clr$ Case "#1.gC" #main.cBackGraph, "Cls; Fill ";clr$ #main.cBackGraph, "Flush" guiInfo$(dControl, 17) = clr$ End Select End If Call xDialogTrap Word$(handle$, 1, ".") End Sub
Sub xDialogTrap handle$ Close #handle$ appInfo(3) = 0 End Sub
Sub wStyle handle$ #main.wStyle, "!Contents? style$" style1$ = Trim$(Word$(style$, 1, ",")) style2$ = Trim$(Word$(style$, 2, ",")) style3$ = Trim$(Word$(style$, 3, ",")) style4$ = Trim$(Word$(style$, 4, ",")) #handle$, "Selectionindex? index" Select Case handle$ Case "#main.wStyle1" wStyle$ = style1$ xStyle$ = style2$ addStyle$ = wStyle1$(index) Case "#main.wStyle2" wStyle$ = style2$ xStyle$ = style1$ addStyle$ = wStyle2$(index) Case "#main.wStyle3" wStyle$ = style3$ xStyle$ = style4$ addStyle$ = wStyle3$(index) Case "#main.wStyle4" wStyle$ = style4$ xStyle$ = style3$ addStyle$ = wStyle4$(index) End Select If Trim$(addStyle$) = "0" Then wStyle$ = "0" Else wStyle$ = AddStyle$(wStyle$, addStyle$) xStyle$ = RemoveStyle$(xStyle$, addStyle$) End If Select Case handle$ Case "#main.wStyle1" style1$ = wStyle$ style2$ = xStyle$ Case "#main.wStyle2" style1$ = xStyle$ style2$ = wStyle$ Case "#main.wStyle3" style3$ = wStyle$ style4$ = xStyle$ Case "#main.wStyle4" style3$ = xStyle$ style4$ = wStyle$ End Select #main.wStyle, style1$;", ";style2$;", ";style3$;", ";style4$ End Sub
Sub wDefaults #main.wCaption, guiInfo$(0, 1) #main.wHandle, guiInfo$(0, 2) #main.wWidth, guiInfo$(0, 3) #main.wHeight, guiInfo$(0, 4) If guiInfo$(0, 5) = "CenterX" Then #main.wUlx, "Int((DisplayWidth - WindowWidth) / 2)" Else #main.wUlx, guiInfo$(0, 5) End If If guiInfo$(0, 6) = "CenterY" Then #main.wUly, "Int((DisplayHeight - WindowHeight) / 2)" Else #main.wUly, guiInfo$(0, 6) End If wStyle$ = guiInfo$(0, 7);", ";guiInfo$(0, 8);", ";guiInfo$(0, 9);", ";guiInfo$(0, 10) #main.wStyle, wStyle$ #main.wTrap, guiInfo$(0, 13) #main.wForeGraph, "Down; Fill ";guiInfo$(0, 16) #main.wForeGraph, "Flush" #main.wBackGraph, "Down; Fill ";guiInfo$(0, 17) #main.wBackGraph, "Flush" #main.wType, "Selectindex 1" End Sub
Sub cLoadStyles cType$ Select Case cType$ Case "Bmpbutton", "Button", "Checkbox", "Radiobutton" Redim cStyle1$(29) Redim cStyle2$(29) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_BS_3STATE" cStyle1$(3) = "_BS_AUTO3STATE" cStyle1$(4) = "_BS_AUTOCHECKBOX" cStyle1$(5) = "_BS_AUTORADIOBUTTON" cStyle1$(6) = "_BS_BITMAP" cStyle1$(7) = "_BS_BOTTOM" cStyle1$(8) = "_BS_CENTER" cStyle1$(9) = "_BS_CHECKBOX" cStyle1$(10) = "_BS_DEFPUSHBUTTON" cStyle1$(11) = "_BS_FLAT" cStyle1$(12) = "_BS_GROUPBOX" cStyle1$(13) = "_BS_ICON" cStyle1$(14) = "_BS_LEFT" cStyle1$(15) = "_BS_LEFTTEXT" cStyle1$(16) = "_BS_MULTILINE" cStyle1$(17) = "_BS_NOTIFY" cStyle1$(18) = "_BS_OWNERDRAW" cStyle1$(19) = "_BS_PUSHBUTTON" cStyle1$(20) = "_BS_PUSHLIKE" cStyle1$(21) = "_BS_RADIOBUTTON" cStyle1$(22) = "_BS_RIGHT" cStyle1$(23) = "_BS_TOP" cStyle1$(24) = "_BS_USERBUTTON" cStyle1$(25) = "_BS_VCENTER" cStyle1$(26) = "_WS_BORDER" cStyle1$(27) = "_WS_DLGFRAME" cStyle1$(28) = "_WS_VISIBLE" cStyle1$(29) = "_WS_TABSTOP" For i = 1 to 29 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Combobox" Redim cStyle1$(18) Redim cStyle2$(18) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_CBS_AUTOHSCROLL" cStyle1$(3) = "_CBS_DISABLENOSCROLL" cStyle1$(4) = "_CBS_DROPDOWN" cStyle1$(5) = "_CBS_DROPDOWNLIST" cStyle1$(6) = "_CBS_HASSTRINGS" cStyle1$(7) = "_CBS_LOWERCASE" cStyle1$(8) = "_CBS_NOINTEGRALHEIGHT" cStyle1$(9) = "_CBS_OEMCONVERT" cStyle1$(10) = "_CBS_OWNERDRAWFIXED" cStyle1$(11) = "_CBS_OWNERDRAWVARIABLE" cStyle1$(12) = "_CBS_SIMPLE" cStyle1$(13) = "_CBS_SORT" cStyle1$(14) = " _CBS_UPPERCASE" cStyle1$(15) = "_WS_BORDER" cStyle1$(16) = "_WS_DLGFRAME" cStyle1$(17) = "_WS_VISIBLE" cStyle1$(18) = "_WS_TABSTOP" For i = 1 to 18 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Listbox" Redim cStyle1$(21) Redim cStyle2$(21) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_LBS_DISABLENOSCROLL" cStyle1$(3) = "_LBS_EXTENDEDSEL" cStyle1$(4) = "_LBS_HASSTRINGS" cStyle1$(5) = "_LBS_MULTICOLUMN" cStyle1$(6) = "_LBS_MULTIPLESEL" cStyle1$(7) = "_LBS_NODATA" cStyle1$(8) = "_LBS_NOINTEGRALHEIGHT" cStyle1$(9) = "_LBS_NOREDRAW" cStyle1$(10) = "_LBS_NOSEL" cStyle1$(11) = "_LBS_NOTIFY" cStyle1$(12) = "_LBS_OWNERDRAWFIXED" cStyle1$(13) = "_LBS_OWNERDRAWVARIABLE" cStyle1$(14) = "_LBS_SORT" cStyle1$(15) = "_LBS_STANDARD" cStyle1$(16) = "_LBS_USETABSTOPS" cStyle1$(17) = "_LBS_WANTKEYBOARDINPUT" cStyle1$(18) = "_WS_BORDER" cStyle1$(19) = "_WS_DLGFRAME" cStyle1$(20) = "_WS_VISIBLE" cStyle1$(21) = "_WS_TABSTOP" For i = 1 to 21 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Graphicbox" Redim cStyle1$(5) Redim cStyle2$(5) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_WS_BORDER" cStyle1$(3) = "_WS_DLGFRAME" cStyle1$(4) = "_WS_VISIBLE" cStyle1$(5) = "_WS_TABSTOP" For i = 1 to 5 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Statictext" Redim cStyle1$(30) Redim cStyle2$(30) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_SS_BITMAP" cStyle1$(3) = "_SS_BLACKFRAME" cStyle1$(4) = "_SS_BLACKRECT" cStyle1$(5) = "_SS_CENTER" cStyle1$(6) = "_SS_CENTERIMAGE" cStyle1$(7) = "_SS_ENHMETAFILE" cStyle1$(8) = "_SS_ETCHEDFRAME" cStyle1$(9) = "_SS_ETCHEDHORZ" cStyle1$(10) = "_SS_ETCHEDVERT" cStyle1$(11) = "_SS_GRAYFRAME" cStyle1$(12) = "_SS_GRAYRECT" cStyle1$(13) = "_SS_ICON" cStyle1$(14) = "_SS_LEFT" cStyle1$(15) = "_SS_LEFTNOWORDWRAP" cStyle1$(16) = "_SS_NOPREFIX" cStyle1$(17) = "_SS_NOTIFY" cStyle1$(18) = "_SS_OWNERDRAW" cStyle1$(19) = "_SS_REALSIZEIMAGE" cStyle1$(20) = "_SS_RIGHT" cStyle1$(21) = "_SS_RIGHTJUST" cStyle1$(22) = "_SS_SIMPLE" cStyle1$(23) = "_SS_SUNKEN" cStyle1$(24) = "_SS_TYPEMASK" cStyle1$(25) = "_SS_WHITEFRAME" cStyle1$(26) = "_SS_WHITERECT" cStyle1$(27) = "_WS_BORDER" cStyle1$(28) = "_WS_DLGFRAME" cStyle1$(29) = "_WS_VISIBLE" cStyle1$(30) = "_WS_TABSTOP" For i = 1 to 30 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Textbox" Redim cStyle1$(19) Redim cStyle2$(19) cStyle1$(1) = Space$(5);"0" cStyle1$(2) = "_ES_AUTOHSCROLL" cStyle1$(3) = "_ES_AUTOVSCROLL" cStyle1$(4) = "_ES_CENTER" cStyle1$(5) = "_ES_LEFT" cStyle1$(6) = "_ES_LOWERCASE" cStyle1$(7) = "_ES_MULTILINE" cStyle1$(8) = "_ES_NOHIDESEL" cStyle1$(9) = "_ES_NUMBER" cStyle1$(10) = "_ES_OEMCONVERT" cStyle1$(11) = "_ES_PASSWORD" cStyle1$(12) = "_ES_READONLY" cStyle1$(13) = "_ES_RIGHT" cStyle1$(14) = "_ES_UPPERCASE" cStyle1$(15) = "_ES_WANTRETURN" cStyle1$(16) = "_WS_BORDER" cStyle1$(17) = "_WS_DLGFRAME" cStyle1$(18) = "_WS_VISIBLE" cStyle1$(19) = "_WS_TABSTOP" For i = 1 to 19 cStyle2$(i) = cStyle1$(i) Next i Redim cStyle3$(3) Redim cStyle4$(3) cStyle3$(1) = Space$(5);"0" cStyle3$(2) = "_WS_EX_CLIENTEDGE" cStyle3$(3) = "_WS_EX_STATICEDGE" cStyle4$(1) = Space$(5);"0" cStyle4$(2) = "_WS_EX_CLIENTEDGE" cStyle4$(3) = "_WS_EX_STATICEDGE" Case "Texteditor" Redim cStyle1$(1) Redim cStyle2$(1) Redim cStyle3$(1) Redim cStyle4$(1) End Select End Sub
Sub cStyle handle$ #main.cStyle, "!Contents? style$" style1$ = Trim$(Word$(style$, 1, ",")) style2$ = Trim$(Word$(style$, 2, ",")) style3$ = Trim$(Word$(style$, 3, ",")) style4$ = Trim$(Word$(style$, 4, ",")) #handle$, "Selectionindex? index" Select Case handle$ Case "#main.cStyle1" cStyle$ = style1$ xStyle$ = style2$ addStyle$ = cStyle1$(index) Case "#main.cStyle2" cStyle$ = style2$ xStyle$ = style1$ addStyle$ = cStyle2$(index) Case "#main.cStyle3" cStyle$ = style3$ xStyle$ = style4$ addStyle$ = cStyle3$(index) Case "#main.cStyle4" cStyle$ = style4$ xStyle$ = style3$ addStyle$ = cStyle4$(index) End Select If Trim$(addStyle$) = "0" Then cStyle$ = "0" Else cStyle$ = AddStyle$(cStyle$, addStyle$) xStyle$ = RemoveStyle$(xStyle$, addStyle$) End If Select Case handle$ Case "#main.cStyle1" style1$ = cStyle$ style2$ = xStyle$ Case "#main.cStyle2" style1$ = xStyle$ style2$ = cStyle$ Case "#main.cStyle3" style3$ = cStyle$ style4$ = xStyle$ Case "#main.cStyle4" style3$ = xStyle$ style4$ = cStyle$ End Select #main.cStyle, style1$;", ";style2$;", ";style3$;", ";style4$ End Sub
Sub cDefaults dControl = appInfo(2) #main.cTextTxt, "Control Text" #main.cFontSelect, "Control Font" #main.cHandleTxt, "Control Handle" #main.cPropTxt, "Control Properties" #main.cArrayTxt, "Control Array" #main.cBitmapTxt, "Control Color/Bitmap" #main.cBackGraph, "Cls; Fill Buttonface; Flush" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "Browse" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cStyleTxt, "Control Stylebits" If dControl > 0 Then guiInfo$(dControl, 18) = guiInfo$(0, 18) For i = 7 to 10 guiInfo$(dControl, i) = "0" Next i #main.cStyle, "0, 0, 0, 0" End If Redim cStyle1$(10) #main.cStyle1, "Reload" #main.cStyle1, "Select 0" Redim cStyle2$(10) #main.cStyle2, "Reload" #main.cStyle2, "Select 0" Redim cStyle3$(10) #main.cStyle3, "Reload" #main.cStyle3, "Select 0" Redim cStyle4$(10) #main.cStyle4, "Reload" #main.cStyle4, "Select 0" #main.cTypeTxt, "Control Type" #main.cType, "Setfocus" End Sub
Sub cEnableDisableControls flag nControls = appInfo(1) dControl = appInfo(2) If flag = 0 Then #main.cPreview, "!Disable" #main.cSave, "!Disable" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "!Disable" #main.cHandleTxt, "!Disable" #main.cHandle, "!Disable" #main.cPropTxt, "!Disable" #main.cUlxTxt, "!Disable" #main.cUlx, "!Disable" #main.cUlyTxt, "!Disable" #main.cUly, "!Disable" #main.cWidthTxt, "!Disable" #main.cWidth, "!Disable" #main.cHeightTxt, "!Disable" #main.cHeight, "!Disable" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "!Disable" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cSub1Txt, "!Disable" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "!Disable" #main.cStyle, "!Disable" #main.cStyle1Txt, "!Disable" #main.cStyle1, "Disable" #main.cStyle2Txt, "!Disable" #main.cStyle2, "Disable" #main.cStyle3Txt, "!Disable" #main.cStyle3, "Disable" #main.cStyle4Txt, "!Disable" #main.cStyle4, "Disable" #main.cTypeTxt, "!Disable" #main.cType, "Disable" nControls = appInfo(1) If nControls = 0 Then #main.cFirst, "!Disable" #main.cPrev, "!Disable" #main.cNext, "!Disable" #main.cLast, "!Disable" End If Else #main.cTextTxt, "!Enable" #main.cText, "!Enable" #main.cFontSelect, "!Enable" #main.cHandleTxt, "!Enable" #main.cHandle, "!Enable" #main.cPropTxt, "!Enable" #main.cUlxTxt, "!Enable" #main.cUlx, "!Enable" #main.cUlyTxt, "!Enable" #main.cUly, "!Enable" #main.cWidthTxt, "!Enable" #main.cWidth, "!Enable" #main.cHeightTxt, "!Enable" #main.cHeight, "!Enable" #main.cArrayTxt, "!Enable" #main.cArray, "!Enable" #main.cBitmapTxt, "!Enable" #main.cBitmap, "!Enable" #main.cBitmapBrowse, "!Enable" #main.cSub1Txt, "!Enable" #main.cSub1, "!Enable" #main.cSub2Txt, "!Enable" #main.cSub2, "!Enable" #main.cStyleTxt, "!Enable" #main.cStyle, "!Enable" #main.cStyle1Txt, "!Enable" #main.cStyle1, "Enable" #main.cStyle2Txt, "!Enable" #main.cStyle2, "Enable" #main.cStyle3Txt, "!Enable" #main.cStyle3, "Enable" #main.cStyle4Txt, "!Enable" #main.cStyle4, "Enable" #main.cTypeTxt, "!Enable" #main.cType, "Enable" End If If dControl = 0 Then #main.cPreview, "!Disable" #main.cSave, "!Disable" Else #main.cPreview, "!Enable" #main.cSave, "!Enable" End If End Sub
Sub cNavButtons nControls = appInfo(1) dControl = appInfo(2) #main.cFirst, "!Disable" #main.cPrev, "!Disable" #main.cNext, "!Disable" #main.cLast, "!Disable" If dControl > 1 Then #main.cFirst, "!Enable" #main.cPrev, "!Enable" End If If dControl < nControls Then #main.cNext, "!Enable" #main.cLast, "!Enable" End If End Sub
Sub ControlNavigation handle$ nControls = appInfo(1) dControl = appInfo(2) If dControl > 0 Then ControlModified = ControlModified(dControl) Else ControlModified = 0 End If If ControlModified = 1 Then #main.cType, "Selection? cType$" If cType$ = "" Then cType$ = "This control" End If msg$ = cType$;" has not been saved.";Chr$(10);Chr$(13); _ "Continue anyway?" Confirm msg$;yn$ If yn$ = "no" Then Exit Sub End If End If If dControl > 0 Then For i = 1 to 18 guiInfo$(dControl, i) = dInfo$(i) Next i End If Redim dInfo$(18) Select Case handle$ Case "#main.cFirst" dControl = 1 appInfo(2) = dControl Case "#main.cPrev" dControl = dControl - 1 appInfo(2) = dControl Case "#main.cNext" dControl = dControl + 1 appInfo(2) = dControl Case "#main.cLast" dControl = nControls appInfo(2) = dControl Case "#main.cAdd" appInfo(2) = nControls + 1 dControl = appInfo(2) Call cDefaults #main.cType, "Enable" #main.cType, "Selectindex 0" End Select For i = 1 to 18 dInfo$(i) = guiInfo$(dControl, i) Next i Call DisplayControl dControl Call cNavButtons End Sub
Sub cGUIInfo dControl #main.cText, "!Contents? cText$" guiInfo$(dControl, 1) = cText$ #main.cHandle, "!Contents? cHandle$" guiInfo$(dControl, 2) = cHandle$ #main.cWidth, "!Contents? cWidth$" guiInfo$(dControl, 3) = cWidth$ #main.cHeight, "!Contents? cHeight$" guiInfo$(dControl, 4) = cHeight$ #main.cUlx, "!Contents? cUlx$" guiInfo$(dControl, 5) = cUlx$ #main.cUly, "!Contents? cUly$" guiInfo$(dControl, 6) = cUly$ #main.cStyle, "!Contents? cStyle$" guiInfo$(dControl, 7) = Trim$(Word$(cStyle$, 1, ",")) guiInfo$(dControl, 8) = Trim$(Word$(cStyle$, 2, ",")) guiInfo$(dControl, 9) = Trim$(Word$(cStyle$, 3, ",")) guiInfo$(dControl, 10) = Trim$(Word$(cStyle$, 4, ",")) #main.cType, "Selection? cType$" guiInfo$(dControl, 11) = cType$ #main.cArray, "!Contents? cArray$" guiInfo$(dControl, 12) = cArray$ #main.cSub1, "!Contents? cSub1$" guiInfo$(dControl, 13) = cSub1$ #main.cSub2, "!Contents? cSub2$" guiInfo$(dControl, 14) = cSub2$ #main.cBitmap, "!Contents? cBitmap$" guiInfo$(dControl, 15) = cBitmap$ End Sub
Sub AddControl nControls = appInfo(1) dControl = nControls + 1 appInfo(2) = dControl Redim tempInfo$(dControl, 18) For i = 0 to dControl For j = 1 to 18 tempInfo$(i, j) = guiInfo$(i, j) Next j Next i Redim guiInfo$(dControl + 1, 18) For i = 0 to dControl For j = 1 to 18 guiInfo$(i, j) = tempInfo$(i, j) Next j Next i End Sub
Sub SaveControl handle$ nControls = appInfo(1) dControl = appInfo(2) Call cGUIInfo dControl cType$ = guiInfo$(dControl, 11) If cType$ = "" Then cType$ = "this control" End If CompleteControlInfo = CompleteControlInfo(dControl) If CompleteControlInfo = 0 Then msg$ = "Error";Chr$(13);Chr$(13); _ "Incomplete Information.";Chr$(10);Chr$(13); _ "Cannot save ";cType$;"." Notice msg$ Else If dControl > nControls Then Call AddControl appInfo(1) = dControl End If For i = 1 to 18 dInfo$(i) = guiInfo$(dControl, i) Next i #main.cNavTxt, "Control ";Right$("00";dControl, 3) Call cNavButtons End If End Sub
Sub cType handle$ nControls = appInfo(1) dControl = appInfo(2) #main.wHandle, "!Contents? wHandle$" #main.cHandle, "!Contents? cHandle$" If cHandle$ = "" Then cHandle$ = wHandle$;".control";Right$("00";dControl, 3) #main.cHandle, cHandle$ End If #main.cType, "Selection? cType$" Call cEnableDisableControls 1 Select Case cType$ Case "Bmpbutton" #main.cTextTxt, "Button";Chr$(10);Chr$(13);"Text" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "Button Font" #main.cFontSelect, "!Disable" #main.cHandleTxt, "Button Handle" #main.cWidth, "!Disable" #main.cWidthTxt, "!Disable" #main.cHeight, "!Disable" #main.cHeightTxt, "!Disable" #main.cPropTxt, "UL Button Properties" #main.cArrayTxt, "Button Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Button";Chr$(10);Chr$(13);"Bitmap" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "Browse" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Button Stylebits" Case "Button" #main.cTextTxt, "Button";Chr$(10);Chr$(13);"Text" #main.cFontSelect, "Button Font" #main.cHandleTxt, "Button Handle" #main.cPropTxt, "UL Button Properties" #main.cArrayTxt, "Button Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Button Bitmap" #main.cBitmapTxt, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Button Stylebits" Case "Checkbox" #main.cTextTxt, "Checkbox";Chr$(10);Chr$(13);"Text" #main.cFontSelect, "Checkbox Font" #main.cHandleTxt, "Checkbox Handle" #main.cPropTxt, "Checkbox Properties" #main.cArrayTxt, "Checkbox Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Checkbox Bitmap/Color" #main.cBitmapTxt, "!Disable" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cStyleTxt, "Checkbox Stylebits" Case "Combobox" #main.cTextTxt, "Combobox";Chr$(10);Chr$(13);"Text" #main.cTextTxt, "!Disable" #main.cFontSelect, "Combobox Font" #main.cHandleTxt, "Combobox Handle" #main.cPropTxt, "Combobox Properties" #main.cArrayTxt, "Combobox Array" #main.cBitmapTxt, "Combobox";Chr$(10);Chr$(13);"Color" #main.cBitmapBrowse, "Select" #main.cBack, "Combobox Color" #main.cBack, "!Locate 150 430 40 24" #main.cBackGraph, "Locate 190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate -300 430 150 24" #main.cBitmapBrowse, "!Locate -305 430 40 24" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Combobox Stylebits" Case "Graphicbox" #main.cTextTxt, "Graphicbox Text" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "Graphicbox Font" #main.cFontSelect, "!Disable" #main.cHandleTxt, "Graphicbox Handle" #main.cPropTxt, "Graphicbox Properties" #main.cArrayTxt, "Graphicbox Array" #main.cArrayTxt, "!Disable" #main.cArray, "" #main.cArray, "!Disable" #main.cBitmapTxt, "Graphicbox Bitmap/Color" #main.cBitmapTxt, "!Disable" #main.cBitmap, "" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cSub1Txt, "!Disable" #main.cSub1, "" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "" #main.cSub2, "!Disable" #main.cStyleTxt, "Graphicbox Stylebits" Case "Groupbox" #main.cTextTxt, "Groupbox Text" #main.cFontSelect, "Groupbox Font" #main.cHandleTxt, "Groupbox Handle" #main.cPropTxt, "Groupbox Properties" #main.cArrayTxt, "Groupbox Array" #main.cArrayTxt, "!Disable" #main.cArray, "" #main.cArray, "!Disable" #main.cBitmapTxt, "Groupbox Bitmap/Color" #main.cBitmapTxt, "!Disable" #main.cBitmap, "" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cSub1Txt, "!Disable" #main.cSub1, "" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "" #main.cSub2, "!Disable" #main.cStyleTxt, "Groupbox Stylebits" Case "Listbox" #main.cTextTxt, "Listbox";Chr$(10);Chr$(13);"Text" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "Listbox Font" #main.cHandleTxt, "Listbox Handle" #main.cPropTxt, "Listbox Properties" #main.cArrayTxt, "Listbox Array" #main.cBitmapTxt, "Listbox";Chr$(10);Chr$(13);"Color" #main.cBitmapBrowse, "Select" #main.cBitmapBrowse, "!Disable" #main.cBack, "Listbox Color" #main.cBack, "!Locate 150 430 40 24" #main.cBackGraph, "Locate 190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate -300 430 150 24" #main.cBitmapBrowse, "!Locate -305 430 40 24" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Listbox Stylebits" Case "Radiobutton" #main.cTextTxt, "Radiobutton";Chr$(10);Chr$(13);"Text" #main.cFontSelect, "Radiobutton Font" #main.cHandleTxt, "Radiobutton Handle" #main.cPropTxt, "Radiobutton Properties" #main.cArrayTxt, "Radiobutton Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Radiobutton Bitmap/Color" #main.cBitmapTxt, "!Disable" #main.cBitmap, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cStyleTxt, "Radiobutton Stylebits" Case "Statictext" #main.cTextTxt, "Statictext";Chr$(10);Chr$(13);"Text" #main.cFontSelect, "Statictext Font" #main.cHandleTxt, "Statictext Handle" #main.cPropTxt, "Statictext Properties" #main.cArrayTxt, "Statictext Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Statictext Bitmap/Color" #main.cBitmapTxt, "!Disable" #main.cBitmapBrowse, "!Disable" #main.cBack, "!Locate -150 430 40 24" #main.cBackGraph, "Locate -190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate 150 430 150 24" #main.cBitmapBrowse, "!Locate 305 430 40 24" #main.cSub1Txt, "!Disable" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Statictext Stylebits" Case "Textbox" #main.cTextTxt, "Textbox";Chr$(10);Chr$(13);"Text" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "Textbox Font" #main.cHandleTxt, "Textbox Handle" #main.cPropTxt, "Textbox Properties" #main.cArrayTxt, "Textbox Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Textbox";Chr$(10);Chr$(13);"Color" #main.cBitmapBrowse, "Select" #main.cBack, "Textbox Color" #main.cBack, "!Locate 150 430 40 24" #main.cBackGraph, "Locate 190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate -300 430 150 24" #main.cBitmapBrowse, "!Locate -305 430 40 24" #main.cSub1Txt, "!Disable" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Textbox Stylebits" Case "Texteditor" #main.cTextTxt, "Texteditor";Chr$(10);Chr$(13);"Text" #main.cTextTxt, "!Disable" #main.cText, "!Disable" #main.cFontSelect, "Texteditor Font" #main.cHandleTxt, "Texteditor Handle" #main.cPropTxt, "Texteditor Properties" #main.cArrayTxt, "Texteditor Array" #main.cArrayTxt, "!Disable" #main.cArray, "!Disable" #main.cBitmapTxt, "Texteditor";Chr$(10);Chr$(13);"Color" #main.cBitmapBrowse, "Select" #main.cBack, "Texteditor Color" #main.cBack, "!Locate 150 430 40 24" #main.cBackGraph, "Locate 190 430 20 24" #main.cBitmapBrowse, "Browse" #main.cBitmap, "!Locate -300 430 150 24" #main.cBitmapBrowse, "!Locate -305 430 40 24" #main.cSub1Txt, "!Disable" #main.cSub1, "!Disable" #main.cSub2Txt, "!Disable" #main.cSub2, "!Disable" #main.cStyleTxt, "Texteditor Stylebits" #main.cStyleTxt, "!Disable" #main.cStyle1, "Disable" #main.cStyle1Txt, "!Disable" #main.cStyle2, "Disable" #main.cStyle2Txt, "!Disable" #main.cStyle3, "Disable" #main.cStyle3Txt, "!Disable" #main.cStyle4, "Disable" #main.cStyle4Txt, "!Disable" #main.cStyle, "!Disable" End Select Call cLoadStyles cType$ #main.cStyle1, "Reload" #main.cStyle2, "Reload" #main.cStyle3, "Reload" #main.cStyle4, "Reload" If nControls > 2 Then #main.cFirst, "!Enable" #main.cPrev, "!Enable" #main.cNext, "!Enable" #main.cLast, "!Enable" End If If dControl < 2 Then #main.cFirst, "!Disable" #main.cPrev, "!Disable" End If If dControl >= nControls Then #main.cNext, "!Disable" #main.cLast, "!Disable" End If #main, "Refresh" End Sub
Sub cBitmapBrowse handle$ dControl = appInfo(2) #main.cType, "Selection? cType$" If cType$ = "Bmpbutton" Then FileDialog, "Select Bitmap", "*.bmp", fBitmap$ If fBitmap$ = "" Then Exit Sub End If nBitmap$ = FileName$(fBitmap$) guiInfo$(dControl, 15) = nBitmap$;"!";fBitmap$ #main.cBitmap, guiInfo$(dControl, 15) Else hue$ = "Buttonface Yellow Brown Red Darkred Pink Darkpink "; _ "Blue Darkblue Green Darkgreen Cyan DarkCyan White "; _ "Black Lightgray Darkgray" msg$ = cType$;"Color$" Prompt msg$;tempColor$ cColor$ = tempColor$ Select Case Upper$(cColor$) Case "LIGHTGREY", "PALEGREY" cColor$ = "Lightgray" Case "DARKGREY" cColor$ = "Darkgray" End Select nColor = 0 For i = 1 to 17 If Upper$(cColor$) = Upper$(Word$(hue$, i)) Then nColor = i End If Next i If nColor = 0 Then #main.cBitmap, "" Else #main.cBitmap, tempColor$ End If End If End Sub
Sub DisplayControl dControl nControls = appInfo(1) dControl = appInfo(2) If dControl > nControls Then #main.cNavTxt, "Control *" Else #main.cNavTxt, "Control ";Right$("00";dControl, 3) End If #main.cText, guiInfo$(dControl, 1) #main.cHandle, guiInfo$(dControl, 2) #main.cWidth, guiInfo$(dControl, 3) #main.cHeight, guiInfo$(dControl, 4) #main.cUlx, guiInfo$(dControl, 5) #main.cUly, guiInfo$(dControl, 6) cStyle1$ = guiInfo$(dControl, 7) cStyle2$ = guiInfo$(dControl, 8) cStyle3$ = guiInfo$(dControl, 9) cStyle4$ = guiInfo$(dControl, 10) style$ = cStyle1$;", ";cStyle2$;", ";cStyle3$;", ";cStyle4$ #main.cStyle, style$ If guiInfo$(dControl, 11) <> "" Then #main.cType, "Select ";guiInfo$(dControl, 11) Else #main.cType, "Select 0" End If #main.cType, "Select ";guiInfo$(dControl, 11) #main.cArray, guiInfo$(dControl, 12) #main.cSub1, guiInfo$(dControl, 13) #main.cSub2, guiInfo$(dControl, 14) #main.cBitmap, guiInfo$(dControl, 15) If guiInfo$(dControl, 17) <> "" Then bClr$ = guiInfo$(dControl, 17) #main.cBackGraph, "Cls; Fill ";bClr$ #main.cBackGraph, "Flush" Else #main.cBackGraph, "Cls; Fill White; Flush" End If Call cLoadStyles guiInfo$(dControl, 11) #main.cStyle1, "Reload" #main.cStyle2, "Reload" #main.cStyle3, "Reload" #main.cStyle4, "Reload" Call cType "#main.cType" End Sub
Function FileName$(PathFile$) If Instr(PathFile$, "\") = 0 Then FileName$ = PathFile$ Exit Function End If For i = Len(PathFile$) to 2 Step -1 If Mid$(PathFile$, i, 1) = "\" Then pos = i Exit For End If Next i FileName$ = Mid$(PathFile$, pos + 1) End Function
Function PathName$(PathFile$) If Instr(PathFile$, "\") = 0 Then PathName$ = DefaultDir$ If Right$(PathName$, 1) <> "\" Then PathName$ = PathName$;"\" End If Exit Function End If lPathFile = Len(PathFile$) FileName$ = FileName$(PathFile$) lFile = Len(FileName$) lPath = lPathFile - lFile PathName$ = Left$(PathFile$, lPath) End Function
Function FileExists(PathFile$) FileName$ = FileName$(PathFile$) PathName$ = PathName$(PathFile$) Files PathName$, FileName$, FileInfo$() FileExists = Val(FileInfo$(0, 0)) End Function
Function AddStyle$(style$, insertStyle$) If Instr(style$, insertStyle$) > 0 Then AddStyle$ = style$ Exit Function End If If style$ = "0" Then AddStyle$ = insertStyle$ Exit Function End If AddStyle$ = style$;" or ";insertStyle$ End Function
Function RemoveStyle$(style$, extractStyle$) If Instr(style$, extractStyle$) = 0 Then RemoveStyle$ = style$ Exit Function End If If style$ = extractStyle$ Then RemoveStyle$ = "0" Exit Function End If tempStyle$ = "" ct = 1 nStyles = 0 While Word$(style$, ct) <> "" If Left$(Word$(style$, ct), 1) = "_" Then If Word$(style$, ct) <> extractStyle$ Then tempStyle$ = tempStyle$;" ";Word$(style$, ct) nStyles = nStyles + 1 End If End If ct = ct + 1 Wend RemoveStyle$ = Word$(tempStyle$, 1) If Word$(tempStyle$, 2) = "" Then Exit Function End If For i = 2 to nStyles RemoveStyle$ = RemoveStyle$;" or ";Word$(tempStyle$, i) Next i End Function
Function CompleteControlInfo(dControl) CompleteControlInfo = 1 Call cGUIInfo dControl cType$ = guiInfo$(dControl, 11) If cType$ = "" Then CompleteControlInfo = 0 Exit Function End If Select Case cType$ Case "Bmpbutton" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 3) = Chr$(0) guiInfo$(dControl, 4) = Chr$(0) guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) Case "Button" If guiInfo$(dControl, 1) = "" Then guiInfo$(dControl, 1) = Chr$(0) End If If guiInfo$(dControl, 3) = "" Then guiInfo$(dControl, 3) = Chr$(0) guiInfo$(dControl, 4) = Chr$(0) End If guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Checkbox" If guiInfo$(dControl, 1) = "" Then guiInfo$(dControl, 1) = Chr$(0) End If guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Combobox" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Graphicbox" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 13) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Groupbox" If guiInfo$(dControl, 1) = "" Then guiInfo$(dControl, 1) = Chr$(0) End If guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 13) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Listbox" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Radiobutton" If guiInfo$(dControl, 1) = "" Then guiInfo$(dControl, 1) = Chr$(0) End If guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Statictext" If guiInfo$(dControl, 1) = "" Then guiInfo$(dControl, 1) = Chr$(0) End If guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 13) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Textbox" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 13) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) Case "Texteditor" guiInfo$(dControl, 1) = Chr$(0) guiInfo$(dControl, 12) = Chr$(0) guiInfo$(dControl, 13) = Chr$(0) guiInfo$(dControl, 14) = Chr$(0) guiInfo$(dControl, 15) = Chr$(0) End Select For i = 1 to 15 If guiInfo$(dControl, i) = "" Then CompleteControlInfo = 0 End If If guiInfo$(dControl, i) = Chr$(0) Then guiInfo$(dControl, i) = "" End If Next i End Function
Function ControlModified(dControl) ControlModified = 0 Call cGUIInfo dControl For i = 1 to 18 If dInfo$(i) <> guiInfo$(dControl, i) Then ControlModified = 1 End If Next i End Function
Function BitmapCoord$(fBitmap$) If Mid$(fBitmap$, 2, 1) <> ":" Then fBitmap$ = DefaultDir$;"\";fBitmap$ End If For i = Len(fBitmap$) to 1 Step -1 If Mid$(fBitmap$, i, 1) = "/" Then pos = i Exit For End If Next i fName$ = Mid$(fBitmap$, pos + 1) fPath$ = Left$(fBitmap$, pos) Files fPath$, fName$, FileInfo$() FileExists = Val(FileInfo$(0, 0)) If FileExists = 0 Then BitmapCoord$ = "X-X" Exit Function End If Open fBitmap$ for Input as #bmp BitmapInfo$ = Input$(#bmp, 29) Close #bmp If Left$(BitmapInfo$, 2) <> "BM" Then BitmapCoord$ = "X-X" Exit Function End If bWidth = Asc(Mid$(BitmapInfo$, 19, 1)) + (Asc(Mid$(BitmapInfo$, 20, 1)) * 256) bHeight = Asc(Mid$(BitmapInfo$, 23, 1)) + (Asc(Mid$(BitmapInfo$, 24, 1)) * 256) BitmapCoord$ = Str$(bWidth);"-";Str$(bHeight) End Function
|
|