1. How do I color in a subfield on a status bar?

I want to be able to address a particular subfield on the status bar, and
write to it a rectangular box of my color.

What are the functions where it is possible to address a subfield?
Can I only write text to a subfield or can I paint to it?

Why do I want to do this? To show the currently selected color visually.

One thing I am trying is to see if there is a character which is a filled
square in some font, and using that. When I attempted to look into a test
to display characters, I found that bug in wPuts.

Thanks.

Andy Katz

new topic     » topic index » view message » categorize

2. Re: How do I color in a subfield on a status bar?

Andrew Katz wrote:
> 
> I want to be able to address a particular subfield on the status bar, and
> write to it a rectangular box of my color.
> 
> What are the functions where it is possible to address a subfield?
> Can I only write text to a subfield or can I paint to it?
> 
> Why do I want to do this? To show the currently selected color visually.
> 
> One thing I am trying is to see if there is a character which is a filled
> square in some font, and using that. When I attempted to look into a test
> to display characters, I found that bug in wPuts.
> 
> Thanks.
> 
> Andy Katz

Hello Andy,

I don't know if I can help you with your status bar. However Judith's
  ColoredButtons can be extended to other controls beside buttons. Although
I've never tried anything but buttons. 

  You speak of a bug in wPuts. What bug is that exactly?

Don Cole

new topic     » goto parent     » topic index » view message » categorize

3. Re: How do I color in a subfield on a status bar?

don cole wrote:
> 
> Andrew Katz wrote:
> > 
> > I want to be able to address a particular subfield on the status bar, and
> > write to it a rectangular box of my color.
> > 
> > What are the functions where it is possible to address a subfield?
> > Can I only write text to a subfield or can I paint to it?
> > 
> > Why do I want to do this? To show the currently selected color visually.
> > 
> > One thing I am trying is to see if there is a character which is a filled
> > square in some font, and using that. When I attempted to look into a test
> > to display characters, I found that bug in wPuts.
> > 
> > Thanks.
> > 
> > Andy Katz
> 
> Hello Andy,
> 
>   I don't know if I can help you with your status bar. However Judith's
>   ColoredButtons
> can be extended to other controls beside buttons. Although 
> I've never tried anything but buttons. 
> 
>   You speak of a bug in wPuts. What bug is that exactly?
> 
> Don Cole

1/ Painting to a status bar: just paint a rectangle at the right client
 coordinates in the status bar. The fields are not like child windows. 
Don't forget to draw a slightly deflated rectangle, so that the field
 borders are still visible.

2/ Indeed, your fix for wPuts() addresses the problem. The problem was that,
when the text is given as {{text_addr,text_length}}, the lib attempts 
to compute the length of text_length, which duly fails.

3/ You need to add the SBT_TOOLTIPS style flag to the status bar for it to
 respond to setHint[Ex]().

CChris

new topic     » goto parent     » topic index » view message » categorize

4. Re: How do I color in a subfield on a status bar?

CChris wrote:
> 
.........
> 
> 1/ Painting to a status bar: just paint a rectangle at the right client
>  coordinates in the status bar. The fields are not like child windows. 
> Don't forget to draw a slightly deflated rectangle, so that the field
>  borders are still visible.
> 
> 2/ Indeed, your fix for wPuts() addresses the problem. The problem was that,
> when the text is given as {{text_addr,text_length}}, the lib attempts 
> to compute the length of text_length, which duly fails.
> 
> 3/ You need to add the SBT_TOOLTIPS style flag to the status bar for it to
>  respond to setHint[Ex]().
> 
> CChris

1 - I did exactly this. But when I placed the code into my parent window in
the general section it did not show. So, does this belong in the onpaint for
the statusbar?

2 - I was given credit for this fix. See the forum.

3 - placing the SBT_TOOLTIPS did not do anything. Where exactly do I place it
in the IDE?

new topic     » goto parent     » topic index » view message » categorize

5. Re: How do I color in a subfield on a status bar?

