1. Buttons

I have several buttons on panels like:

     leftButtonText = {"E&XIT","&NEXT","&PREV","&FIND","&ADD","&SETTAB"}

and 'alt letter' like 'alt x' will activate the EXIT button's process. I
would also like to just press the letter 'x' (upper or lower) and not have
to press the alt as well. Is their a way to do this?

I was wondering when you were going to ask :)

Hook the onKeyPress event for the window on which the buttons appear:
procedure MainWindow_onKeyPress ( int keyCode, int shift )
keyCode = upper(keyCode)
if keyCode = 'C' then
   ReadCustomerFile()
   openWindow(CustomerWindow,Normal)
elsif keyCode = 'D' then
   ReadDriverFile()
   openWindow(DriverWindow,Normal)
.... and so on.

Regards,
Irv

new topic     » topic index » view message » categorize

2. Re: Buttons

thanks Irv...

..george

----- Original Message -----
From: "Irv Mullins" <irvm at ellijay.com>
To: "EUforum" <EUforum at topica.com>
Subject: Buttons


>
> I have several buttons on panels like:
>
>      leftButtonText = {"E&XIT","&NEXT","&PREV","&FIND","&ADD","&SETTAB"}
>
> and 'alt letter' like 'alt x' will activate the EXIT button's process. I
> would also like to just press the letter 'x' (upper or lower) and not have
> to press the alt as well. Is their a way to do this?
>
> I was wondering when you were going to ask :)
>
> Hook the onKeyPress event for the window on which the buttons appear:
> procedure MainWindow_onKeyPress ( int keyCode, int shift )
> keyCode = upper(keyCode)
> if keyCode = 'C' then
>    ReadCustomerFile()
>    openWindow(CustomerWindow,Normal)
> elsif keyCode = 'D' then
>    ReadDriverFile()
>    openWindow(DriverWindow,Normal)
> .... and so on.
>
> Regards,
> Irv
>
>
>
>
>

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

3. Re: Buttons

Irv, and Derick
    Where is ... onKeyPress[Screen] = routine_id("onKeyPress_Screen")...
documented? the w32lib_full.ew book says the syntax for onKeyPress is
like....onKeyPress(keyCode,shift)....which does not work but what you send
does...am I missing some doc somewhere??

..george


----- Original Message -----
From: "Irv Mullins" <irvm at ellijay.com>
To: "EUforum" <EUforum at topica.com>
Subject: Buttons


>
> I have several buttons on panels like:
>
>      leftButtonText = {"E&XIT","&NEXT","&PREV","&FIND","&ADD","&SETTAB"}
>
> and 'alt letter' like 'alt x' will activate the EXIT button's process. I
> would also like to just press the letter 'x' (upper or lower) and not have
> to press the alt as well. Is their a way to do this?
>
> I was wondering when you were going to ask :)
>
> Hook the onKeyPress event for the window on which the buttons appear:
> procedure MainWindow_onKeyPress ( int keyCode, int shift )
> keyCode = upper(keyCode)
> if keyCode = 'C' then
>    ReadCustomerFile()
>    openWindow(CustomerWindow,Normal)
> elsif keyCode = 'D' then
>    ReadDriverFile()
>    openWindow(DriverWindow,Normal)
> .... and so on.
>
> Regards,
> Irv
>
>
>
>
>

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

4. Re: Buttons

Hi George,
> ------- Start of forwarded message -------
> From: George Walters <gwalters at sc.rr.com>
> To: EUforum <EUforum at topica.com>
> Reply-To: EUforum at topica.com
> Subject: Re: Buttons
> Date: 2/08/2001 10:47:23 AM
> 
> Irv, and Derick
>     Where is ... onKeyPress[Screen] = 
> routine_id("onKeyPress_Screen")...
> documented? the w32lib_full.ew book says the syntax for onKeyPress is
> like....onKeyPress(keyCode,shift)....which does not work but 
> what you send
> does...am I missing some doc somewhere??
> 

