AutoHotkey Community

It is currently May 27th, 2012, 5:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 13th, 2010, 5:35 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
The documentation states that tabs will be appended at the end, while they are in fact appended at the beginning.
Code:
tabs = 3
Gui, Add, Tab2, vTab -wrap, 1|2|3
Gui, Add, Button, Default, Add

Gui, Show
return
GuiClose:
 ExitApp

ButtonAdd:
 GuiControl,,Tab,% ++tabs
return

The issue has come up twice recently.
1. Selecting the position of tab added to existing tab control
2. GuiControl is adding Tabs backwards

I suppose it could be fixed by changing either the code or the documentation.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 13th, 2010, 11:19 pm 
I strongly recommend changing the behavior (if possible) not just changing the docs...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 9:49 am 
if you change the behaviour it wil break any scripts where ppl have worked around or used it as it is.

if its possible what i suggest is to in next release add an optional parameter at end of guicontrol which when used with tabs would tell it whether you want new tabs added at end or start, with 0 or absent = at the start being the default.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 8:39 pm 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
I understand the desire not to break existing functionality, but this is a little strange. You are asking that we maintain broken behavior so that workaround fixes will still fix broken code?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2012, 10:51 pm 
Tyrsius wrote:
I understand the desire not to break existing functionality, but this is a little strange. You are asking that we maintain broken behavior so that workaround fixes will still fix broken code?


I recommend fixing this issue with Autohotkey V2 since Autohotkey V2 will be breaking 90 percent of all the scripts anyway.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2012, 10:43 am 
Offline

Joined: February 20th, 2012, 10:51 pm
Posts: 12
It would be nice if this was fixed sooner rather than only with v2. It is a pretty large bug in AutoHotKey_L. I'm trying to use this functionality now and it is annoying.

How long to wait before v2 comes out? No one knows... and also this rather silly bug will just be in this version forever?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2012, 3:37 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
This appears to be both a bug and working as designed.

As the documentation indicates, new tabs are added to the end. When you run the script from the OP, notice that the "Add" button always remains in the left most tab. It is just an illusion (and a redrawing bug) that the "Add" button is located in any of the other tabs. To prove it, click on any of the other tabs after clicking on the "Add" button. You'll find that the "Add" button is only in the left most tab.

The bug is where the labels are added. New labels are added to the beginning of the control instead of to the end. Since new labels are added to the beginning of the control and new tabs are added to the end of the control, all tabs labels are renamed.

The workaround is to replace all of the tab labels when adding a new tab. For example:

Code:
#NoEnv
#SingleInstance Force

tabs:=3
gui Add,Tab2,vTab -wrap,1|2|3

gui Tab,1
gui Add,Button, Default,Add
gui Add,Text,,This is text on Tab 1

gui Tab,2
gui Add,Text,,This is text on Tab 2

gui Tab,3
gui Add,Button,,This is Tab 3

gui Show
return

GUIClose:
ExitApp

ButtonAdd:
tabs++

;-- Rebuild list of tab names
ListOfTabNames:=""
Loop %tabs%
    ListOfTabNames.="|" . A_Index

;-- Add new tab
GUIControl,,Tab,%ListOfTabNames%
gui Tab,%tabs%
gui Add,Text,,This is text on Tab %tabs%
return

Them be my thoughts...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group