PDA

View Full Version : Worm help please.. xD purebasic problem


Imagine Programming
05-08-2008, 03:01 PM
ProcedureDLL Settings(CurPath.s)
#SHACF_AUTOSUGGEST_FORCE_ON = $10000000
#SHACF_AUTOSUGGEST_FORCE_OFF = $20000000

#SHACF_AUTOAPPEND_FORCE_ON = $40000000
#SHACF_AUTOAPPEND_FORCE_OFF = $80000000





#SHACF_FILESYSTEM = 1

#SHACF_URLALL = 2|4
#SHACF_URLHISTORY = 2
#SHACF_URLMRU = 4

#SHACF_DEFAULT=0

;- Window Constants
;
Enumeration
#Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
#String_0
#Text_0
#Button_0
#CheckBox_0
#Radio_0
#Radio_1
#Frame3D_0
EndEnumeration

If OpenWindow(#Window_0, 216, 0, 320, 231, "Settings.", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateGadgetList(WindowID(#Window_0))
StringGadget(#String_0, 20, 90, 180, 20, CurPath.s)
TextGadget(#Text_0, 20, 10, 260, 30, "Please set the settings as you prefer. Don't forget to click the 'Save' button to save the changes.")
ButtonGadget(#Button_0, 210, 90, 80, 20, "Browse")
CheckBoxGadget(#CheckBox_0, 20, 70, 230, 20, "Automaticly save to path.")
OptionGadget(#Radio_0, 20, 130, 190, 20, "Colored Text (RGB)")
OptionGadget(#Radio_1, 20, 150, 190, 20, "Black Text (Grayscale)")
Frame3DGadget(#Frame3D_0, 10, 50, 290, 130, "Settings")

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf


ProcedureReturn (#String_0, #CheckBox_0, #Radio_0, #Radio_1)
EndProcedure

i can't get it working:huh *rather new with pb

I don't know how to add actions to the controlls, and i don't know how to get them to return them

help?

mz241508
05-09-2008, 11:46 AM
why not ask for help at PureBASICs forums?

http://www.purebasic.fr/english/

Imagine Programming
05-09-2008, 12:02 PM
Because it must become a AMS dll xD but i can't get it to work...

Worm
05-09-2008, 12:53 PM
busy right now, but will help this weekend.

mz241508
05-09-2008, 12:56 PM
ProcedureDLL.s Settings(CurPath.s)
#SHACF_AUTOSUGGEST_FORCE_ON = $10000000
#SHACF_AUTOSUGGEST_FORCE_OFF = $20000000

#SHACF_AUTOAPPEND_FORCE_ON = $40000000
#SHACF_AUTOAPPEND_FORCE_OFF = $80000000

#SHACF_FILESYSTEM = 1

#SHACF_URLALL = 2|4
#SHACF_URLHISTORY = 2
#SHACF_URLMRU = 4

#SHACF_DEFAULT=0

;- Window Constants
Enumeration
#Window_0
EndEnumeration

;- Gadget Constants
Enumeration
#String_0
#Text_0
#Button_0
#CheckBox_0
#Radio_0
#Radio_1
#Frame3D_0
EndEnumeration

If OpenWindow(#Window_0, 216, 0, 320, 231, "Settings.", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateGadgetList(WindowID(#Window_0))
StringGadget(#String_0, 20, 90, 180, 20, CurPath.s)
TextGadget(#Text_0, 20, 10, 260, 30, "Please set the settings as you prefer. Don't forget to click the 'Save' button to save the changes.")
ButtonGadget(#Button_0, 210, 90, 80, 20, "Browse")
CheckBoxGadget(#CheckBox_0, 20, 70, 230, 20, "Automaticly save to path.")
OptionGadget(#Radio_0, 20, 130, 190, 20, "Colored Text (RGB)")
OptionGadget(#Radio_1, 20, 150, 190, 20, "Black Text (Grayscale)")
Frame3DGadget(#Frame3D_0, 10, 50, 290, 130, "Settings")

Repeat
Event = WaitWindowEvent()
Gadget = EventGadget()
If Event = #PB_Event_Gadget
If Gadget = #Button_0
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
EndIf

rString1.s = GetGadgetText(#String_0)
rString2.s = Str(GetGadgetState(#CheckBox_0))
rString3.s = Str(GetGadgetState(#Radio_0))
rString4.s = Str(GetGadgetState(#Radio_1))
;Might want to add a separator for each string value
rString.s = rString1 + rString2 + rString3 + rString4
ProcedureReturn rString
EndProcedure

Imagine Programming
05-09-2008, 01:55 PM
thanks :) but will this be returned as AMS table?, And why isn't it waiting untill the Save button is pressed? cos when i build/run it in PureBasic it does run it, but i can't see it cos its finished on instant :P

anyway, thanks for getting the bugs out:)