Sign in to follow this  
Followers 0
fett8802

GUICtrlCreateTabItem("") Problems

5 posts in this topic

Hello All,

Firstly, in order to run this program, you'll need to get the zip file containing the needed files. There are a couple of includes that many of you may already have, but some may not. The file we need to look at is RadarCodev2.au3.

The zip file is located here: http://www.kmillscp.com/uploads/scripts/RCv2.zip

The problem I'm having is that I have a ReBar control. When pressing the buttons on the toolbar of the rebar controls, everything works out just fine. However, when using a tray icon command or a menu command, the toolbar icons disappear.

In the code, I'm basically calling the function I use for the toolbar controls when I run the command from the tray or the menu.

The problem is on line 550. If I take the GUICtrlCreateTabItem("") out of the equation, everything works just perfectly - except the obvious tab problems that creates. I can't figure out a work around for the life of me.

I'll quickly explain the code as I don't have it commented well yet. When a toolbar button is pressed, it calls the gToolbar function which figures out which button was pressed and then calls the fToolbar function to actually carry out the command. When a menu item or tray item is pressed, fMenu is called to figure out what command was pressed at which point it then also calls the fToolbar function with the correct item to run.

All commands are sent correctly and all operation is correct except that the toolbar disappears when called from the menu or tray.

Any ideas?

Thanks!

-Fett


[sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub]

Share this post


Link to post
Share on other sites



Use commands like this

_WinAPI_RedrawWindow( $hToolBar[0], 0, 0, $RDW_ERASE + $RDW_INVALIDATE )

_WinAPI_RedrawWindow( $hToolBar[1], 0, 0, $RDW_ERASE + $RDW_INVALIDATE )

or this

_GUICtrlToolbar_SetButtonState($hToolBar[0], 1, $TBSTATE_HIDDEN )

_GUICtrlToolbar_SetButtonState($hToolBar[0], 1, $TBSTATE_ENABLED)

_GUICtrlToolbar_SetButtonState($hToolBar[1], 1, $TBSTATE_HIDDEN )

_GUICtrlToolbar_SetButtonState($hToolBar[1], 1, $TBSTATE_ENABLED)

to refresh your toolbars.

LarsJ

Share this post


Link to post
Share on other sites

To use _GUICtrlToolbar_SetButtonState use these commands, sorry.

_GUICtrlToolbar_SetButtonState($hToolBar[0], 0, $TBSTATE_HIDDEN )

_GUICtrlToolbar_SetButtonState($hToolBar[0], 0, $TBSTATE_ENABLED)

_GUICtrlToolbar_SetButtonState($hToolBar[1], 0, $TBSTATE_HIDDEN )

_GUICtrlToolbar_SetButtonState($hToolBar[1], 0, $TBSTATE_ENABLED)

Share this post


Link to post
Share on other sites

That did it. Thank you very much!


[sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub]

Share this post


Link to post
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
Sign in to follow this  
Followers 0