Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#286 closed Bug (No Bug)

_GUICtrlReBar_AddBand() UDF: controls move off rebar bands after beta 3.2.11.7

Reported by: rover Owned by: Gary
Milestone: Component: Standard UDFs
Version: 3.2.12.0 Severity: None
Keywords: Cc:

Description

Problem using _GUICtrlReBar_AddBand() with standard controls after beta 3.2.11.7
tested with GUICtrlCreateInput() and GUICtrlCreateButton()

Running XP SP2+ EN X86
tested ok in prod 3.2.10.0 and beta 3.2.11.7
untested in 3.2.11.8 or 3.2.11.9
tested as problem in 3.2.11.10 up to 3.2.12.0-rc4

Example:
run and minimize to taskbar, then restore.
control will move from rebar band to overlap dtp control
adjusting rebar manually will move control back to band

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiReBar.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiConstantsEx.au3>

Opt("MustDeclareVars", 1)
Global $hgui, $hReBar, $hDTP, $h

$hgui = GUICreate("Rebar", 400, 396)
$hReBar = _GUICtrlReBar_Create($hgui, BitOR($CCS_NODIVIDER, $CCS_TOP))
$hDTP = _GUICtrlDTP_Create($hgui, 0, 0, 190)
_GUICtrlReBar_AddBand($hReBar, $hDTP, 120, 120, "", 0)

$h = GUICtrlCreateButton("Exit", 0, 0, 120, 20)
;$h = GUICtrlCreateInput("Input control", 0, 0, 120, 20)
_GUICtrlReBar_AddBand($hReBar, GUICtrlGetHandle($h), 120, 200, "Name:", 1)

GUISetState(@SW_SHOW)
Sleep(1000)
GUISetState(@SW_MINIMIZE)
Sleep(1000)
GUISetState(@SW_RESTORE)

While 1
    Switch GUIGetMsg()
	Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Attachments (0)

Change History (4)

comment:1 Changed 16 years ago by Gary

Appears to be a repaint issue.

Show/Hide Band(s) does a redraw of the rebar.

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiReBar.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiConstantsEx.au3>

Opt("MustDeclareVars", 1)
Global $hgui, $hReBar, $hDTP, $h

$hgui = GUICreate("Rebar", 400, 396)
$hReBar = _GUICtrlReBar_Create($hgui, BitOR($CCS_NODIVIDER, $CCS_TOP))
$hDTP = _GUICtrlDTP_Create($hgui, 0, 0, 190)
_GUICtrlReBar_AddBand($hReBar, $hDTP, 120, 120, "", 0)

$h = GUICtrlCreateButton("Exit", 0, 0, 120, 20)
;~ $h = GUICtrlCreateInput("input", 0, 0, 120, 20)
_GUICtrlReBar_AddBand($hReBar, GUICtrlGetHandle($h), 120, 200, "Name:", 1)

GUISetState(@SW_SHOW)
Sleep(1000)
GUISetState(@SW_MINIMIZE)
Sleep(1000)
GUISetState(@SW_RESTORE)
_GUICtrlRebar_ShowBand($hReBar, 0, False)
_GUICtrlRebar_ShowBand($hReBar, 1, False)
Sleep(1000)
_GUICtrlRebar_ShowBand($hReBar, 0, True)
_GUICtrlRebar_ShowBand($hReBar, 1, True)
While 1
    Switch GUIGetMsg()
	Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

comment:2 follow-up: Changed 16 years ago by Gary

  • Resolution set to No Bug
  • Status changed from new to closed

The rebar is not part of the built-in functions so you'll have to make sure it refreshes. The built-in controls created are going to repaint at the location specified when created.

comment:3 in reply to: ↑ 2 Changed 16 years ago by anonymous

Replying to Gary:

The rebar is not part of the built-in functions so you'll have to make sure it refreshes. The built-in controls created are going to repaint at the location specified when created.

That's the solution I came up with, but I found only the second call is needed.
_GUICtrlRebar_ShowBand($hReBar, 0, False) followed by 'True' causes flashing.

I use this WM_NCPAINT message handler in a Gui with 4 bands. Toolbar/GUICtrlCreateButton()/2x GUICtrlCreateInput()
seems to work OK, any suggestions?

I guess the help file examples that use bands and built-in controls will have to be updated.

Thanks Gary

GUIRegisterMsg($WM_NCPAINT, "MY_WM_NCPAINT")

Func MY_WM_NCPAINT($hWnd, $Msg, $wParam, $lParam)
    If $wParam = "0x00000001" Then
        If IsHWnd($hReBar) Then
            Local $cnt = _GUICtrlRebar_GetBandCount($hReBar)
            If $cnt Then
                For $i = 0 To $cnt -1
                    _GUICtrlRebar_ShowBand($hReBar, $i, True)
                Next
            EndIf
        EndIf
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc

comment:4 Changed 16 years ago by rover

the above comment should have been from 'rover'

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 owner will remain Gary.
Author


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

 
Note: See TracTickets for help on using tickets.