Re: Where do I call setHint for statusbar?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> Andrew Katz wrote:
> > I see a problem with how we interpret tool tips. Ideally, both the text in a
> > status bar subfield and its tool tip should be dynamic. I mean, that the 
> > program should be able to change either one at any time. In my program, the
> > hints stay the same (it is my help mechanism).
> 
> Fair enough. I think I agree with you.
>  
> > Even though I do not need this for my program, but I noticed that in the
> > browser firefox, the status bar seems to have controls inside of the
> > subfields. So maybe those are the ones generating the tool tips.
> > 
> > Has anyone successfully written an application using the Euphoria IDE and
> > windows library, with controls inside of subfields of a status bar?
> 
> Here is a basis of something you might be able to use...
> 
> }}}
<eucode>
> ----------------
> constant TheProgramType="exw"
> 
> include Win32lib.ew
> without warning
> 
>
> --------------------------------------------------------------------------------
> --  Window Window1
> constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
> 0, 0 )
> constant FakeSB = createEx( Label, "", Window1, 0,{w32AltEdge, -40}, 0.9999,
> 40, WS_BORDER, WS_EX_CLIENTEDGE )
> ---------------------------------------------------------
>
> --------------------------------------------------------------------------------
> 
> sequence textsize
> textsize = getTextExtent(Window1, "M")
> textsize[2] += 10
> constant f1 = createEx(Label, "1st subField", FakeSB,  2, -1, 100,
> textsize[2]-4,
> WS_BORDER, WS_EX_STATICEDGE)
> constant f2 = createEx(Label, "2nd subField", FakeSB,104, -1, 100,
> textsize[2]-4,
> WS_BORDER, WS_EX_STATICEDGE)
> 
> -- Ensure 'statusbar' always spans the window.
> procedure Resize_Window(integer self, integer event, sequence parms)
>     setRect(FakeSB, 0, {w32AltEdge, -textsize[2]}, 0.9999, 
>                            textsize[2], 1)
> end procedure
> 
> setHandler(Window1, w32HResize, routine_id("Resize_Window"))
> setHint ( f1,"Content of field1" )
> setHint ( f2,"Content of field2" )
> 
> WinMain( Window1,Normal )
> ----------------
> </eucode>
{{{

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

This is great! One problem - when the window is maximized, the tool tips show
below the screen, so they cannot be seen. Is this a Windows thing or is it
something in your library? I noticed that in firefox, the tool tips for
stuff in the status bar shows above the items, or below but over my taskbar
so it can be seen.

In incorporating this code, I am thinking two things.

One, how much can be done in the IDE? What is the role of the IDE in such
a case? Since I am not going to abandon the IDE, I want to do as much as
possible in that tool. Because if I use the IDE as a starting point, and
then start to do alot of my own 'tricks', and want to go back into the IDE,
things can break.

Two, there is so much here I do not understand, so I am calling it tricks.
Alot of what I do not know is in the documentation, so I will read as much
as I can. I also think that the HTML for the documentation is generated
from your source code in the library. [or am I imagining things?]

This w32AltEdge constant seems not to be a constant.

This 0.9999 does seem to be a trick. What does that do?

I guess knowing what WS_ and WS_EX_ to use comes from experience.

Sizing controls based upon the font being used, and knowing to test the letter
M for height - this is definitely a trick.

There is not much documentation for createEx - what does -1 do? And what does
passing a sequence do? create has alot of documentation for me to read, so
forgive me if I am being dumb for now.

Setting handlers is really interesting and can be used for alot of
flexibility. I was concerned with it conflicting with IDE generated ones,
but that is not an issue since they are cascading. One needs to make sure
that each routine is self contained and does not depend on the other.

Thanks. And I have yet to look at your other code in the other forum post.

Andy Katz

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu