Solved

Problem with TGauge in Status Bar

Posted on 1997-08-19
5
330 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
[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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

751 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