Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Rebar Control
#1
Gintaras – I am way out of my league here. Could you please make a QM program example out of this so I can understand how to make the next QM program?

---- This is way above my head ----

I do not know why you have to copy and past this address to make it work.
http://msdn.microsoft.com/en-us/library/bb774536(VS.85).aspx

Macro
Code:
Copy      Help
HWND WINAPI CreateRebar(HWND hwndOwner, HWND hwndToolbar, HWND hwndCombo)
{
;;;;// Check parameters.
;;;;if ((hwndToolbar == NULL) || (hwndCombo == NULL))
;;;;{
;;;;;;;;return NULL;
;;;;}

;;;;// Initialize common controls.
;;;;INITCOMMONCONTROLSEX icex;
;;;;icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
;;;;icex.dwICC   = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
;;;;InitCommonControlsEx(&icex);

;;;;// Create the rebar.
;;;;HWND hwndRebar = CreateWindowEx(WS_EX_TOOLWINDOW,
;;;;;;;;REBARCLASSNAME,
;;;;;;;;NULL,
;;;;;;;;WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
;;;;;;;;WS_CLIPCHILDREN | RBS_VARHEIGHT |
;;;;;;;;CCS_NODIVIDER | RBS_BANDBORDERS,
;;;;;;;;0,0,0,0,
;;;;;;;;hwndOwner,
;;;;;;;;NULL,
;;;;;;;;g_hInst,
;;;;;;;;NULL);

;;;;if(!hwndRebar)
;;;;{
;;;;;;;;return NULL;
;;;;}

;;;;// Initialize band info used by both bands.
;;;;REBARBANDINFO rbBand = { sizeof(REBARBANDINFO) };
;;;;rbBand.fMask  =
;;;;;;;;;;RBBIM_STYLE       // fStyle is valid.
;;;;;;;;| RBBIM_TEXT        // lpText is valid.
;;;;;;;;| RBBIM_CHILD       // hwndChild is valid.
;;;;;;;;| RBBIM_CHILDSIZE   // child size members are valid.
;;;;;;;;| RBBIM_SIZE;       // cx is valid
;;;;rbBand.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS;  //RBBS_FIXEDSIZE |

;;;;// Get the height of the toolbar.
;;;;DWORD dwBtnSize = (DWORD)SendMessage(hwndToolbar, TB_GETBUTTONSIZE, 0,0);

;;;;// Set values unique to the band with the toolbar.
;;;;rbBand.lpText = TEXT("");
;;;;rbBand.hwndChild = hwndToolbar;
;;;;rbBand.cyChild = LOWORD(dwBtnSize);
;;;;rbBand.cxMinChild = NUMBUTTONS * HIWORD(dwBtnSize);
;;;;rbBand.cyMinChild = LOWORD(dwBtnSize);
;;;;// The default width is the width of the buttons.
;;;;rbBand.cx = 0;

;;;;// Add the band that has the toolbar.
;;;;SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);

;;;;// Set values unique to the band with the combo box.
;;;;RECT rc;
;;;;GetWindowRect(hwndCombo, &rc);
;;;;rbBand.lpText = TEXT("Font");
;;;;rbBand.hwndChild = hwndCombo;
;;;;rbBand.cxMinChild = 0;
;;;;rbBand.cyMinChild = rc.bottom - rc.top;
;;;;// The default width should be set to some value wider than the text. The combo
;;;;// box itself will expand to fill the band.
;;;;rbBand.cx = 100;

;;;;// Add the band that has the combo box.
;;;;SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
;;;;
;;;;return (hwndRebar);
}
#2
example


Attached Files
.qml   Dialog rebar toolbars.qml (Size: 3.61 KB / Downloads: 339)
#3
OK how can you keep pulling rabbits out of a hat like that and so quickly as well? You must have massive amounts if experience and intellect. I thought that I was asking a question that would not be answered for a week while you learned how to do it but some how it only took you two hours.

WOW

Thank You
#4
I think that this is a simple question but I just can not find the answer. Other programs use CreateWindowEx in there code to create Tool windows. My question is what is the equivalent code in QM?

Added

One quick question how can I break these two toolbars apart?
#5
CreateWindowEx with extended style WS_EX_TOOLWINDOW. Or make a dialog with this exstyle.
-----------
Place on two rebar controls, or don't use rebar controls.
#6
Please excuse me for not explaining better!

The snippet of code I have is here

// Create the rebar.
HWND hwndRebar = CreateWindowEx(WS_EX_TOOLWINDOW,

I got this from MSDN.

Now let’s say that I wanted to change some styles in Dialog rebar toolbars.qml to

RBS_BANDBORDERS|RBS_VARHEIGHT|CCS_TOP|WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_OVERLAPPED|WS_VISIBLE

And

WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR

Without understanding where QM puts styles and ExStyls in Dialog rebar toolbars.qml all I can do is trial and error.

Now all of styles and ExStyls are just examples but the important part is to understand where to put them in Dialog rebar toolbars.qml and I just do not know where to put them.
#7
in DRT_RebarInit click CreateControl and you'll see in the status bar
#8
Thank you - This is going to get real fun real quick now.
#9
Gintaras Wrote:CreateWindowEx with extended style WS_EX_TOOLWINDOW. Or make a dialog with this exstyle.
-----------
Place on two rebar controls, or don't use rebar controls.

I do not know what I am doing wrong. Every time I try to create two rebar controls it just seems to stay one I even try to place one CCS_TOP and the other CCS_BOTTOM to make sure they are apart but every time they are CCS_TOP and I think that they are still on one rebar control.

Can you please give me an example of how to place one CCS_TOP and the other CCS_BOTTOM?
#10
Don't know, maybe rebar controls don't support these styles and cannot be moved. Then use toolbars without rebars.
#11
How do you get the toolbars to update immediately when you drag the gripper from place to place, so you do not see where the toolbar was?


Attached Files Image(s)
   
#12
Can you put a rebar control in a floating toolbar?
I would like to move the rebar off of the dialog and I think that this is the only way to do it but if I am wrong pleas tell me another way to do this.


Forum Jump:


Users browsing this thread: 1 Guest(s)