Source language: Translate to:

hpwUtility Tab Control Problem

Questions about NeoBook PlugIns

Moderator: Neosoft Support

hpwUtility Tab Control Problem

Postby Wrangler » Sun Nov 11, 2007 12:05 pm

Hi Hans-Peter,

I'm playing with the tab control. I ran into 2 problems:

hpwUtilitySetVar "[hpwTabControlRealTabNames]" "Check|Edit Program File|Minimize|Exit"

Pub is set to compile as system tray app. This is in the onChange section:

If "[Tab_RealTabName]" "=" "Minimize"
hpwUtilitySetVar "[windowstate]" "minimized"
.SetVar "[windowstate]" "minimized"
endif

Won't minimize the program.

And..

If "[Tab_RealTabName]" "=" "Exit"
Exit "" ""
endif

In ide run mode, the tabs disappear, and then a windows error sounds, but no error message. The pub won't exit. In compiled mode, it makes the error sound, and then exits.

Any reason why these 2 actions won't work?

Thanks for the great plugin.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby HPW » Sun Nov 11, 2007 3:32 pm

Have you put this code in the wizard-window or in the action-editor, which can be opened from there?

In the wizard it should look like this:

Code: Select all
If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Minimize[#34]
hpwUtilitySetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34]
.SetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34]
endif


In the action-editor it will look like your code.
You always have to think what is interpreted when?
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Wrangler » Sun Nov 11, 2007 3:42 pm

If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Minimize[#34]
hpwUtilitySetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34]
.SetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34]
endif

Yes, it looks like that in the wizard. I copy and pasted yours and tried it too. The pub window just won't minimize.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby HPW » Sun Nov 11, 2007 11:38 pm

Not sure where your problem is:

I change the following lines in the demo pub's create tab-button:

Code: Select all
hpwUtilitySetVar "[hpwTabControlRealTabNames]" "RealTest1|RealTest2|Minimize"

hpwTabControlCreate "RTab1" "Test1|Test2|Test3" "[tabpos]" "[tabstyle]" "" "" "" "If [#34][#91]RTab1_RealTabName[#93][#34] [#34]=[#34] [#34]Minimize[#34][#13][#10]  SetVar [#34][#91]WindowState[#93][#34] [#34]Minimized[#34][#13][#10]endif[#13][#10]"

That works for me!
Have a look at the debugger to watch the logic.
Is the name of your tab-rectangle 'Tab'?
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Wrangler » Wed Nov 14, 2007 9:42 am

Sorry for the delay in answering, Hans. Had to go out of town.

The last code you provided worked for me too. So I began the process of elimination to find where the problem is.

Apparently, the minimize only works if using tstabs, NOT tsbuttons or tsflatbuttons. In your code, you use [tabstyle], which contains no data, since I haven't set the variable, so it must default to tstabs. When I select either of the above with the combobox, it doesn't work.

I have only found a problem with minimize and exit so far.

Can't get Exit to work with any tab style used:

If "[Tab_RealTabName]" "=" "Exit"
Exit "" ""
endif

It gives the Windows error SOUND, and won't close in run from ide. Makes the sound and then exits when compiled.

I can live without the exit command, since there are many other ways to exit the program. It just looks nice on the tab bar.

Using version 1.86

Code I'm using:

hpwUtilitySetVar "[hpwTabControlRealTabNames]" "Check|Edit Program File|Sales|Minimize|Exit"

hpwTabControlCreate "Tab" "Check|Edit Program File|Sales|Minimize|Exit" "[tabpos]" "tsTabs" "" "" "" "If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Minimize[#34] [#13][#10]hpwUtilitySetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34] [#13][#10].SetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34] [#13][#10]endif[#13][#10][#13][#10]If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Check[#34][#13][#10]GoSub [#34]getdownloads[#34][#13][#10]hpwTabControlSetTab [#34]tab[#34] [#34]0[#34][#13][#10]endif[#13][#10][#13][#10]If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Edit Program File[#34][#13][#10]Run [#34]notepad.exe[#34] [#34][#91]pubdir[#93]files.dat[#34] [#34]Normal[#34] [#34][#34] [#34][#34][#13][#10]hpwTabControlSetTab [#34]tab[#34] [#34]0[#34][#13][#10]endif[#13][#10][#13][#10]If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Sales[#34][#13][#10]GotoPage [#34]Sales[#34][#13][#10]hpwTabControlSetTab [#34]tab[#34] [#34]0[#34][#13][#10]endif[#13][#10][#13][#10].If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Minimize[#34][#13][#10].hpwUtilitySetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34][#13][#10].SetVar [#34][#91]windowstate[#93][#34] [#34]minimized[#34][#13][#10].hpwTabControlSetTab [#34]tab[#34] [#34]0[#34][#13][#10].endif[#13][#10][#13][#10]If [#34][#91]Tab_RealTabName[#93][#34] [#34]=[#34] [#34]Exit[#34][#13][#10]Exit [#34][#34] [#34][#34][#13][#10]endif[#13][#10]"
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby HPW » Wed Nov 14, 2007 11:18 am

I can reproduce the tabstyle problem.
I will further investigate why it does not work there.

But the exit work for me in the demo:
Code: Select all
hpwUtilitySetVar "[hpwTabControlRealTabNames]" "RealTest1|RealTest2|Exit"

hpwTabControlCreate "RTab1" "Test1|Test2|Test3" "[tabpos]" "[tabstyle]" "" "" "" "If [#34][#91]RTab1_RealTabName[#93][#34] [#34]=[#34] [#34]Exit[#34][#13][#10]  Exit [#34][#34] [#34][#34][#13][#10]endif[#13][#10]"
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Wrangler » Wed Nov 14, 2007 11:30 am

Thanks, Hans. I will try your exit code later, and report back.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby HPW » Wed Nov 14, 2007 11:39 am

Strange, the debugger shows the green check in front of the actions with style tsButtons and tsFlatButtons:

If "[RTab1_RealTabName]" "=" "Minimize"
AlertBox "Test" "OnChange"
SetVar "[WindowState]" "Minimized"
endif


With the AlertBox it does the minimize.
When I comment it out then the minimize does not work.
But the debugger shows the green checker that it is executed.

Neosoft??
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Wrangler » Wed Nov 14, 2007 11:46 am

Yes. I can confirm that. It is strange. I had also noticed the green checks in the debugger.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest