1. Win32 Static Controls

Does anyone know a way to get around the fact that the STATIC class of
controls won't respond to windows events?  For example, I want to create an
LText that changes text or does some other cool thing when the mouse rolls
over it.  I COULD just create an EditText with the WindowBackColor set to
match the window, with no border or 3-D effects, but I'd rather just use an
LText.  Eventually, I'll end up finding myself in the same boat on ALL the
STATIC class controls, so if anybody has a suggestion, I'd love to hear it!

Thanks in advance,

Brian

new topic     » topic index » view message » categorize

2. Re: Win32 Static Controls

>Does anyone know a way to get around the fact that the STATIC class of
>controls won't respond to windows events?  For example, I want to create an
>LText that changes text or does some other cool thing when the mouse rolls
>over it.  I COULD just create an EditText with the WindowBackColor set to
>match the window, with no border or 3-D effects, but I'd rather just use an
>LText.  Eventually, I'll end up finding myself in the same boat on ALL the
>STATIC class controls, so if anybody has a suggestion, I'd love to hear it!
>
>Thanks in advance,
>
>Brian

I'm not really familiar with Euphoria Windows programming. (So bear with me
if this isn't feasible in Eu), but I know in C (yes I can hear the gasps
from the community now for mentioning the vile beast :P) that all you have
to do is put code in the mousemove event section that when the mouse's
coordinates correspond with what your control's bounds are, it changes the
properties of the control that you want.

Hope this helps,
Adam Weeden
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

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

3. Re: Win32 Static Controls

Brian,

Here's a possibility, based on what Adam said; if you move the mouse around
the upper left quadrant, at some places you'll see a message appear in a
LText control, & when you leave the defined area of the LText control, the
text disappears (it's not sized optimally for the text displayed, it's a
little too big vertically):

------ code begins -----

--  code generated by Win32Lib IDE v0.8

include Win32Lib.ew
without warning

----------------------------------------------------------------------------
----
--  Window Window1
global constant Window1 = create( Window, "The Window", 0, Default, Default,
350, 250+ 19, 0 )
global constant LText1 = create( LText, "LText1", Window1, 50, 50, 200, 50,
0 )
----------------------------------------------------------------------------
----

procedure Window1_onMouse ( int event, int x, int y, int shift )
if event = MOUSE_MOVE then
   if x > 50   and x < 250  and y > 50 and y < 100 then
     setText(LText1, "HELLO")
   else
     setText(LText1, "")
   end if
end if
end procedure
onMouse[Window1] = routine_id("Window1_onMouse")



WinMain( Window1, Normal )

---------- code ends  -----------------------




-----Original Message-----
From: Brian Jackson <bjackson at 2FARGON.HYPERMART.NET>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Saturday, January 15, 2000 9:56 PM
Subject: Win32 Static Controls


>Does anyone know a way to get around the fact that the STATIC class of
>controls won't respond to windows events?  For example, I want to create an
>LText that changes text or does some other cool thing when the mouse rolls
>over it.  I COULD just create an EditText with the WindowBackColor set to
>match the window, with no border or 3-D effects, but I'd rather just use an
>LText.  Eventually, I'll end up finding myself in the same boat on ALL the
>STATIC class controls, so if anybody has a suggestion, I'd love to hear it!
>
>Thanks in advance,
>
>Brian

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

4. Re: Win32 Static Controls

Thanks Adam and Dan,

I've tried playing around with the code you posted Dan, and it's just what
I asked for, but I should have asked more carefully, because I need
something a little different.  I have one routine that does rollovers,
dragging, and resizing for ALL the win32lib controls.  Since STATIC class
controls don't respond to WM_MOUSEMOVE or WM_LBUTTONDOWN events, my code
only works properly on about half of the win32lib objects.  I guess what
I'm looking for is to get down and dirty in the Windows API and figure out
how to either create a STATIC control that responds to the mouse using
CreateWindowEx(), or to build a class that looks like a static control, but
is really something else (like an editText or whatever.)  Hopefully, I've
explained myself more precisely this time, and there's someone who has got
some ideas for me.  Thanks again guys, and from now on, I'll try to say
what I mean...

Brian

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

Search



Quick Links

User menu

Not signed in.

Misc Menu