Solved

Problem with TGauge in Status Bar

Posted on 1997-08-19
5
327 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

813 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