leevy Posted April 13, 2009 Share Posted April 13, 2009 hello, I met a new problem. here is my script: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _Main() Func _Main() Global $parent, $tabitem2 ; Create the GUI window and controls $parent = GUICreate("xxxx", 400, 500, (@DesktopWidth - 400)/ 2, (@DesktopHeight - 500) / 2) $OLD = _SetThemes(0) GUISetIcon("xxxx") $tab = GUICtrlCreateTab(10, 10, 382, 440,0x00000020 ) _SetThemes($OLD) $tabitem1 = GUICtrlCreateTabItem("version") $tabitem2 = GUICtrlCreateTabItem("report") $radioAddreport = GUICtrlCreateRadio("Add reports", 25, 45, 160, 20, 000000) $radioAddreporttemplate = GUICtrlCreateRadio("Add report template", 200, 45, 150, 20, 000000) $bugreporttemplatelabel = GUICtrlCreateLabel("Template", 200, 75, 80, 20, 0x0200) $bugreporttemplate = GUICtrlCreateCombo("", 255, 75, 120, 20) GUICtrlSetData($bugreporttemplate, "report1|template|data", "report1") GUICtrlCreateTabItem("readme") GUICtrlCreateTabItem("") $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) ; Run the GUI until it is closed GUISetState(@SW_SHOW, $parent) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $tab if GUICtrlRead($tab) = 1 Then $clickAddreport = ControlClick("Wing 1.0","",$radioAddreport) EndIf case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub) case $msg = $radioAddreport GUICtrlSetState($bugreporttemplatelabel,$GUI_show) GUICtrlSetState($bugreporttemplate,$GUI_show) Case $msg = $bugreporttemplate GUIDelete($sub) Local $reporttemplate = GUICtrlRead($bugreporttemplate) if $reporttemplate = "template" Then GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("aaaa", 25, 60, 250, 20,0x0080) Else GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("bbbb", 25, 60, 250, 20,0x0080) GUICtrlCreateInput("cccc", 25, 90, 250, 20,0x0080) EndIf EndSelect WEnd Exit EndFunc ;==>_Main Func _SetThemes($Style) If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1) Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties") If Not IsArray($ret) Then Return SetError(1,0,-1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style) Return $ret[0] EndFunc first, I select "data" item from Template in tab report, then I click radio button Add report template, at last, I click radio button Add reports, the question appears at this moment, the two inputbox "bbbb", "cccc" are missing, In fact, the sub window is missing. I hope the controls shown, how can I do it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 13, 2009 Moderators Share Posted April 13, 2009 leevy,Look at this code snippet:case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<When you action $radioAddreporttemplate, you hide the sub-window. If you delete this line, your sub-window stays visible.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
leevy Posted April 13, 2009 Author Share Posted April 13, 2009 leevy, Look at this code snippet:case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< When you action $radioAddreporttemplate, you hide the sub-window. If you delete this line, your sub-window stays visible. M23Sorry, I must hide the sub window, because other controls will be shown when I click $radioAddreporttemplate. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 13, 2009 Moderators Share Posted April 13, 2009 leevy,Please set out the logic flow of what you want to do because I am now confused as to what exactly you want.first, I select "data" item from Template in tab report, then I click radio button Add report template, at last, I click radio button Add reports, the question appears at this moment, the two inputbox "bbbb", "cccc" are missing, In fact, the sub window is missing. I hope the controls shown, how can I do it?Sorry, I must hide the sub window, because other controls will be shown when I click $radioAddreporttemplateYour input boxes are in the sub-window - if you hide the sub-window, you hide the input boxes. You cannot have it both ways!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
leevy Posted April 14, 2009 Author Share Posted April 14, 2009 leevy, Please set out the logic flow of what you want to do because I am now confused as to what exactly you want. Your input boxes are in the sub-window - if you hide the sub-window, you hide the input boxes. You cannot have it both ways! M23Thanks M23, I know the reason now, I have not sorted out the logic flow, so I missed one step "GUISetState(@SW_SHOW, $sub)". Finally, thanks for the warning. the final code is the following, I add "GUISetState(@SW_SHOW, $sub)" at line 49. expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _Main() Func _Main() Global $parent, $tabitem2 ; Create the GUI window and controls $parent = GUICreate("xxxx", 400, 500, (@DesktopWidth - 400)/ 2, (@DesktopHeight - 500) / 2) $OLD = _SetThemes(0) GUISetIcon("xxxx") $tab = GUICtrlCreateTab(10, 10, 382, 440,0x00000020 ) _SetThemes($OLD) $tabitem1 = GUICtrlCreateTabItem("version") $tabitem2 = GUICtrlCreateTabItem("report") $radioAddreport = GUICtrlCreateRadio("Add reports", 25, 45, 160, 20, 000000) $radioAddreporttemplate = GUICtrlCreateRadio("Add report template", 200, 45, 150, 20, 000000) $bugreporttemplatelabel = GUICtrlCreateLabel("Template", 200, 75, 80, 20, 0x0200) $bugreporttemplate = GUICtrlCreateCombo("", 255, 75, 120, 20) GUICtrlSetData($bugreporttemplate, "report1|template|data", "report1") GUICtrlCreateTabItem("readme") GUICtrlCreateTabItem("") $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) ; Run the GUI until it is closed GUISetState(@SW_SHOW, $parent) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $tab if GUICtrlRead($tab) = 1 Then $clickAddreport = ControlClick("Wing 1.0","",$radioAddreport) EndIf case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub) case $msg = $radioAddreport GUISetState(@SW_SHOW, $sub) ; the new added GUICtrlSetState($bugreporttemplatelabel,$GUI_show) GUICtrlSetState($bugreporttemplate,$GUI_show) Case $msg = $bugreporttemplate GUIDelete($sub) Local $reporttemplate = GUICtrlRead($bugreporttemplate) if $reporttemplate = "template" Then GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("aaaa", 25, 60, 250, 20,0x0080) Else GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("bbbb", 25, 60, 250, 20,0x0080) GUICtrlCreateInput("cccc", 25, 90, 250, 20,0x0080) EndIf EndSelect WEnd Exit EndFunc;==>_Main Func _SetThemes($Style) If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1) Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties") If Not IsArray($ret) Then Return SetError(1,0,-1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style) Return $ret[0] EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now