Jump to content

$GUI_HIDE with focus


Recommended Posts

OK, so we start off with a little screen showing a listview that reaches over a couple of labels/inputs and a button. You cant see the covered objects becasue they are $GUI_HIDE to start off with.

$lbl_additm_nam = GUICtrlCreateLabel("Local Filename", 20, 290, 80, 20)
$txt_additm_nam = GUICtrlCreateInput("", 100, 285, 120, 20)
$lbl_additm_url = GUICtrlCreateLabel("URL", 230, 290, 40, 20)
$txt_additm_url = GUICtrlCreateInput("", 270, 285, 170, 20)
$btn_additem = GUICtrlCreateButton("Add Item", 450, 280, 60, 25)
$btn_additem_done = GUICtrlCreateButton("Done", 520, 280, 60, 25)
GUICtrlSetState($lbl_additm_nam, $GUI_HIDE)
GUICtrlSetState($txt_additm_nam, $GUI_HIDE)
GUICtrlSetState($lbl_additm_url, $GUI_HIDE)
GUICtrlSetState($txt_additm_url, $GUI_HIDE)
GUICtrlSetState($btn_additem, $GUI_HIDE)

Once the "Add New Item" button is clicked, the height of the listview is reduced, and the other controls are $GUI_SHOW'n.

Func lsv_files_btn_add()
    GUICtrlSetPos($lsv_Files_array[0], 20, 110, 560, 165)
    GUICtrlSetState($lbl_additm_nam, $GUI_show)
    GUICtrlSetState($txt_additm_nam, $GUI_show)
    GUICtrlSetState($lbl_additm_url, $GUI_show)
    GUICtrlSetState($txt_additm_url, $GUI_show)
    GUICtrlSetState($btn_additem, $GUI_show)
EndFunc  ;==>lsv_files_btn_add

When done "Adding", the "Done" button is clicked and everything goes back to the state it was in previously. Note that I had to add in a $GUI_Focus to even allow the gui to hide the button.

Func lsv_files_btn_add_done()
    GuiCtrlSetState( $btn_save, $GUI_Focus)
    GUICtrlSetState($lbl_additm_nam, $GUI_HIDE)
    GUICtrlSetState($txt_additm_nam, $GUI_HIDE)
    GUICtrlSetState($lbl_additm_url, $GUI_HIDE)
    GUICtrlSetState($txt_additm_url, $GUI_HIDE)
    GUICtrlSetState($btn_additem, $GUI_HIDE)
    GUICtrlSetPos($lsv_Files_array[0], 20, 110, 560, 195)
EndFunc  ;==>lsv_files_btn_add_done

But here is where it gets odd. As soon as the mouse is moved to the edge of where the button used to be, the button comes back.

Any ideas on how I can keep this cat from coming back?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...