Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chris Boss

Pages: [1] 2 3 4
1
EZGUI 5 support forum / Re: EZC file for Phoenix Grid
« on: February 25, 2024, 04:51:01 pm »
Appreciate the post.

Yes, the EZGUI designer supports third party controls, so feel free to post an EZC files for custom controls you may use.

I would like to point out that once a third party custom control is loaded into your app, EZGUI also allows you to subclass the control to allow it to benefit from the subclass engines features.

Use EZ_SubClassEx to subclass third party controls.


2
It amazes me how many EZGUI users continue to be very productive with it for so long.

Feel free to post any of your experiences using EZGUI here.

EZGUI currently is being used in a number of commercial applications all over the world.


3
For those interested in purchasing EZGUI 5.0 Professional, here is the link to the order page (at BMTMicro):

https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CID=727&PRODUCTID=7270033


4
Hello to all who have been using EZGUI.

I want to thank you for all your support and it has been a pleasure providing you with a product such as EZGUI 5.0 Professional.

As of this year (2023) I am now partially retired. So what does this mean for EZGUI and its future ?

(1) EZGUI 5.0 Professional is so feature rich that there really isn't any need for an update (unless a bug fix is released).
Powerbasic has yet to provide a 64 bit compiler so it makes little sense to work on a next gen version (if that changes it may be done)

(2) My website costs me money, but for now I can afford to handle the cost, so my forums will still be here

(3) I will continue to sell EZGUI 5.0 and provide support (via the forums) to all new and old customers. For how long I can't tell, but no need to stop it currently.

(4) Be aware that because of no updates to Powerbasic, third party addons have had minimal sales for years now and EZGUI is no exception.
I still do get sales, but it does not even cover my website costs.

(5) Now being semi-retired, I plan on changing my website to a hobby status, rather than purely 100% commercial. What does that mean ?
My website is now open to be used for any hobby projects I am working on, so the forums will likely reflect this before long. I no longer need to use it only
for commercial work. That means it won't be a write off for my business and I will bear the costs purely for my hobby use. This does free it up to be used for anything I have
an interest, which includes:

Embedded:
- Arduino
- ESP32
- Tibbo
- Raspberry PI
- an other SOC boards

Basic programming languages (other than Powerbasic)
- BASCOM AVR
- GreatCow Basic
- XOJO
- B4R (Basic for Arduino)

3D Printing

Hobby CNC
- Building my own CNC

Woodworking
- Designing jigs for tools, plans for projects and best of all using a Bandsaw sawmill (Frontier OS18)

see:  https://www.frontiersawmills.com/en_us/os18-sawmill-with-7hp-212cc-lifan-recoil-start-gas-engine

ART
- both my wife and I are casual artists and I can share stuff about our art and as well info about digital art.





5
Advanced EZGUI / Re: Components
« on: March 21, 2023, 02:35:11 pm »
The key to understanding what a component does is this:

If you design a form you can only use one instance of this form at a time. Each form has its own name and no two can have the same name.

A Component uses a single form design, but can create multiple instances of itself and it creates a unique name for each instance which it tracks internally.

You don't talk directly to the controls on the component. Instead it is treated as if if was a control and it is given its own unique control ID at creation.

When you talk to the component, instead of talking to its controls directly, you talk to the form itself using the available component supporting commands such as:


EZ_Clear
EZ_SetImage
EZ_SetFont
EZ_SetColor
EZ_SelectItem
EZ_SetText
EZ_SwapImage

A component tracks its own colors, font, text and bitmap/icon.

If I have a component which has an ID of 100 on a Form1 , I can tell the component to clear itself simply by calling:

EZ_Clear "Form1", 100

Now EZGUI will generate an event and send it to the component. The form event routine of the component will get the %EZ_ClearUpdated event.

Now it becomes the components responsiblity to clear itself (whatever that may mean for the form and how it was designed to work.


Now let's say a component handles text. Maybe it is a mini-Wordpad emulator and has a richtext control on it.

For a component with ID = 100 and on Form1 you could call:

EZ_SetText "Form1", 100, SomeRTFtext$

The components form level event code will get the event:

%EZ_TextUpdated

Then in this event the component can retrieve the text using the EZ_GetCmpText function.

A component can store up to 32,768  unique strings. They have an Index number.

It is up to you what indexes you want to use to store your strings.

%EZ_TextUpdated will pass an index number in CVal&.  EZ_SetText always passes a zero index (undefined). EZ_SetCmpText has a parameter to pass an index value which will be passed through the Cval& parameter for the event.

EZGUI does not use an array to store stings for a component. It stores them in a single string data type. It separates the records (each individual indexed string) using an ascii character 1 ( CHR$(1) ). So do not pass the ascii character 1 in your strings.

So if a component is not defined with a form name, what name do you use for the component itself (it is technically a form) when calling EZGUI commands which require a form name ?

The easiest way is to use the Form macro:

"{ME}"

Forms know their own name, so if a command is called within a components form events and you are calling itself, then this macro is what to use.

You can also retrieve the components actual form name by using the function:

EZ_CMPName

You pass the function the parent form of the component and the components ID number (remember it acts like a control to your app and has an ID rather than name) and you can get the internal form name for the component.








6
Advanced EZGUI / Re: Components
« on: March 21, 2023, 11:07:51 am »
Now let's look at all the commands EZGUI provides for working with components:

To define a component use:

EZ_DefComponent

In your app you can either use a source code version of a component or you can load a precompiled component DLL. To load a component from a DLL use:

EZ_LoadComponent

To add a component to a form use:

EZ_AddComponent

Component specific commands available:

EZ_GetCmpAttr
EZ_SetCmpAttr
EZ_GetComponentData
EZ_CmpName
EZ_SendMeEvent
EZ_GetCmp
EZ_GetCmpText
EZ_E
EZ_SetCmp
EZ_SetCmpText
EZ_GetCmpData
EZ_CmpFG
EZ_CmpBG
EZ_CmpFont
EZ_CmpSetData



Component Specific Events (inside components own event code):

%EZ_AttrUpdated
%EZ_TextUpdated
%EZ_BitmapUpdated
%EZ_ClearUpdated
%EZ_ColorUpdated
%EZ_IconUpdated
%EZ_FontUpdated
%EZ_SelUpdated
%EZ_CmpSet
%EZ_CmpGet

Normal EZGUI commands that support components:

EZ_ResetAutoSize
EZ_GetCListClass
EZ_GetClass
EZ_GetGUIStats
EZ_Clear
EZ_SetImage
EZ_SetFont
EZ_SetColor
EZ_SelectItem
EZ_SetText
EZ_UseAutoSize
EZ_SwapImage

Two commands which can NOT be used with a component (the component itself, not the child controls of a component in the component code):

EZ_SetUserString
EZ_GetUserString





7
Advanced EZGUI / Components
« on: March 21, 2023, 10:47:08 am »
The EZGUI docs don't go into detail about creating and using components. This post is where I will try to explain it better. I will give an brief overview and then over time add more to this discussion.

What is a component ?

A component is like a page form (which can be put on a normal form) which acts like a single control. You can put any child controls on the component and make it do some repeatable task, but to your app it will act like a single control.

You can create a component once and use it over and over again on different forms. 

You do not create a component like you do a normal form, even though technically it is a form with child controls. There are special commands for defining a component and even processing its events and also sending events from the component to your app (remember it appears to your app as a single complex custom control).

The designer needs a component to be compiled to a DLL so you can use it there when visually designing your app. But a component in your app can be accessed either in its compiled form (DLL) or as source code (designer will generate the path to the source code if you desire rather than load a DLL when it generates your source code).

Components are a bit complex at first glance and is an advanced feature. But once you start learning how to use them it really is not that difficult.

Let's look at some source code for a component that comes with EZGUI (Canvas Scroller):

Code: [Select]
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================

DECLARE SUB EZ_CSCROLLER_InitComponent(BYVAL CMPPrefix$)
DECLARE SUB EZ_CSCROLLER_Design()
DECLARE SUB EZ_CSCROLLER_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB CSCROLLER_Events(CID&, CMsg&, CVal&, Cancel&)
' ------------------------------------------------

%CSCROLLER_MYPICTURE          = 100

'<<BEGINFORM>> "CSCROLLER"

' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================

SUB EZ_CSCROLLER_InitComponent(BYVAL CMPPrefix$)     ' (PROTECTED)
     EZ_DefComponent CMPPrefix$+"CSCROLLER", "SVBK||CSCROLLER.bas", CODEPTR(EZ_CSCROLLER_Design), CODEPTR(EZ_CSCROLLER_ParseEvents)
END SUB

SUB EZ_CSCROLLER_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_UseAutoSize "CT"
     EZ_Picture %CSCROLLER_MYPICTURE, 0, 0, 6, 3, "SAMPLEBMP", ""
     ' -----------------------------------------------
END SUB


SUB EZ_CSCROLLER_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               CSCROLLER_Events CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               CSCROLLER_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB

' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'<<SAVE>>
SUB CS_ShowPicture(BYVAL P$)
     LOCAL W&, H&, CW&, CH&, FW!, FH!, SW&, SH&, SF$, X&, Y&, XDif&, YDif&, VScroll&, HScroll&, EW&, EH&
     EZ_HideC "{ME}",%CSCROLLER_MYPICTURE,%CSCROLLER_MYPICTURE
     IF P$="" THEN
          EZ_HideFormScrollBars "{ME}", "B"
          EXIT SUB
     END IF
     IF EZ_ImageHandle(P$)<>0 THEN
          EZ_GetPictureSize P$, W&, H&
          EZ_HideFormScrollBars "{ME}", "B"
          EZ_GetSize "{ME}",FW!, FH!, 2
          VScroll&=0
          HScroll&=0
          CW&=FW!
          CH&=FH!
          SW&=EZ_WO("SW")
          SH&=EZ_WO("SH")
          SF$=""

          IF W&<=CW& AND H&<=CH& THEN
               ' no scrollbars
               X&=(CW&-W&)\2
               Y&=(CH&-H&)\2
          ELSE
               EW&=0
               EH&=0
               IF W&>CW& THEN EH&=SH&
               IF H&>CH& THEN EW&=SW&
               IF W&>(CW&-EW&) THEN
                    X&=0
                    SF$=SF$+"H"
                    HScroll&=W&-(CW&-EW&)
               ELSE
                    X&=((CW&-EW&)-W&)/2
               END IF
               IF H&>(CH&-EH&) THEN
                    Y&=0
                    SF$=SF$+"V"
                    VScroll&=H&-(CH&-EH&)
               ELSE
                    Y&=((CH&-EH&)-H&)/2
               END IF
          END IF
          IF X&<0 THEN X&=0
          IF Y&<0 THEN Y&=0
          EZ_ResizeC "{ME}",%CSCROLLER_MYPICTURE, EZ_CX(X&),EZ_CY(Y&), EZ_CX(W&),EZ_CY(H&)
          EZ_SetImage "{ME}",%CSCROLLER_MYPICTURE, P$
          EZ_ShowFormScrollBars "{ME}", SF$
          EZ_ShowC "{ME}",%CSCROLLER_MYPICTURE,%CSCROLLER_MYPICTURE
          IF INSTR(SF$,"H") THEN
'               EZ_SetHScroll "{ME}",0, 0, HScroll&, 0,(HScroll&\10)+1
               EZ_SetHScroll "{ME}",0, 0, HScroll&, 0,1
          END IF
          IF INSTR(SF$,"V") THEN
'               EZ_SetVScroll "{ME}",0, 0, VScroll&, 0,(VScroll&\10)+1
               EZ_SetVScroll "{ME}",0, 0, VScroll&, 0,1
          END IF
     END IF
END SUB

SUB ScrollMe(BYVAL SMode&, BYVAL CVal&)
     LOCAL C!, R!, W!, H!
     EZ_GetSizeC "{ME}",%CSCROLLER_MYPICTURE,C!, R!, W!, H!
     IF SMode&=-1 THEN
          R!=0-EZ_CY(CVal&)
     ELSE
          C!=0-EZ_CX(CVal&)
     END IF
     EZ_ResizeC "{ME}",%CSCROLLER_MYPICTURE,C!, R!, W!, H!
END SUB

SUB FreeMyStartBitmap()
     LOCAL P$
     P$=EZ_GetCmpText("{ME}",0,1)
     IF P$<>"" THEN
          EZ_FreeImage P$
          EZ_SetCmpText "{ME}",0,"", 1
     END IF
END SUB
'<<END>>

SUB CSCROLLER_Events(CID&, CMsg&, CVal&, Cancel&)
     LOCAL P$
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loading
                    CASE %EZ_Loaded
                         EZ_HideFormScrollBars "{ME}", "B"
                         EZ_HideC "{ME}", %CSCROLLER_MYPICTURE, %CSCROLLER_MYPICTURE
                         P$=EZ_GetText("{ME}",0)
                         EZ_SetText "{ME}",0,""
                         IF P$<>"" THEN
                              IF UCASE$(RIGHT$(P$,4))=".BMP" THEN
                                   P$=EZ_LoadPicture(P$)
                                   IF P$<>"" THEN
                                        CS_ShowPicture P$
                                        EZ_SetCmpText "{ME}",0,P$,1
                                   END IF
                              ELSE ' assume it is a Picture string
                                   CS_ShowPicture P$
                              END IF
                         END IF
                    CASE %EZ_TextUpdated
                         SELECT CASE CVal&
                              CASE 1
                              CASE ELSE
                         END SELECT
                    CASE %EZ_BitmapUpdated
                         FreeMyStartBitmap
                         P$=EZ_GetBitmapName(CVal&)
                         CS_ShowPicture P$
                    CASE %EZ_ColorUpdated
                         LOCAL FG&, BG&
                         FG&=EZ_GetCmpAttr("{ME}",0,1)
                         BG&=CVal&
                         EZ_SetColor "{ME}",0, FG&, BG&
                    CASE %EZ_FontUpdated
                    CASE %EZ_SelUpdated
                    CASE %EZ_ClearUpdated
                         CS_ShowPicture ""
                    CASE %EZ_FreeNow
                         FreeMyStartBitmap
                    CASE %EZ_Started
                    CASE %EZ_Close
                    CASE ELSE
               END SELECT
          CASE -1        ' Vertical scrollbar
               IF CMsg&=%EZ_Change THEN
                    ScrollMe -1, CVal&
               END IF
          CASE -2        ' Horizontal scrollbar
               IF CMsg&=%EZ_Change THEN
                    ScrollMe -2, CVal&
               END IF
          CASE ELSE
     END SELECT
END SUB


The designer generates a subroutine for adding the component to one of your forms:

SUB EZ_CSCROLLER_InitComponent(BYVAL CMPPrefix$)


In this routine is a call to EZ_DefComponent:

     EZ_DefComponent CMPPrefix$+"CSCROLLER", "SVBK||CSCROLLER.bas", CODEPTR(EZ_CSCROLLER_Design), CODEPTR(EZ_CSCROLLER_ParseEvents)

What is not provided is a example of how to put your components into a DLL.  You can put more than one component in a DLL to create a library of compoments. Once compiled to a DLL the DLL and the source code for the components should be put in the EZGUI Designers component folder.

Here is an example of a component DLL:

Code: [Select]
#COMPILE DLL "cmplib1.dll"
#INCLUDE "C:\ezgui45beta\includes\ezgui50.inc"

FUNCTION LIBMAIN (BYVAL hInst&, BYVAL FReason&, BYVAL lpR&) AS LONG
     SELECT CASE FReason&
          CASE 0      ' %DLL_PROCESS_DETACH
          CASE 1      ' %DLL_PROCESS_ATTACH
          CASE 2      ' %DLL_THREAD_ATTACH
          CASE 3      ' %DLL_THREAD_DETACH
          CASE ELSE
     END SELECT
     FUNCTION=1
END FUNCTION

#INCLUDE "C:\ezgui45beta\projects\real components\Form_pgscroller\pgscroller.bas"    ' Component include file!
#INCLUDE "C:\ezgui45beta\projects\real components\Form_cscroller\cscroller.bas"    ' Component include file!

SUB EZ_InitComponent(BYVAL CMPPrefix$) EXPORT
     EZ_PGSCROLLER_InitComponent CMPPrefix$
     EZ_CSCROLLER_InitComponent CMPPrefix$
END SUB

The two components that come with EZGUI are in separate files and must be included in this DLL code file and this is how I created the component DLL that comes with EZGUI.

A component needs an entrance function and that is predefined by EZGUI and always is:

SUB EZ_InitComponent(BYVAL CMPPrefix$) EXPORT

The function must be exported to EZGUI (and the designer) can find it the function. The function is found by polling the DLL for it by name and then it is called dnyamically (no Declare required).


8
EZGUI 5 support forum / Re: ListView Scrollbar messages
« on: March 16, 2023, 11:03:47 am »
If you select the %EZ_Subclass event for a control in the designer (or use EZ_Subclass command in hand written code) you can subclass a control and it will now get the %EZ_Subclass event.

There are a number of support commands which make working with %EZ_Subclass event easier such as:

EZ_SubClassDefault
EZ_GetSubClass
EZ_SetSubClassRVal

EZGUI actually subclasses all new controls (to provide some features not normally available), but each control has a subclass mode it is in and this determine what events get through.

EZGUI has multiple subclass modes internally, including the Visual Designer mode ( enables drag and drop and resizing of controls with the mouse).



9
This is just an idea, but just wanted to "bounce" this off my customers to see what you think about it.

What would you think of EZGUI becoming a FREE product ?

Not open source though. One could register to get EZGUI for FREE and use it for FREE.

There would still be a software license and it would still be a proprietary product (not open source, since I think that would ruin it).

Support would be via the online forums.  I would do my best to answer questions, but of course with it as free I would have limits of how much I can do on the forums. It would have to assisted via the peer to peer forum. I am planning of trying to get some of the lost data (when I upgraded the forum software) back into the forum as a resource as well, but that will take some time.

"Extended" support though could be purchased (for a very reasonable fee) so one could get more extensive support. Any customers who purchased EZGUI already would continue to get priority for support as I have done in the past.

What good would this accomplish ?

Two things are needed for EZGUI to have a better future:

(1) It needs to support programming languages other than Powerbasic

(2) It needs to eventually become 64 bit as well

I can't do this with the limited current customer base. Powerbasic (as a company) while still viable, does not yield the regular new potential customers it did in the past. Also in Powerbasics last few  better years (when Bob Zale) was still alive, I had to compete with other third party products (which most have moved on now though) which made it a greater challenge to keep the new customer base increasing.

Lastly, 32 bit still has a few good years left to it, but eventually 64 bit may make 32 bit totally obsolete. While 32 bit still is viable and has a market, now would be the best time to change my marketing model.

My goals:

(1) Port EZGUI (mostly make modifications) so it is more friendly to other programming languages such as FreeBasic, PureBasic and expecially C.

C is important and could be a great market for EZGUI. There are actually many C programmers out there who shy away from C++ and also from dot.net. C still can produce amazingly fast and tiny apps.  But the programming mainstream has moved to dot.net mostly for GUI stuff so C is a second class citizen in the GUI world.

EZGUI could be a boon for C programmers, as well as for those who use other dialecs of Basic.

I am also not averse to licensing the actual source code to EZGUI for larger companies, so far I have only done this for one company at the moment, but it could be part of the extended support. Licensing the source code is not cheap though and is best suited for large companies where it makes sense. The current price for licensing the source code is in the $5000 range.

So what do you think of this possible new model for  EZGUI ?

What would be a reasonable price for extended support say for a yearly price ?

For those who can't afford much, especially for the hobby programmer market, it is still a deal since EZGUI would be free up front and one could still get decent support via the forums for free.

10
EZGUI 5 support forum / Re: No StatusBar
« on: January 13, 2023, 10:38:30 pm »
The best way to diagnose the problem is to create a simple test app with just a form and the statusbar and maybe a few controls on it and see if the statusbar works as expected.

If it works on the test app then it may indicate that you are doing something different in your real app which causes the statusbar to have a problem.


Maybe some code is being executed before or shortly after the statusbar creation which causes a problem.


11
EZGUI 5 support forum / Re: No StatusBar
« on: January 13, 2023, 05:08:51 pm »
What Form properties are you using ?

Different form properties could have an effect in Windows 11 if they changed  something.

Also note that the designer does not generate the "panes" for the status bar for you. You have to add them using the EZ_SetSBParts command. It may be possible that if no panes (parts) are defined the Statusbar may not be visible on Windows 11.

Each version of Windows changes how some controls look and Windows 11 may simply change the look of the Statusbar when no panes (parts) are defined yet.

It is all about the Themes that each version of Windows uses and how it makes a specific control class look and appear.

A good example of this is the ProgressBar control. Older versions of Windows allowed the progress bar to have different colors, while later versions theme the control to only use a fixed set of colors and also make it appear 3D rather than flat.

I haven't tested the Statusbar control with different versions of Windows to see if it appears differently.


12
EZGUI 5 support forum / Re: Moving Sprites
« on: December 24, 2022, 09:39:35 pm »
One thing I have learned from experience is that often the problem not what we initially think.

It may be possible that earlier code being executed causes a problem in later lines of code, but all we see is where the problem 'appears" to be.

This is why it is helpful to post larger blocks of code so I can see the "big picture"

Also it is helpful at times to try to recreate the problem in a simple test program with only the core task you are attempting. Such recreations often show up whether there really is a bug (ie. say in EZGUI) or whether we are possibly doing something wrong in our actual app.

You might want to try a simple test app with just the bare minimum to demonstrate your problem. Then post the entire test app here and we can discuss it in detail.


13
EZGUI 5 support forum / Re: Moving Sprites
« on: December 22, 2022, 09:42:09 am »
The Canvas control does not respond to key presses.

You may want to preprocess the keyboard events before they get sent to other controls.

I would venture to say your problem may be more associated with how you handle the keyboard events rather than actually moving the sprite.


14
EZGUI 5 support forum / Re: Moving Sprites
« on: December 22, 2022, 09:36:27 am »
The EZ_MoseSP command works well but you have to have the sprite index rather than a name.
use the EZ_GetFastSPIndex function to get the sprite index.

Code: [Select]
     FOR I&=1 TO 10
          ' move each sprite 8 pixels in both directions
          EZ_MoveSP SpriteIndex&(I&), 8, 8, 1
     NEXT I&

15
EZGUI 5 support forum / Re: Sprite Problem
« on: December 19, 2022, 12:54:42 pm »
EZ_TestSpriteClick does not actually test for an actual click. It simply is passed the coordinates of the last click and it just calculates from that position which sprite the coordinates are on.

You have to get the actual mouse click position for the canvas control first, which is done using the EZ_GetCanvasXY command which you can call in the Canvas controls %EZ_Click event.

EZGUI stores the last X, Y position when the left mouse button is pressed down. It generates the %EZ_Click event so you can process it there.

Now let's say you want to drag a sprite around, you can subclass the Canvas control and then in the %EZ_LButtonDown event get the X,Y position of the mouse and then call EZ_TestSpriteClick and then start a drag process to draw the sprite around.

You can use EZ_GetMouseXY instead of EZ_GetCanvasXY when processing it in the %EZ_LButtonDown event.

Here is some old EZGUI 4.0 code (should work) where I drag a sprite around by processing the %EZ_LButtonDown event and using EZ_TestSpriteClick to figure out which sprite needs to be dragged:

Code: [Select]
UB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
    LOCAL X&, Y&, SX&, SY&
    STATIC SPN$
    SELECT CASE CID&
        CASE %EZ_Window
            IF CMsg&=%EZ_Started THEN
                MakeSprites
            END IF
        CASE  %FORM1_CANVAS1
            IF CMsg&=%EZ_SelectCursor THEN
                IF App_MoveFlag&=0 THEN
                    SPN$ = EZ_TestSpriteClick ("Form1", %FORM1_CANVAS1, App_MouseX&, App_MouseY&)
                    IF SPN$<>"" THEN
                        EZ_SetCursor "", 4
                        Cancel&=1
                    END IF
                END IF
            END IF
            IF CMsg&=%EZ_LButtonDown THEN
                EZ_GetMouseXY CVal&, X&, Y&
                SPN$ = EZ_TestSpriteClick ("Form1", %FORM1_CANVAS1, X&, Y&)
                IF SPN$<>"" THEN
                    IF EZ_GetSpriteXY (SPN$, SX&, SY&) THEN
                        EZ_SetCaptureEx EZ_Handle("Form1", %FORM1_CANVAS1)
                        EZ_SetCursor "", 1
                        App_MoveFlag&=1
                        App_OffsetX&=X&-SX&
                        App_OffsetY&=Y&-SY&
                    END IF
                END IF
            END IF
            IF CMsg&=%EZ_MouseMove THEN
                EZ_GetMouseXY CVal&, X&, Y&
                App_MouseX&=X&
                App_MouseY&=Y&
                IF App_MoveFlag& THEN
                    EZ_MoveSprites SPN$, X&-App_OffsetX&, Y&-App_OffsetY&, 0
                    EZ_UpdateClient "Form1", %FORM1_CANVAS1
                END IF
            END IF
            IF CMsg&=%EZ_LButtonUp THEN
                App_MoveFlag&=0
                EZ_SetCaptureEx 0
            END IF
        CASE ELSE
    END SELECT
END SUB             

Notice when dragging a sprite you need to capture the mouse once you process the %EZ_LButtonDown event. 


Pages: [1] 2 3 4