News: TO REGISTER on Forum, contact tech support: http://cwsof.com/support.html
 
Pages: [1]   Go Down
  Print  
Author Topic: Property Listbox in 5.0 is different !  (Read 1209 times)
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« on: April 04, 2011, 06:59:35 PM »

There is a major change in the Property Listbox control in EZGUI 5.0 which is very important to point out.

This change also effects the Visual Designer, because it uses the Property Listbox control in multiple places (ie. Project Property Dialog and the Fast Properties Listbox on project palette window).

When an item in a Property Listbox is a Text field property, rather than a drop down list or button, when you type new text in the control, in the old version the property was updated for every character you typed.

In 5.0, is no longer updates the text as it changes. It will only update the text after you press the Enter (return) key.
EZGUI 5.0 requires that you "validate" the text change, by pressing Enter.

Why the change ?

When I added a Property List for the fast property listbox in the Project Palette window, I found that the standard drag and drop designers always require you press enter to validate the text change. For example if you changed the width property of a control and it changed the control for every character change, it would be a mess.

To match the standard way Project Property Listboxes work, I changed EZGUI 5.0 so you have to validate the text change, by pressing enter.

You will quickly notice the change, when you start editing project properties, such as the customer ID or Registration code in the designer.
You edit it and it does not get remembered.

Why ?

Because you failed to press the Enter key.

So now when using the Designer and when you use the Property Listbox contorl in your apps, remember that text fields require you press Enter to validate the change.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« Reply #1 on: April 04, 2011, 07:30:28 PM »

To appreciate why this change was necessary, let's look at the Designer and its use of a Property Listbox control for the new "Fast Properties" feature:



Now consider the four properties:

Left
Top
Width
Height

Imagine what would happen if the Property Listbox worked like it did in EZGUI 4.0 !

If it changed the property, every time you typed a character, imagine if you accidently typed 10000 for the width.
The control would automatically be resized to a huge size.

If you backspaced to delete the number, before typing in the new value, you could end up with a size of zero.

Rather than have the Property Listbox control update the properties value (for text field properties) when a character is typed,
instead now you have to "verify" the property text has changed by pressing the Enter key.

This is how other Visual Designers work as well.



Logged
Steve Pardoe
Newbie
*
Posts: 7


View Profile
« Reply #2 on: May 23, 2012, 05:38:40 AM »

Chris,

Thought this was about the best place to bring an issue up as any as:

a. I am a beginner of EZG, and,
b. This post is in the beginner forum and about my 'issue' - the property list box.

I have had a look around and I have not found my issue discussed / addressed. If that is incorrect then by all means let me know.

I have noticed two things about the property list box:

1. When the item selection is a file and the user presses the button to launch the common dialog and DOES NOT MOVE the dialog in any way and then either selects a file or presses cancel - the area at the bottom of the control that is visible but not 'part of an item row' is fine. But when they move the dialog box, then either cancel or select a file, this area (beneath the bottom of the last row item) is not returned to the control's set back colour. Screenshot attached for your reference.

2. When I select a file and the file selection dialog closes, the file name is populated in the relevant list box row. All good. If I subsequently press the button of that same row to bring up the file selection dialog again and this time press CANCEL, then my prior selection is replaced with the default that was set in the visual designer.

Any comments / work-arounds and/or education greatly appreciated !  Grin

Steve.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« Reply #3 on: May 23, 2012, 06:44:08 AM »

Steve, a simple sample app would be helpful. You can send me code which demonstrates your problem.

I'll look into it.

One thing which does come to mind, is are you using the K property for the parent form ?

K adds clipping which effects how the form is redrawn when repainted.

Logged
Steve Pardoe
Newbie
*
Posts: 7


View Profile
« Reply #4 on: May 23, 2012, 03:41:30 PM »

Chris,

Thanks, the clipping sorted one issue out. I still find that term confusing  Huh

In relation to a test app, please see below:

Code:
' *************************************************************************************
'                    Code Generated by EZGUI Professional Visual Designer 5.0
'           Portions: Copyright Christopher R. Boss, 2003 to 2011 All Rights Reserved !
'              Registered EZGUI 5.0 users may use generated code Royalty Free !
' *************************************************************************************
'
' -----------------------------------------------------------------------------------------
'            WARNING !    Do Not Modify any code WITHIN Protected Sections !
' You can add code (Sub,Function,etc.) BEFORE any Protected Routine by using the following
' CODE TAGS:        '<<SAVE>>      '<<END>>            and the Designer will not remove it.
' -----------------------------------------------------------------------------------------
'

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


'
#COMPILE EXE
#DIM ALL        '   This is helpful to prevent errors in coding
' --------------------
#INCLUDE "C:\ezgui50pro\includes\ezgui50.inc"                          ' EZGUI Include file for Declares
' --------------------
' *************************************************************************************


' *************************************************************************************
'                   Code Generator Defined Constants and Declares
' *************************************************************************************
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB OtherForm_Design(FormName$)
DECLARE FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
DECLARE SUB EZ_FORM1_Display(BYVAL FParent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
' ------------------------------------------------

%FORM1_LABEL2             = 100
%FORM1_LABEL1             = 105
%FORM1_LABEL3             = 110
%FORM1_BUTTON1            = 115
%FORM1_BUTTON2            = 120
%FORM1_PLISTBOX1          = 125

DECLARE SUB FORM1_BUTTON1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON2_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_PLISTBOX1_Events(MyID&, CMsg&, CVal&, Cancel&)



' *************************************************************************************
'                 Code Generator Defined Global Variables and Types
' *************************************************************************************



'    Note:     Do NOT change the names of the EZGUI Callback Procedures !

' --------------------
#INCLUDE "C:\ezgui50pro\includes\ezwmain50.inc"                          ' EZGUI Include file for WinMain
' --------------------



' *************************************************************************************
'                       User Defined Global Variables and Types
'         (Put code in CODE TAGS! to protect from deletion by Code Generator !)
' *************************************************************************************

SUB EZ_Main(VerNum&)     ' (PROTECTED)
     EZ_DefImageFolder "Graphics"
     EZ_AllowCommandEvents  0
     EZ_DefFont 6, "Arial", 10, "V"
     EZ_DefFont 7, "Courier New", 10, "F"
     EZ_DefFont 8, "Times New Roman", 10, "V"
     EZ_DefFont 9, "Modern", 10, "V"
     EZ_DefSystemColor 32, 4
     EZ_DefSystemColor 33, 5
     EZ_DefSystemColor 34, 15
     EZ_DefSystemColor 35, 24
     EZ_DefColorL 36, &H00B96FFF
     EZ_DefColorL 37, &H0014AB9F
     EZ_DefColorL 38, &H0047A7FF
     EZ_DefColorL 39, &H00D2AACF
     EZ_DefColorL 40, &H001CD5E3
     EZ_DefColorL 41, &H00BC8943
     EZ_DefColorL 42, &H006C6AB7
     EZ_DefColorL 43, &H00DD4489
     IF Main_Initialize(VerNum&) THEN
          EZ_FORM1_Display ""
     END IF
END SUB

' -------------------------------------------------------------------------------------

SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_Design
          CASE ELSE
               OtherForm_Design FormName$
     END SELECT
END SUB

' -------------------------------------------------------------------------------------

SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     IF PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) THEN EXIT SUB
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               OtherForm_Events FormName$, CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB

' -------------------------------------------------------------------------------------






' *************************************************************************************
'                                Applications FORM Code
' *************************************************************************************


' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================


FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
     LOCAL RV&
     RV&=1
     FUNCTION=RV&
END FUNCTION

SUB OtherForm_Design(FormName$)
     SELECT CASE FormName$
          CASE ELSE
     END SELECT
END SUB

SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE FormName$
          CASE "{OPENDLG}", "{SAVEDLG}", "{OPENDLGX}", "{SAVEDLGX}", "{COLORDLG}", "{FONTDLG}", "{PRINTDLG}", "{PAGEDLG}", "{FINDDLG}"
          CASE "{ABORTDLG}"
          CASE "{MSGBOX}"
          CASE "{APP}"      ' Not a Form
               SELECT CASE CMsg&
                    CASE %EZ_NoTheme
                    CASE %EZ_Terminate
               END SELECT
          CASE ELSE
     END SELECT
END SUB

FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
     LOCAL RV&
     RV&=0
     FUNCTION=RV&
END FUNCTION


'<<BEGINFORM>> "FORM1"


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

SUB EZ_FORM1_Display(BYVAL FParent$)     ' (PROTECTED)
     EZ_Color 0, 7
     EZ_Form "FORM1", FParent$, "My Dialog", 0, 0, 40, 25, "CKRZ"
END SUB

SUB EZ_FORM1_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color 14, 15
     EZ_UseIFont "Tahoma", 14,"BV"
     EZ_Label %FORM1_LABEL2, 2, 1, 34, 2, "Information", "IL"
     ' -----------------------------------------------
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_UseAutoSize "FL,FR"
     EZ_Label %FORM1_LABEL1, 0, 0, 40, 4, "[[0,15,0]]", "CO"
     ' -----------------------------------------------
     EZ_Color-1,-1
     EZ_UseIFont "Tahoma", 10,"L+V"
     EZ_UseAutoSize "FL,FR,VH"
     EZ_Label %FORM1_LABEL3, 1, 5, 38, 3, "Text Text Text Text Text Text Text Text Text Text Text Text Text TextText Text Text Text Text Text Text Text Text Text Text Text", "IL"
     ' -----------------------------------------------
     EZ_Color 15, 8
     EZ_UseIFont "Tahoma", 14,"BV"
     EZ_ODButton %FORM1_BUTTON1, 3.5, 21, 11, 3, "OK", "2T"
     ' -----------------------------------------------
     EZ_Color 15, 8
     EZ_UseIFont "Tahoma", 14,"BV"
     EZ_UseAutoSize "FR"
     EZ_ODButton %FORM1_BUTTON2, 25, 21, 11, 3, "XC", "2T"
     ' -----------------------------------------------
     EZ_Color 0, 15
     EZ_UseFont 4
     EZ_SetNextNoClip
     EZ_UseAutoSize "FL,FR"
     CText$ = "Trading|Order Pending Sound{F}(None)[WAV Files; *.wav]|Order Filled Sound{F}(None)[WAV Files; *.wav]|Order Cancelled Sound{F}(No"_
            + "ne)[WAV Files; *.wav]|Chart Frame Rate (per s){D}10[10;15;20]|Communications|Trade Servers{D}CQG[CQG;Interactive Brokers]|Server"_
            + " String{T}|PING Rate (s){D}30[10;15;30;60;120]|Assistant|Assistant{F}(None)[DLL Files; *.dll]|Database|Data Record Bundle{D}150["_
            + "75;100;150;250;500]"
     EZ_PListBox %FORM1_PLISTBOX1, 1, 9, 38, 11, CText$, "TV"
     ' -----------------------------------------------
END SUB


SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LABEL1
               IF CMsg&=%EZ_OwnerDraw THEN
                    EZ_DrawLabel CVal&,-1, -1,  "[[0,15,0]]"
               END IF
          CASE  %FORM1_BUTTON1
               FORM1_BUTTON1_Events CID&, CMsg&, CVal&, Cancel&
               IF CMsg&=%EZ_OwnerDraw THEN
                    EZ_DrawColorButton "Form1", %FORM1_BUTTON1, CVal&, 8, 15,  EZ_ODIFont
               END IF
          CASE  %FORM1_BUTTON2
               FORM1_BUTTON2_Events CID&, CMsg&, CVal&, Cancel&
               IF CMsg&=%EZ_OwnerDraw THEN
                    EZ_DrawColorButton "Form1", %FORM1_BUTTON2, CVal&, 8, 15,  EZ_ODIFont
               END IF
          CASE  %FORM1_PLISTBOX1
               FORM1_PLISTBOX1_Events CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB

' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================

SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loading
                    CASE %EZ_Loaded
                    CASE %EZ_Started
                    CASE %EZ_Close
                    CASE ELSE
               END SELECT
          CASE ELSE
     END SELECT
END SUB

SUB FORM1_BUTTON1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB

SUB FORM1_BUTTON2_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB

SUB FORM1_PLISTBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE ELSE
     END SELECT
END SUB


Also, I have noticed that if the prop box is resized by virtue of having its rules set and you have previously clicked on a file row item and already have the  button displayed, the button stays in the same location as the control is resized. Attached pic below.

Thanks in advance,

Steve
« Last Edit: May 23, 2012, 06:54:12 PM by Chris Boss » Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« Reply #5 on: May 23, 2012, 06:55:57 PM »

Now that may be a bug and will have to be addressed in the update I am working on.

The property listbox stores the position of the button, but when resize it fails to change this.

Need to check my code.

Logged
Steve Pardoe
Newbie
*
Posts: 7


View Profile
« Reply #6 on: May 23, 2012, 07:24:57 PM »

Ok thanks Chris. So it is that and the selection issue mentioned above (where a second selection attempt, when cancelled, deletes the first file requested - if that makes sense !?).

Also, whilst I am on the subject of the PListBox, could we look into having the section headers backcolour available as a standard control property ?

Think that that's it for now  Smiley

Regards,

Steve.

Logged
Pages: [1]   Go Up
  Print  
 
Jump to: