Board index » cppbuilder » Cool Bar help
Patric
![]() CBuilder Developer |
Mon, 03 Mar 2003 03:00:00 GMT
|
Patric
![]() CBuilder Developer |
Mon, 03 Mar 2003 03:00:00 GMT
Cool Bar help
We are using C++ Builder 5.0 and have been unable to create a floating
button panel using the Cool Bar component. Is there anyone on the list who can create a simple one form project which has a Cool Bar with a button on it? If anyone could zip up a project like that and email it to us we would be very thankfull. Thank You |
Team
![]() CBuilder Developer |
Wed, 05 Mar 2003 03:00:00 GMT
Re:Cool Bar helpHi Patrick -- Quote> We are using C++ Builder 5.0 and have been unable to create a mechnism isn't well-suited for buttons, and (2) the TCoolBar component class is a weak wrapper around the rebar common control. So, to make this work, you'll need to subclass the CoolBar instance (e.g., CoolBar1), manually handle the RBN_BEGINDRAG and RBN_ENDDRAG rebar notification messages, manually rendern a tracking rectangle, and then use the TControl::ManualFloat() member function. The RBN_BEGINDRAG notification message is sent when the user drag a So, first set the DragKind property of all banded controls (i.e., all // in header... // original window procedure // in source... Quote} { switch (AMsg.Msg) { // for all notification messages... case CN_NOTIFY: { LPNMREBAR lpnmr = reinterpret_cast<LPNMREBAR>(AMsg.LParam); // in response to RBN_BEGINDRAG... if (lpnmr->hdr.code == RBN_BEGINDRAG && lpnmr->dwMask & RBNM_ID) { // grab a pointer to the TCoolBand that's being dragged DragBand_ = reinterpret_cast<TCoolBand*>(lpnmr->wID); // get its bounding rectangle SNDMSG(CoolBar1->Handle, RB_GETRECT, DragBand_->Index, reinterpret_cast<LPARAM>(&RDragBand_)); // map the rectangle to screen coordinates MapWindowPoints( CoolBar1->Handle, HWND_DESKTOP, reinterpret_cast<LPPOINT>(&RDragBand_), 2 ); // store the position of the mouse cursor // set the flags // restore screen updates // un-dock the control Quote} TShiftState Shift, int X, int Y) { if (is_dragging_) { POINT PMouse = {X, Y}; RECT RCoolBar = CoolBar1->ClientRect; if (!PtInRect(&RCoolBar, PMouse)) { PMouse = CoolBar1->ClientToScreen(PMouse); const int dX = PMouse.x - PDrag_.x; const int dY = PMouse.y - PDrag_.y; // suspend screen updates // grab a handle to the screen DC // update the stored cursor position // restore screen updates, then update Quote} -- |
Julio Fari
![]() CBuilder Developer |
Wed, 05 Mar 2003 03:00:00 GMT
Re:Cool Bar helpTry de ControlBar component (TControlBar). Hope it will suit your needs. Greetings, |
1. Menu Bar/Tool Bar/Cool Bar help/guidance
4. Help on Cool Bar - how to add an object to it runtime ?
5. How do I use a Progress Bar / Status Bar
6. Label a BAR in a TChart stacked bar?
7. why status bar under windows task bar??
8. Progess bar inside a status bar panel