The location of the floating toolbar in the BCG interface library

Source: Internet
Author: User

Using the interface library of BCG, some toolbar usage is different from that of MFC. The cframewnd of MFC directly has a function that can be called to set the position of the floating toolbar, while BCG does not, the underlying implementation of toolbar is totally different from that of MFC.

The code of the BCG library sets the location of the floating toolbar, and it took me a few hours to debug the function by reading its source code, adding, modifying, and calling the function, and finally came out. I personally feel that this method is not very beautiful. If you have any standard usage, please kindly advise. Thank you for that.

The Code is as follows:

Void
Cmainframe: repostexttoolbar (cpoint
&
Ptscreen)
{
Csize SZ
=
M_wndtextbar.calcsize (false );
Crect rtbound (ptscreen. X, ptscreen. Y
-
SZ. Cy
*
, Ptscreen. X, ptscreen. y );
Bool bisdocked
=
M_wndtextbar.isdocked ();
Bool bistabbed
=
M_wndtextbar.istabbed ();
 
If
(
!
Bisdocked
&&

!
Bistabbed)
{
Cbcgpminiframewnd
*
Pminiwnd
=
M_wndtextbar.getparentminiframe (true );
Pminiwnd
->
Setwindowpos (null, rtbound. Left,
Rtbound. Top,
Rtbound. Width (),
Rtbound. Height (),
Swp_nozorder
|
Swp_noactivate
|
Swp_nosize );
M_wndtextbar.adjustsize ();
M_wndtextbar.showwindow (sw_show );
Pminiwnd
->
Showwindow (sw_show );
}
 
Else
 
{
M_wndtextbar.showcontrolbar (true, false, false );
M_wndtextbar.floatcontrolbar (rtbound, bcgp_dm_standard );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.