Mischa wrote:
Small update:
@Chen
ContainerGadget gadgets working fine here.
Do you have small example source for me?
I tested the new download and I have several problems...
I have a panel with 6 tabs, when you are in the first tab and you select with
the mouse you are selecting objects in other tabs!
Another curious thing: if you have a multiline textGadget it doesnt appear...
I dont know how to explain this stuff... is better you test this code...
It is a part of my real app with several problem you can detect immediately..
BTW I left the whole enumeration... sorry...
Code:
; gPreferences[460-5-1-1-0-0-0-244-63]
;/ GuiSR.pb: GUI Search and Replace tool
;/ Kaizensoft - Chen Zarza
;/ December 2005
; --------------------------------------------------------------------------------------
Enumeration
; - 1.- Window Constants
#window1
; - 3.- Gadget Constants
#Panel_0: #Frame3D_0: #bu_saveData: #bu_importData: #Frame3D_4
#op_search: #op_replace: #op_replaceBetween: #op_replaceFromTo: #op_delete
#op_deleteBetween: #op_deleteFromTo: #op_insertBefore: #op_insertAfter: #ch_caseSensitive
#bu_start: #bu_cancel: #bu_newProcess: #bu_close: #cb_filter: #Text_3
#ch_includeSubfolders: #Frame3D_1: #Text_4: #Text_5: #Text_6
#Text_51: #Text_61: #Frame3D_2
#st_directory: #st_backUp: #ed_search: #ed_replace: #tx_actionNane
#tx_completeAction: #bu_clearReplace: #op_selectAll: #op_deselectAll: #li_filesToCheck
#st_filesInList: #st_filesToProcess: #tx_filesInList: #tx_filesToProcess: #bu_directory
#bu_backUp: #Text_14: #Text_15: #st_fileInEdition: #ed_file
#li_result: #Text_18: #Text_19: #Text_20: #Text_21
#Text_22: #Text_23: #Text_24: #Text_25: #Text_26
#Text_27: #st_fileEdited: #st_directoryInProcess: #st_filesMarked: #st_directoryBackUp
#st_filesBackedUp: #st_kindOfOperation: #st_filesStartingProcess: #st_filesProcessed: #st_filesNotProcessed
#Text_28: #Text_31: #Text_30: #Text_32: #Text_33
#ed_from: #ed_to: #Text_35: #find_SearchString: #find_Next
#find_Find: #find_Close: #find_Text_37: #bu_clearFrom: #bu_clearSearch
#bu_clearTo: #hlink_kaizen: #Text_39: #bu_clearResult: #bu_backUpRecovery
#wb_browser: #bi_back: #bi_forward: #bi_stop: #bi_reload
#im_back: #im_forward: #im_stop: #im_reload
#cb_UrlFile: #bu_Go: #bu_browseFile: #bu_clearStatistics
#bu_RecoverSelectedBackup: #bu_DeleteFileInBackup: #bu_DeleteAllBackUpFiles
#co_statistics: #co_result: #co_browser: #co_source: #co_choosefiles: #co_strings
EndEnumeration
Procedure.s Cr(num.l) ; useful to ask several #CRLF$ -> example cr(4)
creturns.s
For i=1 To num
creturns = creturns + #CRLF$
Next
ProcedureReturn creturns
EndProcedure
; 1.- Window Creation
Procedure Open_window1()
If OpenWindow(#window1, 320, 23, 700, 673, "KaizenSoft-S&R", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
; 3.- Gadgets Creation
If CreateGadgetList(WindowID(#window1))
SetGadgetFont(#Text_4, FontID1)
HyperLinkGadget(#hlink_kaizen, 15, 50, 135, 20, "http://www.kaizensoft.com", RGB(0,51,204))
GadgetToolTip(#hlink_kaizen, "Click on Link to KaizenSoft Site")
TextGadget(#Text_39, 15, 25, 135, 25, "KaizenSoft")
SetGadgetColor(#Text_39, #PB_Gadget_FrontColor, RGB(14,44,132))
SetGadgetFont(#Text_39, FontID3)
Frame3DGadget(#Frame3D_1, 15, 70, 130, 100, "Folder Criteria")
Frame3DGadget(#Frame3D_2, 15, 170, 130, 50, "")
TextGadget(#Text_3, 25, 85, 80, 15, "File Type:")
ComboBoxGadget(#cb_filter, 25, 105, 110, 100, #PB_ComboBox_Editable)
GadgetToolTip(#cb_filter, "Formats: *String or String* or *String*")
CheckBoxGadget(#ch_includeSubfolders, 25, 135, 105, 20, "Include Subfolders")
TextGadget(#Text_4, 20, 180, 102, 20, "Options For Actions")
CheckBoxGadget(#ch_caseSensitive, 20, 195, 106, 20, "Case Sensitive")
Frame3DGadget(#Frame3D_4, 15, 220, 130, 205, "Actions")
OptionGadget(#op_search, 25, 238, 100, 15, "Search")
OptionGadget(#op_replace, 25, 257, 100, 15, "Replace")
OptionGadget(#op_replaceBetween, 25, 276, 115, 15, "Replace Between")
OptionGadget(#op_replaceFromTo, 25, 296, 110, 15, "Replace From->To")
OptionGadget(#op_delete, 25, 316, 100, 15, "Delete")
OptionGadget(#op_deleteBetween, 25, 336, 100, 15, "Delete Between")
OptionGadget(#op_deleteFromTo, 25, 357, 100, 15, "Delete From->To")
OptionGadget(#op_insertBefore, 25, 377, 100, 15, "Insert Before")
OptionGadget(#op_insertAfter, 25, 395, 100, 20, "Insert After")
ButtonGadget(#bu_start, 155, 570, 90, 30, "Start Process")
ButtonGadget(#bu_cancel, 245, 570, 90, 30, "Cancel Process")
ButtonGadget(#bu_newProcess, 335, 570, 90, 30, "New Process")
ButtonGadget(#bu_close, 600, 570, 90, 30, "Close Application")
; - Panel0
; Tab Strings
PanelGadget(#Panel_0, 156, 30, 535, 535)
AddGadgetItem(#Panel_0, -1, "Strings")
ContainerGadget(#co_strings, 0, 0, 529, 509)
SetGadgetColor(#co_strings, #PB_Gadget_BackColor , RGB(219,215,181))
TextGadget(#Text_5, 17, 16, 50, 30, "Process Directory:")
SetGadgetColor(#Text_5, #PB_Gadget_BackColor , RGB(219,215,181))
TextGadget(#Text_6, 17, 48, 50, 30, "BackUp Directory:")
SetGadgetColor(#Text_6, #PB_Gadget_BackColor , RGB(219,215,181))
StringGadget(#st_directory, 73, 18, 380, 25, "")
SetGadgetColor(#st_directory, #PB_Gadget_BackColor, RGB(236,233,216))
StringGadget(#st_backUp, 73, 48, 380, 25, "")
SetGadgetColor(#st_backUp, #PB_Gadget_BackColor, RGB(236,233,216))
ButtonGadget(#bu_directory, 460, 18, 60, 25, "Get Files...")
ButtonGadget(#bu_backUp, 460, 47, 60, 25, "Accept...")
EditorGadget(#ed_search, 18, 108, 500, 130)
SetGadgetColor(#ed_search, #PB_Gadget_BackColor, RGB(236,233,216))
EditorGadget(#ed_replace, 18, 293, 500, 185)
SetGadgetColor(#ed_replace, #PB_Gadget_BackColor, RGB(236,233,216))
TextGadget(#tx_actionNane, 73, 83, 445, 15, "Action Name")
SetGadgetColor(#tx_actionNane, #PB_Gadget_BackColor , RGB(219,215,181))
TextGadget(#tx_completeAction, 18, 273, 500, 15, "Complete Action")
SetGadgetColor(#tx_completeAction, #PB_Gadget_BackColor , RGB(219,215,181))
ButtonGadget(#bu_clearReplace, 18, 483, 85, 20, "Clear")
TextGadget(#Text_32, 18, 88, 30, 15, "From:", #PB_Text_Right)
TextGadget(#Text_33, 18, 243, 20, 15, "To:", #PB_Text_Right)
EditorGadget(#ed_from, 18, 103, 500, 70)
SetGadgetColor(#ed_from, #PB_Gadget_BackColor, RGB(236,233,216))
EditorGadget(#ed_to, 18, 178, 500, 65)
SetGadgetColor(#ed_to, #PB_Gadget_BackColor, RGB(236,233,216))
ButtonGadget(#bu_clearFrom, 103, 248, 85, 20, "Clear From")
ButtonGadget(#bu_clearSearch, 18, 248, 85, 20, "Clear")
ButtonGadget(#bu_clearTo, 189, 248, 85, 20, "ClearTo")
CloseGadgetList()
; - Tab Choose Files
AddGadgetItem(#Panel_0, -1, "Choose Files")
ContainerGadget(#co_choosefiles, 0, 0, 529, 509)
SetGadgetColor(#co_choosefiles, #PB_Gadget_BackColor , RGB(219,215,181))
OptionGadget(#op_selectAll, 14, 58, 70, 20, "Select All")
OptionGadget(#op_deselectAll, 94, 58, 80, 20, "Deselect All")
flags_ftc.l = #PB_ListIcon_CheckBoxes | #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect
ListIconGadget(#li_filesToCheck, 14, 83, 500, 415, "Status", 50, flags_ftc)
SetGadgetColor(#li_filesToCheck, #PB_Gadget_BackColor, RGB(255,250,215))
SetGadgetColor(#li_filesToCheck, #PB_Gadget_LineColor , RGB(206,201,155))
StringGadget(#st_filesInList, 348, 8, 60, 20, "", #PB_String_ReadOnly)
StringGadget(#st_filesToProcess, 348, 33, 60, 20, "", #PB_String_ReadOnly)
TextGadget(#tx_filesInList, 413, 12, 85, 20, "Files In List")
SetGadgetColor(#tx_filesInList, #PB_Gadget_BackColor , RGB(219,215,181))
TextGadget(#tx_filesToProcess, 413, 36, 85, 20, "Files To Process")
SetGadgetColor(#tx_filesToProcess, #PB_Gadget_BackColor , RGB(219,215,181))
mesg$ = "Files to Process: " + Cr(1)
mesg$ = mesg$ + "UNCHECK Files you DO NOT want to process " + Cr(1)
mesg$ = mesg$ + "DoubleClick on the File Name to Edit/Browse"
TextGadget(#Text_28, 14, 8, 250, 45, mesg$)
SetGadgetColor(#Text_28, #PB_Gadget_BackColor , RGB(219,215,181))
SetGadgetColor(#Text_28, #PB_Gadget_FrontColor , RGB(0,0,128))
CloseGadgetList()
CloseGadgetList()
EndIf
EndIf
EndProcedure
Open_window1()
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow