Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

v1.0.22 released: Tab control


  • Please log in to reply
9 replies to this topic
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Here are the changes for v1.0.22: http://www.autohotkey.com/changelog/

The tab control seemed to be the most-requested control type, which is why it's in this version. Control types such as hotkey, slider, and date are planned for the next version.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004
First : thanks for this new release and for this new control : Tab
I have two question to ask about the Tab control :
1) Is there a way to activate a Tab by a command (for example the click on a button on a tab display an other Tab) ?
2) Is it possible to change the content of a control on a tab witch is not currently displayed ?
Thanks for your answer.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

1) Is there a way to activate a Tab by a command (for example the click on a button on a tab display an other Tab) ?

Yes, and if you assign a variable to the tab, it's easier to refer to it:
Gui, add, tab, vMyTab, First Tab|Second Tab|Third Tab
Gui, tab, 3
Gui, add, button,, Go To 1
...
return

ButtonGoTo1:
GuiControl, choose, MyTab, 1 ; Select the first tab.
return

2) Is it possible to change the content of a control on a tab witch is not currently displayed ?

Yes, use GuiControl also:
GuiControl,, MyEdit, New text contents.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004
Thanks for your reply. Chris
Sorry but some few questions :
1) For that one I must say I didn't try yet : how do you hide a tab and all its contained controls with GuiControl ? "GuiControl, Hide, Tab, 2" ?
If you hide a Tab with "GuiControl, Hide", does it hides automatically all the controls in the tab or is it up to the AHK programmer to do it one by one ? (If it is, for me there is no prob but I prefer to know). Of course the same question apply to GuiControl, Show...

2) In the help file :

Gui, Tab, 3, 2 -- Future controls will be owned by the third tab of the second tab control.

Does it means that a Tab control may have Tab controls in it ? If it is Ok how much maxi ? 256 ?
In this case, the name rule can be applied, with the limitation in the help file (Gui, Tab, Parameters, International) for example ?

Gui, Tab, 3, 2 -- Future controls will be owned by the third tab of the second tab control.

Seems to mean that things are in this order : this is the third Tab witch is "owned" by the second one (up level) of the window. Is it the case ? If it is, isn't more logical to write Gui, Tab, 2, 3, as this is the third Tab of the second one, so the second one it at upper level ?

3) In the help file :

Each control may have no more than 256 tabs.

What's the meaning ? A control can have Tabs ? I don't understand. Just a mistyping ?

Thanks again for your (future) replies and for this fantastic software.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

how do you hide a tab and all its contained controls with GuiControl ? "GuiControl, Hide, Tab, 2" ?

Although you can't hide a particular tab (page) of a tab control, you can either:
1) Hide the entire tab control (which hides all its tabs).
2) Delete tabs off the end of a tab control, which effectively hides just those tabs until you later recreate them. Example:
GuiControl,, MyTab, |Tab1|Tab2 ; If there were 3 tabs before, the 3rd is now hidden.

But there is a bug which prevents method #1 from working. Thanks for finding it, it has now been fixed.

2) In the help file :

Gui, Tab, 3, 2 -- Future controls will be owned by the third tab of the second tab control.

Does it means that a Tab control may have Tab controls in it ?

No, I've specifically disallowed that for now because it raises doubt and complications that don't seem justified given how rarely someone would want to have a tab inside a tab. Do you think you would have a use for doing so?

In this case, the name rule can be applied, with the limitation in the help file (Gui, Tab, Parameters, International) for example ?

If the above question is still unanswered, please clarify.

isn't more logical to write Gui, Tab, 2, 3, as this is the third Tab of the second one, so the second one it at upper level ?

It would be more logical except for the fact that the majority of tabbed windows will have exactly one tab control. By doing it in reverse order, the last parameter can be omitted most of the time.

3) In the help file :

Each control may have no more than 256 tabs.

What's the meaning ? A control can have Tabs ? I don't understand. Just a mistyping ?

I've clarified that to be: "Each tab control may have no more than 256 tabs (pages)."

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Tab is a welcome addition. thanx.

is the planned 'date' control the same as the calendar where we get to select month/day etc.?

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, I think so.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004

GuiControl,, MyTab, |Tab1|Tab2 ; If there were 3 tabs before, the 3rd is now hidden.

OK, so is "GuiControl,, MyTab, |Tab1|Tab2|Tab3" OK to recreate Tab3 ?

No, I've specifically disallowed that for now because it raises doubt and complications that don't seem justified given how rarely someone would want to have a tab inside a tab. Do you think you would have a use for doing so?

If I understand well, there can be more than one Tab control in a GUI, but a Tab control can't be put in an other Tab control. For me that's OK.

Quote:
In this case, the name rule can be applied, with the limitation in the help file (Gui, Tab, Parameters, International) for example ?
If the above question is still unanswered, please clarify.

I think I understand better the command than this morning (for me). The confusion came of the fact that I was thinking that there was the ability to put a Tab control in an other (witch is not usefull for me).

I've clarified that to be: "Each tab control may have no more than 256 tabs (pages).

That's OK for me. It's a large amount of pages. It can be usefull. Thanks again for this new control, for the prog, ......... :) :) :)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

is "GuiControl,, MyTab, |Tab1|Tab2|Tab3" OK to recreate Tab3 ?

Yes. And because the list starts with a pipe, all existing tabs are replaced with the new list, which is three tabs.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004
OK thanks a lot :) :) :)