Solved

TControlbar Painting Problem...

Posted on 1998-06-04
5
350 Views
Last Modified: 2013-12-26
I have a TMIChild container window with 2 Control bars inserted at the top of the window (stacked).  There seems to be an area about 2 pixels wide on the bottom edge of the top control bar that isn't being repainted when the TMDIChild is resized or otherwise covered by another window.  I am increasing the top and bottom margins by 2 in the TControlBar constructor (Margins.Top +=2 and Margins.Bottom +=2).  I have also overridden TControlBar::Paint with the following:

//
// RTMToolBar::Paint(TDC& dc, bool erase, TRect& rect)
//
// This will paint a border between the MenuBar and
// the Toolbar
//
void RTMToolBar::Paint(TDC& dc, bool erase, TRect& rect)
{
      TControlBar::Paint(dc, erase, rect);

        TUIBorder(TRect(0,0,Attr.W,2), TUIBorder::EdgeEtched, TUIBorder::Top).Paint(dc);
}

This code adds an Etched edge to the top of the control bar.

This painting problem seems to exist even if I comment out the edge-painting code or the code that increases the margin size in the contructor.  What can I do?

Darrell Frazier
Manager, Workstation Products
Vendata, Inc.
http://www.vendata.com
djfrazier@vendata.com
0
Comment
Question by:djfr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1299690
Which version of OWL are you using?
0
 

Author Comment

by:djfr
ID: 1299691
BC++ 5.02, OWL 5.0

DJF
0
 
LVL 3

Accepted Solution

by:
JPM earned 200 total points
ID: 1299692
I 've got a similar trouble with a program upgraded from BC4.52 to BC5    ( about a frame )  
I fix up  that pb  when creating an internal border ( or margin )
in the EvEraseBkgnd( HDC hDC)   function
( it 's an odd job but I didn't find a better one  :-)

Hope this helps!

Jean-Paul
0
 

Author Comment

by:djfr
ID: 1299693
I am sorry I was slow to get back.  I was in Montana for a week.  The proposed answer is kind of vague.  Could your provide some example code?

Darrell Frazier

0
 
LVL 3

Expert Comment

by:JPM
ID: 1299694
Hi!
Sorry to be late.....so many things to do...and just 24 hours a day !!!!
The code following  is used  to work around  the same trouble as yours but with a main frame window
////////////////////////////////////////////////////////////////////////////////
bool TMyFrame::EvEraseBkgnd (HDC hDC)
{
    TDC dc(hDC);

  //  getting client area
     TSize clientAreaSize = GetClientRect().Size();
  // getting frame size
     TRect outside = GetWindowRect();
  //  define a  border
     TSize border = outside.Size() - clientAreaSize;
   // define a margin
     TSize marge(2,2);
     int mx = marge.cx * border.cx;
     int my = marge.cy * border.cy;
   // painting an internal frame in gray
     dc.SetBkColor(GetSysColor(COLOR_BTNFACE));
    TRect wr = GetClientRect();
    dc.TextRect(wr.left, wr.top, wr.left+mx, wr.bottom);           // left
    dc.TextRect(wr.left+mx, wr.top, wr.right-mx, wr.top+my);  // top
    dc.TextRect(wr.right-mx, wr.top, wr.right, wr.bottom);         // right
    dc.TextRect(wr.left+mx, wr.bottom-my, wr.right-mx, wr.bottom); // bottom

     return true;      
}
////////////////////////////////////////////////////////////////////////////////
Hope this helps to solve your pb.

Jean-Paul

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question