Is it the "[Screen]" part you are inquiring about?

If so, you are correct, this functionality isn't documented in the HTML
file. It is only documented in the source code. I'll fix that up.

However, it is possible to set an event handler for the 'Screen' control.
When you do this, all events of the type specified are trapped regardless of
which actual control initiated the event.

Thus "onKeyPress[Screen] = routine_id(<whatever>)" will cause the <whatever>
routine to fire up for every keypress in the application regardless of which
control had keyboard focus at the time.

This is not the typical way that Windows programming is done and is only
used for special circumstances. Normally you would set up a seperate
keyboard handler for each specific control you were interested in. With the
Screen option, you have to be careful because you might cause unwanted
side-effects.

For example, in your case you want the 'X' key to exit the window. However,
if the user was entering data into an edit box and happened to enter the
word "fox", you could cause the program to exit prematurely. In this case
you might want to test which control had focus and exclude the special 'X'
processing for edit boxes. 

Also, in a related issue, you can get the KeyPress handler to tell Windows
to ignore the key just entered by the user. For example:

   procedure onKeyPress_Screen(integer keycode, integer shifts)
       if find(keycode, "pP") and 
          getControlInfo(getSelf(), CONTROLINFO_type) != EditText then
            PrintInvoice()
            -- Get Windows to ignore this key.
            returnvalue(-1)
       end if
   end procedure



-----------
cheers,
Derek Parnell
Senior Design Engineer
Global Technology Australasia Ltd
dparnell at glotec.com.au

---------------------


confidential information intended solely for the use of the individual or
entity to whom they are addressed. If you are not the intended recipient of
this message you are hereby notified that any use, dissemination,
distribution or reproduction of this message is prohibited. If you have
received this message in error please notify the sender immediately. Any
views expressed in this message are those of the individual sender and may
not necessarily reflect the views of Global Technology Australasia Limited.

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

5. Buttons

Hi,

Does anybody of u pro's know how to :

Make a Picturebutton or Pushbutton TRANSPARENT ???
or
Change the color of the Button Background and/or TEXTcolor
or
Make non-rectangular buttons (for ex.: Round buttons)

If u know , or if u can help me Please mail me
because i could really need this in Euphoria

(and please Don't tell me Visual Basic rules over Euphoria,cause in VB it
is a piece of cake)



Thanks

Renzo from Belgium (still busy Trying to program in Euphoria using Win32lib)



next to this ,Euphoria still misses .MDB access and animation (ani gif)

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

6. Re: Buttons

------=_NextPart_000_0040_01BFF297.8E153040
        charset="iso-8859-2"

> Make non-rectangular buttons (for ex.: Round buttons)

i came accross this on the web. i didnt test it, but should work. its vb
code. you can easily transalte it to euphoria code using win32lib. let me
know if you do it, becuase i am interested in this too. send code to see it
when done.

i got it on this site:
http://www.vbcode.com/asp/showsn.asp?theID=220

attached is the whole file, down here is the most important code:


Private Function GetTextRgn() As Long
    Dim hRgn1 As Long, hRgn2 As Long
    Dim rct As RECT

    BeginPath hdc

    TextOut hdc, 10, 10, Chr$(255), 1     'Windows Flag

    'Circle (2000, 2000), 1000            'Circle window

'Create any path you want in this section to create your irregular window.

    EndPath hdc

    hRgn1 = PathToRegion(hdc)
    GetRgnBox hRgn1, rct
    hRgn2 = CreateRectRgnIndirect(rct)
    CombineRgn hRgn2, hRgn2, hRgn1, 1
    DeleteObject hRgn1
    GetTextRgn = hRgn2
End Function

----when you create window, use this function after created:

hRgn = GetTextRgn()
SetWindowRgn (hwnd, hRgn, 1)






------=_NextPart_000_0040_01BFF297.8E153040
        name="irregular shaped windows.txt"
Content-Transfer-Encoding: quoted-printable

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

Search



Quick Links

User menu

Not signed in.

Misc Menu