Main:
Code: Alles auswählen
;-TOP
;- Visual Generate Main Program for Purebasic
; ***************************************************************************************
;
; Comment :
; Author :
; Second Author :
; File :
; Version :
; Create :
; Update :
;
; Compilermode :
;
; ***************************************************************************************
;- Global Variable
Global ExitApplication = 0
; ***************************************************************************************
;- Include CommonFile
IncludeFile "CommonFile.pb"
;- Include UserFiles
;IncludeFile "???.pb"
;- Include EventFiles
IncludeFile "EventMenu.pb"
IncludeFile "EventGadget.pb"
IncludeFile "EventWindow.pb"
IncludeFile "EventMain.pb"
; ***************************************************************************************
;- Main Program
Procedure Main()
Open_Window_0()
If WindowID(#Window_0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
MyEventMenu(EventMenu())
Case #PB_Event_Gadget
MyEventGadget(EventGadget(), EventType())
Case #PB_Event_SizeWindow
MyEventSize(EventWindow())
Case #PB_Event_CloseWindow
MyEventExit(EventWindow())
Case #PB_Event_Repaint
;
Case #PB_Event_MoveWindow
;
Case #PB_Event_ActivateWindow
;
Case #PB_Event_SysTray
;
EndSelect
Until ExitApplication = 1
EndIf
EndProcedure:Main()
End
; ***************************************************************************************
Code: Alles auswählen
; Visual Generate Commonfile (Do Not Edit - Allways Overwrite)
; ***************************************************************************************
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Menubar Constants
;
Enumeration
EndEnumeration
;- MenuItem Constants
;
Enumeration
EndEnumeration
;- Gadget Constants
;
Enumeration
#Window_0_Text_0
#Window_0_button_Info
#Window_0_Checkbox_0_perseinstell
#Window_0_Checkbox_numlock
#Window_0_Frame3D_3
#Window_0_Option_kein_netz
#Window_0_Option_LAN
#Window_0_Option_WLAN_wpa
#Window_0_Option_WLAN_wpa2
#Window_0_String_passwort
#Window_0_String_routername
#Window_0_Checkbox_firewall
#Window_0_Checkbox_cpufrequ
#Window_0_Checkbox_drucker
#Window_0_Checkbox_videoeinst
#Window_0_Checkbox_xserver
#Window_0_Button_save_konfig
#Window_0_Button_save_startoption
#Window_0_Button_fertig
#Window_0_Editor_1
#Window_0_Container_0
EndEnumeration
;- StatusBar Constants
;
Enumeration
EndEnumeration
;- ToolBar Constants
;
Enumeration
EndEnumeration
;- Image Constants
;
Enumeration
EndEnumeration
Enumeration #PB_Compiler_EnumerationValue
#Font_0
#Font_1
#Font_2
#Font_3
EndEnumeration
LoadFont(#Font_0,"Sans", 24, #PB_Font_Bold | #PB_Font_Italic)
LoadFont(#Font_1,"Sans", 24)
LoadFont(#Font_2,"Sans", 13)
LoadFont(#Font_3,"Sans", 14)
; ***************************************************************************************
;- Image Plugin
;- Load Images
; ***************************************************************************************
; Form Designer for Purebasic - 5.11
; ***************************************************************************************
Procedure Open_Window_0()
OpenWindow(#Window_0, #PB_Ignore, #PB_Ignore, 530, 530, "ConfigMaster 1.0", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(#Window_0_Text_0, 20, 10, 380, 40, "ConfigMaster", #PB_Text_Center)
SetGadgetColor(#Window_0_Text_0, #PB_Gadget_FrontColor,RGB(0,5,255))
SetGadgetColor(#Window_0_Text_0, #PB_Gadget_BackColor,RGB(255,243,0))
SetGadgetFont(#Window_0_Text_0, FontID(#Font_0))
ButtonGadget(#Window_0_button_Info, 410, 10, 100, 40, "INFO")
GadgetToolTip(#Window_0_button_Info, "Das ist eine mehrzeilige Info")
SetGadgetFont(#Window_0_button_Info, FontID(#Font_1))
CheckBoxGadget(#Window_0_Checkbox_0_perseinstell, 46, 60, 424, 25, "Dialog fuer persoenliche Einstellungen anzeigen")
SetGadgetFont(#Window_0_Checkbox_0_perseinstell, FontID(#Font_2))
CheckBoxGadget(#Window_0_Checkbox_numlock, 46, 90, 424, 25, "Numlock einschalten")
SetGadgetFont(#Window_0_Checkbox_numlock, FontID(#Font_2))
Frame3DGadget(#Window_0_Frame3D_3, 26, 130, 484, 200, "Netzwerkeinstellung")
SetGadgetFont(#Window_0_Frame3D_3, FontID(#Font_3))
OptionGadget(#Window_0_Option_kein_netz, 51, 160, 419, 25, "Kein Netzwerk fuer Internet vorhanden")
SetGadgetFont(#Window_0_Option_kein_netz, FontID(#Font_2))
OptionGadget(#Window_0_Option_LAN, 51, 190, 439, 25, "Netzwerk ueber Kabel automatisch aufbauen")
SetGadgetFont(#Window_0_Option_LAN, FontID(#Font_2))
OptionGadget(#Window_0_Option_WLAN_wpa, 51, 230, 449, 25, "WLAN-Verbindung mit WPA-Verschluesselung aufbauen")
SetGadgetFont(#Window_0_Option_WLAN_wpa, FontID(#Font_2))
OptionGadget(#Window_0_Option_WLAN_wpa2, 51, 260, 449, 25, "WLAN-Verbindung mit WPA2-Verschluesselung aufbauen")
SetGadgetFont(#Window_0_Option_WLAN_wpa2, FontID(#Font_2))
StringGadget(#Window_0_String_passwort, 350, 290, 126, 25, "Passwort")
SetGadgetFont(#Window_0_String_passwort, FontID(#Font_3))
StringGadget(#Window_0_String_routername, 80, 290, 120, 25, "Routername")
SetGadgetFont(#Window_0_String_routername, FontID(#Font_3))
CheckBoxGadget(#Window_0_Checkbox_firewall, 40, 340, 250, 20, "Firewall aktivieren")
SetGadgetFont(#Window_0_Checkbox_firewall, FontID(#Font_2))
CheckBoxGadget(#Window_0_Checkbox_cpufrequ, 40, 370, 330, 20, "CPU-Frequenzskalierung aktivieren")
SetGadgetFont(#Window_0_Checkbox_cpufrequ, FontID(#Font_2))
CheckBoxGadget(#Window_0_Checkbox_drucker, 40, 400, 330, 20, "Druckereinstellungen aktivieren")
SetGadgetFont(#Window_0_Checkbox_drucker, FontID(#Font_2))
CheckBoxGadget(#Window_0_Checkbox_videoeinst, 40, 430, 370, 20, "Eigene Videoeinstellungen aktivieren")
SetGadgetFont(#Window_0_Checkbox_videoeinst, FontID(#Font_2))
CheckBoxGadget(#Window_0_Checkbox_xserver, 40, 460, 270, 20, "X-Server neu starten")
SetGadgetFont(#Window_0_Checkbox_xserver, FontID(#Font_2))
ButtonGadget(#Window_0_Button_save_konfig, 20, 490, 180, 30, "Konfiguration sichern")
SetGadgetFont(#Window_0_Button_save_konfig, FontID(#Font_2))
ButtonGadget(#Window_0_Button_save_startoption, 210, 491, 190, 29, "Startoptionen sichern")
SetGadgetFont(#Window_0_Button_save_startoption, FontID(#Font_2))
ButtonGadget(#Window_0_Button_fertig, 410, 490, 100, 30, "Fertig")
SetGadgetFont(#Window_0_Button_fertig, FontID(#Font_2))
EditorGadget(#Window_0_Editor_1, 50, 126, 440, 254, #PB_Editor_ReadOnly)
HideGadget(#Window_0_Editor_1, 1)
SetGadgetColor(#Window_0_Editor_1, #PB_Gadget_FrontColor,RGB(252,255,0))
SetGadgetColor(#Window_0_Editor_1, #PB_Gadget_BackColor,RGB(4,0,255))
SetGadgetFont(#Window_0_Editor_1, FontID(#Font_3))
AddGadgetItem(#Window_0_Editor_1, -1, "hallo jetzt geht es", 0, 1)
AddGadgetItem(#Window_0_Editor_1, -1, "Information zur zweiten Zeile", 0, 2)
AddGadgetItem(#Window_0_Editor_1, -1, "nr3", 0, 3)
ContainerGadget(#Window_0_Container_0, 240, 101, 250, 249, #PB_Container_Raised)
HideGadget(#Window_0_Container_0, 1)
SetGadgetColor(#Window_0_Container_0, #PB_Gadget_BackColor,RGB(255,255,0))
CloseGadgetList()
EndProcedure
; ***************************************************************************************
Code: Alles auswählen
;-TOP
; Visual Generate Event Menu
; ***************************************************************************************
Code: Alles auswählen
;-TOP
; Visual Generate Event Gadget
; ***************************************************************************************
Procedure EventGadget_Window_0_button_Info(EventType)
Select EventType
Case #PB_EventType_LeftClick
HideGadget(#Window_0_Container_0,0)
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_0_perseinstell(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_numlock(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Option_kein_netz(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Option_LAN(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Option_WLAN_wpa(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Option_WLAN_wpa2(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_String_passwort(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_String_routername(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_firewall(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_cpufrequ(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_drucker(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_videoeinst(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Checkbox_xserver(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Button_save_konfig(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Button_save_startoption(EventType)
Select EventType
Case #PB_EventType_LeftClick
Debug GetGadgetState(#Window_0_Editor_1)
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Button_fertig(EventType)
Select EventType
Case #PB_EventType_LeftClick
End
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Editor_1(EventType)
Select EventType
Case #PB_EventType_LeftClick
Debug "info"
EndSelect
EndProcedure
; ***************************************************************************************
Procedure EventGadget_Window_0_Container_0(EventType)
Select EventType
Case #PB_EventType_LeftClick
EndSelect
EndProcedure
; ***************************************************************************************
Code: Alles auswählen
;-TOP
; Visual Generate Event Window
; ***************************************************************************************
Procedure EventSize_Window_0()
EndProcedure
; ***************************************************************************************
Procedure EventExit_Window_0()
ExitApplication = 1
EndProcedure
; ***************************************************************************************
Code: Alles auswählen
;-TOP
; Visual Generate EventMain (Do Not Edit - Allways Overwrite)
; *********************************************************************************************************
; Init Event Pointer
Prototype MyProtoInvoke()
Prototype MyProtoInvoke1(EventType)
Structure udtCallEvent
Invoke.MyProtoInvoke[0]
EndStructure
Structure udtCallEvent1
Invoke.MyProtoInvoke1[0]
EndStructure
Global *CallEventMenu.udtCallEvent = ?CallEventMenu
Global *CallEventGadget.udtCallEvent1 = ?CallEventGadget
Global *CallEventSize.udtCallEvent = ?CallEventSize
Global *CallEventExit.udtCallEvent = ?CallEventExit
#CallEventMenuCount = 0
#CallEventGadgetCount = 21
#CallEventWindowCount = 1
; *********************************************************************************************************
Procedure MyEventMenu(MenuID)
If MenuID >= 0 And MenuID < #CallEventMenuCount
*CallEventMenu\Invoke[MenuID]()
EndIf
EndProcedure
; *********************************************************************************************************
Procedure MyEventGadget(GadgetID, EventType)
If GadgetID >= 0 And GadgetID < #CallEventGadgetCount
*CallEventGadget\Invoke[GadgetID](EventType)
EndIf
EndProcedure
; *********************************************************************************************************
Procedure MyEventSize(WindowID)
If WindowID >= 0 And WindowID < #CallEventWindowCount
*CallEventSize\Invoke[WindowID]()
EndIf
EndProcedure
; *********************************************************************************************************
Procedure MyEventExit(WindowID)
If WindowID >= 0 And WindowID < #CallEventWindowCount
*CallEventExit\Invoke[WindowID]()
EndIf
EndProcedure
; *********************************************************************************************************
Procedure MyEventDispatch(EventType)
EndProcedure
; *********************************************************************************************************
DataSection
CallEventMenu:
CallEventGadget:
Data.i @MyEventDispatch()
Data.i @EventGadget_Window_0_button_Info()
Data.i @EventGadget_Window_0_Checkbox_0_perseinstell()
Data.i @EventGadget_Window_0_Checkbox_numlock()
Data.i @MyEventDispatch()
Data.i @EventGadget_Window_0_Option_kein_netz()
Data.i @EventGadget_Window_0_Option_LAN()
Data.i @EventGadget_Window_0_Option_WLAN_wpa()
Data.i @EventGadget_Window_0_Option_WLAN_wpa2()
Data.i @EventGadget_Window_0_String_passwort()
Data.i @EventGadget_Window_0_String_routername()
Data.i @EventGadget_Window_0_Checkbox_firewall()
Data.i @EventGadget_Window_0_Checkbox_cpufrequ()
Data.i @EventGadget_Window_0_Checkbox_drucker()
Data.i @EventGadget_Window_0_Checkbox_videoeinst()
Data.i @EventGadget_Window_0_Checkbox_xserver()
Data.i @EventGadget_Window_0_Button_save_konfig()
Data.i @EventGadget_Window_0_Button_save_startoption()
Data.i @EventGadget_Window_0_Button_fertig()
Data.i @EventGadget_Window_0_Editor_1()
Data.i @EventGadget_Window_0_Container_0()
CallEventSize:
Data.i @EventSize_Window_0()
CallEventExit:
Data.i @EventExit_Window_0()
EndDataSection
; *********************************************************************************************************