1. setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Hi,

Just wondering if I can set the pointer to a colour ?

Tried setTextColor(Pointer,Red) .. subscript error setTextColor(PopWin,Red) .. nothing

Just trying to learn .

Cheers, Selgor.

 
 
include win32lib.ew 
without warning 
 
constant 
 Pointer = createMousePointer( 5, 1, { 
 
 "     xx            " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  xxx         " , 
 "    x  x  x        " , 
 "    x  x  xxx      " , 
 "    x  x  x  x     " , 
 "  xxx  x  x  xxx   " , 
 " x  x  x  x  x  x  " , 
 " x  x  x  x  x  x  " , 
 " x  x  x  x  x  x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 "  x             x  " , 
 "   x           x   " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    "    } ) 
 
 constant 
PopWin=create(Window,"",0,700,0,155,200,{WS_POPUP,WS_BORDER,WS_VISIBLE}) 
 
setWindowBackColor(PopWin,#FFFFFF) 
 setMousePointer( PopWin, Pointer ) 
 
procedure get_app(integer pntr, integer event, sequence parms) 
                   --- pntr replaced self 
if pntr = PopWin then 
     setVisible(PopWin,0) 
  end if 
 
end procedure 
 
setHandler({PopWin}, w32HClick, routine_id("get_app")) 
WinMain(PopWin, Normal)
new topic     » topic index » view message » categorize

2. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Hello Selgor,

I'm no expert, but I don't think you can change the color of the mouse pointer.

I think you have to create a bimap amd move it around in tamdem with a hidden pointer.

Don Cole

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

3. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Hello Don,

Thank you for replying .

I have added the following code.

It displays bitmap .

But now I have a DIB error.

Can't "find" bitmap .

So I have to register bmp.

I don't know how to do that.

So, too hard basket ?

Thanks for your help.

Cheers Selgor

 
          atom hBitmap 
          sequence image 
image = 
 
 
 { 
 
 "     xx            " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  x           " , 
 "    x  xxx         " , 
 "    x  x  x        " , 
 "    x  x  xxx      " , 
 "    x  x  x  x     " , 
 "  xxx  x  x  xxx   " , 
 " x  x  x  x  x  x  " , 
 " x  x  x  x  x  x  " , 
 " x  x  x  x  x  x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 " x              x  " , 
 "  x             x  " , 
 "   x           x   " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    " , 
 "    xxxxxxxxxxx    "    } --) 
 
 
-- create the bitmap  
hBitmap = textToBitmap( image ) 
 
-- display the bitmap in TheWindow at {1,1}  
drawBitmap( PopWin, hBitmap, 41, 41 ) 
 
setBitmap(PopWin,{image,41,41}) 
new topic     » goto parent     » topic index » view message » categorize

4. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Selgor said...
-- display the bitmap in TheWindow at {1,1}  
drawBitmap( PopWin, hBitmap, 41, 41 ) 
 
setBitmap(PopWin,{image,41,41}) 
 

try instead

procedure paint(integer self, integer event, sequence parms)  
-- display the bitmap in PopWin at {41,41}   
    drawBitmap( PopWin, hBitmap, 41, 41 )  
end procedure  
setHandler(PopWin, w32HPaint, routine_id("paint"))  
 
--setBitmap(PopWin,{image,41,41}) 
new topic     » goto parent     » topic index » view message » categorize

5. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Hello Pete,

Thank you for your reply.

Yes, it sure shows the bitmap.

No Errors.

re the code you used.... were you taught it, just knew, experience ??

I could find nothing like that.

So now I want to use the bitmap as pointer.

Is it possible.

I'll keep plodding !

Thanks again.

Cheers, Selgor

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

6. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Hi Don, Pete,

Thanks again to each of you.

I have further added the following code.

The result is a red strip.

So I must be closer to a coloured Pointer ??

Cheers,

Selgor

 
 
atom qBitmap 
sequence pixels ,pal 
 
pixels={ 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0},--  } 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}, 
{0,0,0,0}       } 
 
pal= { 
{255,0,0} , 
{0, 0, 255} } 
 
qBitmap = createDIB( {pal, pixels} ) 
 
 
  procedure paint1(integer self, integer event, sequence parms) 
-- display the bitmap in PopWin at {81,81} 
    drawBitmap( PopWin, qBitmap, 81, 81 ) 
end procedure 
setHandler(PopWin, w32HPaint, routine_id("paint1")) 
 
 
new topic     » goto parent     » topic index » view message » categorize

7. Re: setTextColor() Have Pointer Can it be a Red, Blue , ?? Any Help ??

Selgor said...

re the code you used.... were you taught it, just knew, experience ??

I could find nothing like that.

I've been around here a while. I visited the archive and downloaded as many tutorials and example programs as I could. I remember Wolfgang Fritz and Ad Rienks being a particular eye-opener for me, along with Dan Moyer's gateway, which is now bundled with win32lib.

Selgor said...

So now I want to use the bitmap as pointer.

Is it possible.

Probably, but I left win32lib for arwen some time ago.

btw, I just spotted that it should be

    if pntr=PopWin then  
--      setVisible(PopWin,0)  
        closeWindow(PopWin) 
    end if  

otherwise the process remains active but invisible forever.

Regards, Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu