Modify

Opened 17 years ago

Closed 17 years ago

#87 closed Bug (No Bug)

Label disappears when clicking on a button

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: Cc:

Description

The first time you click on the button at the bottom, the label, which gives the color to the tab, disappears, then if you click on a tab and on the button again, the label is visible. Running 3.2.10.0 on Windows 2000. If I click on the button on tab 1, the label disappears most of the times, bug or what ?

#include <GuiConstantsEx.au3>
#include <GuiTab.au3>
Global $ColorTab, $TabItem, $go, $msg

$main = GUICreate ("Test", 400,300)
GUISetBkColor (0)
$TabItem = GUICtrlCreateTab(5, 5,390, 260)
GUICtrlCreateTabItem ("Tab item - 1")
$button1 = GUICtrlCreateButton ("test", 35, 35, 35,35)
GUICtrlCreateTabItem ("Tab item - 2")
GUICtrlCreateTabItem ("Tab item - 3")
GUICtrlCreateTabItem ("Tab item - 4")
GUICtrlCreateTabItem ("")
$go = GUICtrlCreateButton ("test", 5, 270, 390,25)

_GUICtrlTab_SetCurSel(GUICtrlGetHandle($TabItem),0)
_GUICtrlTab_SetCurFocus(GUICtrlGetHandle($TabItem),0)
TabEvent()

GUISetState ()
While 1
    $msg = GUIGetMsg ()
    If $msg = $gui_event_close Then ExitLoop
    if $msg = $TabItem Then TabEvent()
    if $msg = $go Then Tab1()
    if $msg = $button1 Then Tab1()
WEnd

Func TabEvent()
	Local $l_tab, $l_tabX, $l_tabY, $l_margin, $l_coord, $l_text
   ; $test = IniRead ("test.ini", "Selected", "Tab item selected" , 0)
   	$l_tabX = 5
	$l_tabY = 5
	$l_margin = 1
    $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem))
    $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem), $l_tab); Get coordinates of TabItem
    $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem), $l_tab); Get text of TabItem
    ;If $test <> $l_tab  Then
    	GUICtrlDelete($ColorTab)
        $ColorTab = GUICtrlCreateLabel($l_text, $l_tabX + $l_coord[0] + $l_margin, $l_tabY + $l_coord[1] + $l_margin, $l_coord[2] - $l_coord[0] - ($l_margin * 2), $l_coord[3] - $l_coord[1] - ($l_margin * 2), BitOR($SS_NOTIFY, $SS_CENTER, $SS_SUNKEN))
        GUICtrlsetBkColor ($ColorTab,0xFFFFC0 ); set the color of the label
     ;   IniWrite ("test.ini", "Selected", "Tab item selected", $l_tab)
      ;  $test = $l_tab
    ;EndIf
    _GUICtrlTab_SetCurFocus(GUICtrlGetHandle($TabItem),$l_tab)
EndFunc
Func Tab1()
    If $msg = $go Then
        MsgBox (0, "", _GUICtrlTab_GetItemState ($main,0))
    EndIf
EndFunc

Attachments (0)

Change History (4)

comment:1 Changed 17 years ago by Wooltown <sven.ullstad@…>

PLEASE close this, I got a solution via mail from Valik.

Didn't check mail early this morning.

Wooltown

comment:2 Changed 17 years ago by Jpm

  • Resolution set to rejected
  • Status changed from new to closed

comment:3 Changed 17 years ago by Jpm

  • Resolution rejected deleted
  • Status changed from closed to reopened

comment:4 Changed 17 years ago by Jpm

  • Resolution set to nobug
  • Status changed from reopened to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.