Andrew Katz wrote:
> 
> I want to be able to address a particular subfield on the status bar, and
> write to it a rectangular box of my color.

There are three ways to do this.
(1) Calculate the location in the status bar where you want the rectanlge to go
and use the drawRectangle routine on the statusbar's paint event to place it.

(2) Create a OWNERDRAWN status bar. This means that you have total control over
what gets placed where in the status bar. But this is not so easy to do.

(3) Use an icon. 

  VOID = sendMessage(mySB, SB_SETICON, iPart, hIcon )

where mySB is the ID of the status bar,
      iPart is a zero based index into which sub field to use,
      hIcon is the handle of an ICON you have loaded from a file

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

6. Re: How do I color in a subfield on a status bar?

Derek Parnell wrote:
> 
> Andrew Katz wrote:
> > 
> > I want to be able to address a particular subfield on the status bar, and
> > write to it a rectangular box of my color.
> 
> There are three ways to do this.
> (1) Calculate the location in the status bar where you want the rectanlge to
> go and use the drawRectangle routine on the statusbar's paint event to place
> it.
> 
> (2) Create a OWNERDRAWN status bar. This means that you have total control
> over
> what gets placed where in the status bar. But this is not so easy to do.
> 
> (3) Use an icon. 
> 
>   VOID = sendMessage(mySB, SB_SETICON, iPart, hIcon )
> 
> where mySB is the ID of the status bar,
>       iPart is a zero based index into which sub field to use,
>       hIcon is the handle of an ICON you have loaded from a file
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

I tried this rectangle, but it erased the rest of the status bar, and I cannot
even address subfields in it any longer.

I cannot use an icon since the purpose is to show a selected color by the
user (yet to be coded).

The owner draw idea sounds interesting. But boy do I think of things which
cannot be done easily. But then again the whole purpose of what I am doing
is to learn as much as possible.

But before I do an owner draw, I prefer to find out if I really cannot do it.

Also, more important to me is to see the subfields tool tips working, since
that is documented as working. Please explain how.

Thanks.

Andy Katz

new topic     » goto parent     » topic index » view message » categorize

7. Re: How do I color in a subfield on a status bar?

Andrew Katz wrote:
> 
> CChris wrote:
> > 
> .........
> > 
> > 1/ Painting to a status bar: just paint a rectangle at the right client
> >  coordinates in the status bar. The fields are not like child windows. 
> > Don't forget to draw a slightly deflated rectangle, so that the field
> >  borders are still visible.
> > 
> > 2/ Indeed, your fix for wPuts() addresses the problem. The problem was that,
> > when the text is given as {{text_addr,text_length}}, the lib attempts 
> > to compute the length of text_length, which duly fails.
> > 
> > 3/ You need to add the SBT_TOOLTIPS style flag to the status bar for it to
> >  respond to setHint[Ex]().
> > 
> > CChris
> 
> 1 - I did exactly this. But when I placed the code into my parent window in
> the general section it did not show. So, does this belong in the onpaint for
> the statusbar?

Yes, you are correct, in w32WPaint event.

> 
> 2 - I was given credit for this fix. See the forum.
> 
> 3 - placing the SBT_TOOLTIPS did not do anything. Where exactly do I place it
> in the IDE?

Derek has provided changes for Win32lib but for future reference you would place
style flags in IDE Property cell Style and/or ExStyle for the control.

IDE will not show a separate Hint for each seqment of StatusBar. However if you
add controls to StatusBar each of those controls would allow an unique Hint.

judith evans

new topic     » goto parent     » topic index » view message » categorize

8. Re: How do I color in a subfield on a status bar?

Judith Evans wrote:

> IDE will not show a separate Hint for each seqment of StatusBar. However if
> you add controls to StatusBar each of those controls would allow an unique
> Hint.
> 
> judith evans

The above statement is not correct; the child controls of StatusBar do not show
a Hint using IDE. I should have tested before I posted!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu