Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
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

72
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.
 
73
EZGUI 5 support forum / Re: Sprite Problem
« Last post by Chris Boss on December 16, 2022, 10:00:22 pm »
EZ_TestSpriteClick does not work the way you think.

The X& and Y& parameters are not return values, but are passed BYVAL telling the function where the coordinates to test are.

In the Canvas control's %EZ_Click event you have to call first:

EZ_GetCanvasXY

to get the coordinates for the last mouse click.

Then you can pass them to EZ_TestSpriteClick to see if the click occurred on a sprite.

74
EZGUI 5 support forum / Sprite Problem
« Last post by Brian Reynolds on December 16, 2022, 02:11:37 am »
I've struck a problem with Sprites. Using the following code, I get nothing for the Sprite name and a zero of each of the X& and Y&.
I am running Windows 11.

      CASE %EZ_Click
         a$ = EZ_TestSpriteClick("Form1", %Form1_Canvas1, X&, Y&)
         MSGBOX a$ +STR$(X&)+STR$(Y& )

Can you offer help?
75
EZGUI 5 support forum / Re: Strange event
« Last post by Brian Reynolds on November 18, 2022, 12:32:24 am »
I have managed to fix this and many other strange events I was experiencing.
I bought a new computer running Windows 11 -- Much faster, nothing strange.
Thanks to all who offered their support.
76
EZGUI 5 support forum / Re: DateTime control
« Last post by Chris Boss on August 27, 2022, 11:49:44 am »
The %EZ_Loading event occurs just "before" the control is created, so you can't use any commands which expect the control to exist in this event.

EZ_DefCalendarExColors

will fail in %EZ_Loading because the control does not exist yet.

The event %EZ_Loaded (ends in ed rather than ing) occurs right after the control is created, but before it is visible, so you can make calls to commands
which expect the control to exist in this event.

EZ_DefCalendarExColors should work fine in the %EZ_Loaded event !

Any command which has parameters for the form name and control ID, must be called only after the control is created and exists.

%EZ_Loading serves the purpose of changing control creation parameters for a control before it is created and for calls to EZGUI commands which have to be called before a control is create (ie. EZ_Color, EZ_UseFont).

Internally in all control creation commands it works this way:

{Control Creation Command}
  • Generate %EZ_Loading event if flagged to do so by a previous EZ_AllowLoadingEvent command
  • Modify any control creation parameters if changing in %EZ_Loading event using EZ_SetLoadStr or EZ_SetLoadVal commands
  • Create Control
  • Generate %EZ_Loaded event

By understand the sequence EZGUI uses when creating controls you will know what you can do in each of the events, %EZ_Loading and %EZ_Loaded

Forms work the same way, but also have a third event called:

%EZ_Started

which occurs after the form is created, all the controls are created and the form is now visible




77
EZGUI 5 support forum / Re: DateTime control
« Last post by Leroy Hindman on August 27, 2022, 08:20:35 am »
Chris I couldn't get even the calendar to change under the EZ_Loading event but it does change the calendar only under the EZ_Loaded event.  The EZ_DefCalendarExColors doesn't work under the EZ_Loading event either.  I know the definition of EZ_SetColor says the control has to be created before it can have the color set.  I never did get the bar where the date displays to change colors.
78
EZGUI 5 support forum / Re: DateTime control
« Last post by Chris Boss on August 26, 2022, 09:32:07 pm »
The Visual Designer does not allow you to select colors for the Date Time control.

The reason I made it that way is likely because the control does not support defining colors.

You can select the option:  "Allow %EZ_Loading Event"

and the control will get the %EZ_Loading event just before EZGUI creates the control.

You can define different colors in this event using EZ_Color, but if it does not chnage color it is because Windows Themes does not allow the control to use colors.

This may though call EZ_DefCalendarExColors in this event to set the colors for the Calendar part of the DateTime control.

EZ_SetAttr (attributes:  BColor and TColor) can be called at any time but again I believe it only sets the colors for the drop down calendar part of the DateTime control.



 
79
EZGUI 5 support forum / Re: DateTime control
« Last post by Leroy Hindman on August 26, 2022, 10:02:02 am »
If anyone know how to do this reply to me it doesn't have to be Chriss himself that answers.  I am sorry I didn't word this better and ask for everyone's help.  I would appreciate any help at all and thank you ahead.
80
EZGUI 5 support forum / DateTime control
« Last post by Leroy Hindman on August 25, 2022, 02:44:47 pm »
Dear Chriss

I am using a DateTime control on a dialog and would like to color it.  I can color the calendar that opens up by using EZ_SetColor but it does nothing to the bar where the date goes, can this part of the controls color be set and if so what must I do to set it.

Thank You
Leroy Hindman
Pages: 1 ... 6 7 [8] 9 10