1. [WIN] Label text colors and window control...

Heya all!

I'm gonna start looking into creating a new GUI on the program i've
been working on, this time using irregular.ew and the example of
Euman's prog, however, before I do this, I need to ask a couple
questions...

1) I'm going to make this window without a caption bar, but another
control will be allowed to move the window around. Where do I start
to do this?

2) I want to be able to change label text colors. I looked around on
the MSDN library site, I didn't find anything to do this. Is it possible,
and if so, how do I get to change it? (Define the color of foreground
before I create my window, perhaps?)

TIA,

--"LEVIATHAN"

new topic     » topic index » view message » categorize

2. Re: [WIN] Label text colors and window control...

Levi,

To move a window or other control:

in Win32Lib 0.54 &  I think 55, you can use:
setRect ( control, left, top, width, height, repaint )

in 0.50,
moveWindow( control, x, y, cx, cy, repaint )

Dan Moyer

----- Original Message -----
From: "LEVIATHAN" <leviathan at USWEST.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, January 22, 2001 12:47 AM
Subject: [WIN] Label text colors and window control...


> Heya all!
>
> I'm gonna start looking into creating a new GUI on the program i've
> been working on, this time using irregular.ew and the example of
> Euman's prog, however, before I do this, I need to ask a couple
> questions...
>
> 1) I'm going to make this window without a caption bar, but another
> control will be allowed to move the window around. Where do I start
> to do this?
>
> 2) I want to be able to change label text colors. I looked around on
> the MSDN library site, I didn't find anything to do this. Is it possible,
> and if so, how do I get to change it? (Define the color of foreground
> before I create my window, perhaps?)
>
> TIA,
>
> --"LEVIATHAN"

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

3. Re: [WIN] Label text colors and window control...

Leviathan has seen that it can be done, now wants to go do it. So good comes
from goofups, occasionally.

<snip> another control will be allowed to move the window around. Where do I
start to do this?
</snip>

I've been tinkering with window positioning myself. setRect puts it where
you want it. If you don't want to change the size, use ... well here, let me
drop a few lines of code:

<code (somewhat tested)>
-- Where posSeq is a "position sequence"
-- {control_id, position_left, position_top}
-- Make sure that posSeq[CTL_ID] identifies a window ....

extent = getRect(Screen)
size = getCtlSize(posSeq[CTL_ID])

-- Ensure that the window will be positioned so that it is entirely on the
screen.
posSeq[POS_LEFT] = min({posSeq[POS_LEFT], extent[SCR_WIDTH] -
size[CTL_WIDTH]})
posSeq[POS_LEFT] = max({posSeq[POS_LEFT], 0})
posSeq[POS_TOP] = min({posSeq[POS_TOP], extent[SCR_HEIGHT] -
size[CTL_HEIGHT]})
posSeq[POS_TOP] = max({posSeq[POS_TOP], 0})

setRect(posSeq[1], posSeq[2], posSeq[3], size[1], size[2], False)
</code>

If you want my min and max functions, I'll be happy to send them. I rolled
my own, tho there are prolly just-as-good-or-better ones in an existing
liebury somewhere.

max(atom) = the atom, to be nice
max(seq) = the greatest element, except:
max({}) = the program crashes (not so nice)!

and min works similarly. You might want to do your position checking and
rectifying interactively while the user is tinkering with the control.

George


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu