Author Topic: Simulated X window bar.  (Read 3241 times)

0 Members and 1 Guest are viewing this topic.

Offline Robert Sarrazin

  • Newbie
  • *
  • Posts: 20
  • User-Rate: +0/-2
Simulated X window bar.
« on: August 29, 2011, 11:47:27 PM »
Hi, I try to use a bitmap skin and I created ( X ) ???
a button call Xbutton to exit the program.

-----------------------
SUB FORM1_XBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
                 (what is the best to exit  ::) )
          CASE ELSE
     END SELECT
END SUB
-----------------------
do I have to sent message terminate,
or exit,
or use %WM_CLOSE,0,0   EXIT FUNCTION
or use the END statement (NEW!)  Purpose
 Terminate program immediately.
 Syntax  END [nErrorLevel&]
 
I just try to find  the best way to exit :)

Christopher Boss

  • Guest
Re: Simulated X window bar.
« Reply #1 on: August 30, 2011, 01:12:45 AM »
Robert,

Your code is EZGUI event code, not API code, so when using EZGUI you close a form like this:

EZ_UnloadForm "MyFormName"

EZGUI handles the rest. You can put such code in the %EZ_Click event for a button control if you like.


Christopher Boss

  • Guest
Re: Simulated X window bar.
« Reply #2 on: August 30, 2011, 01:15:21 AM »
You can use something like this:

Code: [Select]
SUB FORM1_XBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
               EZ_UnloadForm "{ME}"
          CASE ELSE
     END SELECT
END SUB

EZGUI 5.0 supports a new quick syntax, if the code will effect the same form as the event occurred for, which is "{ME}"

Assuming the button control is on the same form you want to close, then "{ME}" is fine.

As far as terminating the application, EZGUI automatically terminates the app when the last form is closed (or unloaded).