Recent Posts

Pages: 1 2 [3] 4 5 ... 9
21
EZGUI 5 support forum / Re: No StatusBar
« Last post by Chris Boss 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.

22
EZGUI 5 support forum / No StatusBar
« Last post by Brian Reynolds on January 13, 2023, 12:48:16 am »
For the first time since using Windows 11 I have uses a StatusBar in the Designer.
It appears in the code when compiled but does not appear on the screen when the code is run.
Has this been experienced by anyone?
23
EZGUI 5 support forum / Re: Moving Sprites
« Last post by Chris Boss 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.

24
EZGUI 5 support forum / Re: Moving Sprites
« Last post by Brian Reynolds on December 23, 2022, 08:56:37 pm »
I apologise for posting this absurd question on something I have done many times some years ago and had simply forgotten.

I do, however, have a real problem with moving Sprites as I don't seem to be able to use IF ---- THEN before moving a sprite. This code doesn't work but if I REM out the IF THEN and END IF  lines it works okay. The trouble is, that without the IF ---- THEN it will also move other sprites.

Code: [Select]
         IF Sname$="LeftSP" OR Sname$="RiteSP" THEN
            EZ_MoveSprites Sname$, -1, 0, 1  ' Move Left
         END IF

I have also tried moving the code to a subroutine but it still doesn't work with the IF ---- THEN but works without it.

Any suggestions?

25
EZGUI 5 support forum / Re: Moving Sprites
« Last post by Chris Boss 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.

26
EZGUI 5 support forum / Re: Moving Sprites
« Last post by Chris Boss 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&
27
EZGUI 5 support forum / Moving Sprites
« Last post by Brian Reynolds on December 22, 2022, 02:16:19 am »
I am trying to move a sprite continuously by holding down one of the four Arrow keys but I can only get the sprite to move one pixel at a time.
Could someone offer a suggestion on how to do it.
I'm sure I did this a few years ago but my memory loss keeps increasing with my age.
Brian Reynolds.
28
EZGUI 5 support forum / Re: Sprite Problem
« Last post by Chris Boss 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. 

29
EZGUI 5 support forum / Re: Sprite Problem
« Last post by Chris Boss on December 19, 2022, 12:30:39 pm »
No, you can get a sprite click. It is demonstrated in the sprite example in the codeclips folder.

Here is the code from that sample app:

Code: [Select]
SUB FORM1_CANVAS1_Click()
     LOCAL X&,Y&
     EZ_GetCanvasXY  "{ME}",  %FORM1_CANVAS1, X&, Y&, 0,0
     MSGBOX "You clicked me:"+STR$(X&)+STR$(Y&)+" "+EZ_TestSpriteClick("{ME}", %FORM1_CANVAS1, X&,Y&)
END SUB

30
EZGUI 5 support forum / Re: Sprite Problem
« Last post by Brian Reynolds on December 17, 2022, 02:18:43 am »
Thank you for your explanation, Chris.
From that as well as reading other "GetSprite" info, I take it there is no way of clicking on a Sprite and retrieving its name or X or Y position.
 
Pages: 1 2 [3] 4 5 ... 9