Having probs with SetGadgetText
after GetStartupInfo_(si.STARTUPINFO) .
What am I doing wrong ? Thanks
Code: Select all
; Purebasic - 5.73 https://www.purebasic.fr/english/index.php
Global Window_0
Global ListAvailableFilesBtn , SaveListBtn , CopyFilesBtn , FilesListView , FilesAvailableLV , FilesToCopyLV , ExitBtn , StatusArea
Global ReadThisFile$ , WriteTheseFile$ = "CopyTheseFiles.txt" , OneEditLine$ , FilesCopied = 0 , StatusArea$
Global CurrentDIR$ = GetCurrentDirectory() , EditorAreaItemsCOUNT = 0 , CopyToCount = 0
Global FoundCopyTo = 0 , CopyToFolder$ , CopyFromFolder$ , CopyTo$ , CopyFrom$ , CopyToArea , CopyFromArea
Global FolderAddresses$ = "FolderAddresses.txt" , BrowseBtn1 , BrowseBtn1_Clicked = #False , BrowseBtn2 , BrowseBtn2_Clicked = #False
Global CurrentDirElement$ , WhichAvailableItemClicked = 0 , CopyThisLVItem$
Global CurrentPath1$ = "" , CurrentPath2$ = "" , CheckBox1 , CheckBox2 , CreateThisFile$
Global Result = 0 , Result1 = 0 , Result2 = 0 , Result3 = 0 , WhileFilesToCopy = 0 , NextLineToCopy = 0
Global FromLength = 0 , ToLength = 0 , FromAreaPath$ = "" , ToAreaPath$ = ""
Global FromPosition = 0 , ToPosition = 0 , ShortcutFromArea$ , ShortcutToArea$
Declare browseBtn1_clicked()
Declare browseBtn2_clicked()
Declare ShortcutCheck()
Declare OpenWindow_0(x = 0, y = 0, width = 600, height = 800)
;Declare
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 800)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "CopyFilesTo 2.0", #PB_Window_SystemMenu)
SetWindowColor(Window_0, RGB(128,128,128))
CopyFromArea = EditorGadget(#PB_Any, 62, 10, 425, 23 )
SetGadgetItemText(CopyFromArea, 0, "" ) ; ShortcutFromArea$
CopyFromLabel = TextGadget(#PB_Any, 20, 10, 38, 23, " FROM")
CopyToArea = EditorGadget(#PB_Any, 62, 40, 425, 23 )
SetGadgetItemText(CopyToArea, 0, "" )
CopyToLabel = TextGadget(#PB_Any, 20, 40, 38, 23 , " TO")
BrowseBtn1 = ButtonGadget(#PB_Any, 508, 10, 65, 23, "Or Browse")
GadgetToolTip(BrowseBtn1 , "Browse for FROM Folder")
BrowseBtn2 = ButtonGadget(#PB_Any, 508, 40, 65, 23, "Or Browse")
GadgetToolTip(BrowseBtn2 , ShortcutFromArea$)
MessageRequester("Procedure OpenWindow()", ShortcutFromArea$)
SetGadgetText(CopyFromArea, ShortcutFromArea$ ) ; ShortcutFromArea$
MessageRequester("(GetGadgetText(CopyFromAre))", GetGadgetText(CopyFromAre) )
SetGadgetItemText(CopyFromArea, 0 , ShortcutFromArea$ ) ; ShortcutFromArea$
MessageRequester("(GetGadgetItemText(CopyFromAre))", GetGadgetItemText(CopyFromAre , 0))
EndProcedure ; Procedure OpenWindow_
;
Procedure browseBtn1_clicked()
EndProcedure ; browseBtn_clicked()
;
Procedure browseBtn2_clicked()
EndProcedure ; browseBtn2_clicked()
;
;
Procedure ShortcutCheck()
#STARTF_TITLESHORTCUT = $800
GetStartupInfo_(si.STARTUPINFO)
If si\dwFlags & #STARTF_TITLESHORTCUT = #STARTF_TITLESHORTCUT
ShortcutFromArea$ = (PeekS(si\lpTitle))
; MessageRequester("Procedure ShortcutCheck()", ShortcutFromArea$)
EndIf
EndProcedure ; ShortcutCheck()
ShortcutCheck()
OpenWindow_0()
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case ExitBtn
Quit = 1
Case BrowseBtn1
browseBtn1_clicked()
Case BrowseBtn2
browseBtn2_clicked()
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
If Quit = 1
End
EndIf
Until Quit = 1