Rebar control (save, restore band position)

Started by KSS, April 10, 2006, 11:38:48 PM

Previous topic - Next topic

KSS

Who know, how I can save and restore position of the band in rebar control?
I try do it with save and restore of band in for structures (REBARBANDINFO), BUT it work different wits unicode and ANSI version of code, and different version of common controls (WinXP and WinXP with SP2+fix from SP3). :'(

donkey

Interesting question, I haven't really played with rebar controls much so I don't have an answer, I think the only place I ever used one was in ToolbarPaint for the tools window. Even then i didn't use bands, just needed it to have a vertical toolbar. If no-one answers by the weekend I will play around with it for a while and see what I can come up with, long weekend and nothing much planned so this might fill some time.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

KSS

Who know, how I can save and restore position of the band in rebar (coolbar) control?  :dazzled:

Budded

I also got this problem, is anyone can slove this?

KSS

I found the problem decision  :dance: , seeming. As soon as there will be time will be engaged in a code writing.

ToutEnMasm

#5
Hello,
I don't know how it can be made,but I know how it work.
First ,position of the band depend of the lenght of the window.
You can't save the position of the band without this data.
Second ,bands have a minimum size in lenght,the rebar control play with this to show the bands in any numbers of lines he want.
User can change the lenght of the bands ,change the order of the bands,delet the bands.
Many things to save , or perhaps ,delet the bands and rebar(?),resize the window and re-create the bands.

This sample can enlight the subject (destroy the rebar before move it)
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/commctrl/rebar/default.asp

xandaz

   Hey guys. I have some questions... I made a rebar control with two bands but i have a problem at application startup. I process the RBN_HEIGHTCHANGE to substract the size of other child windows when a band is dragged. when the applcation starts up and the first and i process the first RBN_HEIGHTCHANGE ( at rebar control creation ) and i send the RB_GETBARHEIGHT msg the returned height is equivalent to the bands being in two separate lines though they're side by side. Does anyone know why?
   please feel free to reply.
   ty and bye guys

KSS

Try do not process RBN_HEIGHTCHANGE before your window is not visible.
P.S. ReBar Control is very buggy...

xandaz


xandaz

   i know that this is an old thread but i was wondering if anyone been around the RB_SIZETORECT and MoveWindow with rebars, when processing WM_SIZE. I'm getting a lot of flickering and i was wondering if someone could give me some pointers. Kay? I'm posting what i've done so far...

KSS

Try to use BeginDeferWindowPos, DeferWindowPos, EndDeferWindowPos.


...
invoke GetClientRect,hFN,ADDR FN_Client_Rect
MOV hDWP,FUNC(BeginDeferWindowPos,5)
; Set size of hReBarMainTop
MOV    ReBarTopHeight,FUNC(SendMessageW,hReBarMainTop,RB_GETBARHEIGHT,0,0)
invoke DeferWindowPos,hDWP,hReBarMainTop,0,0,0,FN_Client_Rect.right,ReBarTopHeight,SWP_NOMOVE or SWP_NOOWNERZORDER or SWP_NOZORDER
CheckDWPCall
; Set size of hReBarMainBottom
MOV    ReBarBottomHeight,FUNC(SendMessageW,hReBarMainBottom,RB_GETBARHEIGHT,0,0)
MOV    ECX,FN_Client_Rect.bottom
SUB    ECX,ReBarBottomHeight
invoke DeferWindowPos,hDWP,hReBarMainBottom,0,0,ECX,FN_Client_Rect.right,ReBarBottomHeight,SWP_NOOWNERZORDER or SWP_NOZORDER
CheckDWPCall
...

and I terminate processing WM_ERASEBKGND because my main window covered by childs controls.

xandaz

   KSS...i've tried it but there's still flickering. Looking for options.... i'll check later for replies. maybe i misunderstood it. Posting results.

dedndave

well - DeferWindowPos may not help too much with flicker - it seems to be fast, though

here are a couple things that i have done in the past that have helped with flicker

behind scrollbars, use COLOR_SCROLLBAR (+1)
in some cases, i make a seperate window for the client area and use NULL_BRUSH
use WS_CLIPCHILDREN
also - make sure you aren't updating the window 2 or 3 times each time it is redrawn   :red

after that - you are talking about handling WM_PAINT and double-buffering

dedndave

what i am seeing is not flicker, as far as i can tell

what i do see is this...
when you bring some other window to the foreground
then move it away....
there is a delay before the toolbar is re-drawn
this is due to the fact that WM_PAINT is handled almost as a last resort - lol
the only thing lower in priority is WM_TIMER (another one that sometimes needs higher priority)

i was thinking about tinkering with the message loop to boost WM_PAINT   :P
probably not really "clean" programming - a kludge at best
but - i am curious to see, is all

dedndave

well - those are 24-bit BMP images
i see you using maybe 16 colors ?
perhaps you could convert them to 16-color files - maybe even ICO