Solved

Problem with TGauge in Status Bar

Posted on 1997-08-19
5
326 Views
Last Modified: 2013-12-26
I am using QWL in Borland BCC 5.01

I have tried to put a Gauge in my status bar using TControlGadget. The gauge works OK and the message text and the gauge are the correct size when the program starts. However when the window has been resized several time the bottom half of the status bar’s message and hints are outside the window an cut off. Also the gauge height has grown to the full size of the bar.

At the moment I have put this same gauge in the Tool Bar where it works OK.

Does know what the problem is and how I can fix it?
0
Comment
Question by:ianpowell
  • 4
5 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1299359
I am using 5.02 and can't reproduce your problem, although using the Gauge in the statusbar doesn't look good because of the border of the Gauge that you can't get rid of.

Maybe you can post the code you are using to add the Gauge to the statusbar and tell us for which platform (win31, win95 or winNT) you are working.

To get rid of the border you have to derive your own class from the TGauge and rewrite the Paint method.

0
 
LVL 3

Expert Comment

by:msmits
ID: 1299360
Another problem that I saw later was that the Gauge is still visible when the StatusBar goes into hint display mode. I believe the only correct solution will be to write a TGaugeGagdet that is derived from TGagdet and implements about the same functionality as the gadget, although I don't see any use for vertical gauges in a statusbar.

0
 

Author Comment

by:ianpowell
ID: 1299361
I am using Windows 95

I also tried a TEdit control in TControlGadget as a test which had similar but not so server problems.

I think you are right that it needs a TGagetGauge written. Someone has sent me some code, which has a flicker problem. but which I have yet to try.

msmits<<Another problem that I saw later was that the Gauge is still visible when the StatusBar goes into hint display mode.>> I don’t recall having this problem perhaps the something was changed for 5.02.

I don’t have my original code as it got destroyed when I move the Gauge to the tool bar. But I do remember that I had a lot of problems with address violation when thing were done in the wrong order.


0
 
LVL 3

Expert Comment

by:msmits
ID: 1299362
I checked the code of TGauge between 5.01 and 5.02 and except for the copyright and version number nothing has changed. I don't know about the TControlGadget and TStatusBar, but expect nothing significant has changed. I will check it this weekend.

It doesn't seem like a big problem to copy/paste some code from the gauge.cpp file for a TGaugeGadget class. I can give it a try this evening and put up the code on my ftp-site. I will add another comment when it is done.

0
 
LVL 3

Accepted Solution

by:
msmits earned 100 total points
ID: 1299363
My testing code was (in InitMainWindow()):

  myProgress = new TProgress(NULL, "%d%%", 0, 0, 0,
                             100, 15, true, 0);
  myProgress->SetNativeUse(nuNever);
  myProgress->SetRange(0, 100);
  myProgress->SetValue(0);
  TControlGadget *myControlGadget =
      new TControlGadget(*myProgress, TGadget::Recessed);
  sb->Insert(*myControlGadget);

where myProgress is of the type TGauge* and a class member of the application class.

I have now written a TGaugeGadget class with the same interface as the TGauge class, except for the obvious ommision of SetNativeUse(), SetupWindow(), EvEraseBkgnd(), GetClassname(), PaintBorder() and the data member ClassNativeUse.
The implementation can be downloaded from:

  ftp://ftp.iaehv.nl/pub/users/msmits/exp-exch/gaugegad.zip

An example of the use (equivalent with the above) is:

  myProgress = new TGaugeGadget(0, "%d%%", 100, 15,
                                true, 1, TGadget::Recessed);
//  myProgress->SetLed(10, 90);
  myProgress->SetRange(0, 100);
  myProgress->SetValue(0);
  sb->Insert(*myProgress);

It also supports vertical stuff and the led style gauges. It however will not use the native control.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RSS Feeds--IE 13 166
How to I "stripe" columns using XSLT 3 38
Node js - send response after all promises are resolved 1 51
ColdFusion Rereplace 3 71
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now