Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Advanced EZGUI / Re: Number Component
« Last post by Chris Boss on July 17, 2024, 02:33:22 pm »
Just for your info, EZGUI has a masked edit control which can do this.

From the Help file under the EZ_Text command:


Masked Edit Features


            EZGUI converts the standard Text (Edit) control to a Masked Edit control if you define a Mask in the CProp$ parameter (after the properties).  The Mask is a set of characters between { }   characters (curly brackets). For example, a Mask for a telephone number would be:


            "{(999)999-9999}"


            The Mask must be added to the CProp$ (properties) parameter after the standard properties are listed  ( ie.   "ESTG({999)-999-9999}" )


            The Text field will also be set to a maximum length based on the length of the Mask. The Mask characters are defined below.


Standard Mask Characters:


      X - Any Character
      A - Alpha Character only and Space
      U - Alpha Character only and Space. Converted to Upper case !
      9 - Digits only (0 to 9)
      # - Digits (0 to 9) and space, +, -  and period
      N - AlphaNumeric and Space
      L - Logical (Y/N or T/F)
      Y - Logical (Y/N)
      T - Logocal (T/F)
      P - PlaceHolder when not using E property (means Read Only)


            Examples of Standard Masks:


     (999)999-9999 - Telephone number
     XXXXXXXXXX    -        Any text
     AAAAAAAAAA    - Alpha only
     UUUUUUUUU     - Uppercase only
     UUU-9999999   - Part number
     99/99/9999    - Date




            All other non-mask characters will be used "as is". They are frozen and can't be edited. If the Text Control is multiline, the Mask property is ignored. If the Text Control is readonly (does not have E (edit) property), then all mask characters are converted to P (Placeholder) mask character.


Calculator Mode Mask Characters:


      +  - This mask allows a Space (for Plus) or a minus sign ( - )
           and is used only in the first character position of a
           calculator mode mask.
      #  - Floating Point Mask
           (you can use a fixed decimal with this mask)
      %  - Whole Number Mask
      $_ - When a Dollar sign and a space are put to the
           left of a Calculator mode mask, then a $ and
           space will appear to the left in the textbox.


              ie. "$ ###.##"


      _% - When a space and % character are put at the
           end of a Calculator mode mask, then a space
           and % character will appear in the textbox at
           the far right.


              ie. "{##.## %}"


            Examples of Calculator mode masks:


     %%%%%%   - Whole number (positive only)
     +%%%%%   - Whole number (positive or negative)
     ######## - Floating Point number (positive only)
     +####### - Floating Point number (positive or negative)
     #####.## - Floating Point number
                (positive and fixed decimal)
     +####.## - Floating Point
                (positive or negative and fixed decimal)


     $ ###.## - Floating Point with $ (and space) to left
     ###.## % - Floating Point with (space and ) % to right


            When using a Calculator Mode Mask the Text control will allow entry of a real number and the characters will display Right to Left, like a calculator does. You can also add a + sign as the first character to allow plus or minus values (  ie. {+####} ). Also you can add just one decimal point (  ie. {+###.###} ). Using this format, you can mask Integers and real Numbers (with decimal).


            Caret Position !


            By default the Mask Edit control will set the caret position at the first character when the control gets the Focus. If you want the control to remember the previous position of the caret (character position cursor) then put a ? character in front of the mask (ie. {?XXXX} ). Masks that define a Calculator mode mask, always set the caret at the end of the text field, so the ? mask character has no effect.
           
            You can now use the Backspace key in most masks ! The control will determine the proper character to replace text with. For example, if the mask character is X, A, U or N it will use a space. If the mask character is a 9 (digits only) it will use a 0 (zero) when back spacing.



12
Advanced EZGUI / Number Component
« Last post by Chris Gaskell on July 15, 2024, 06:41:08 am »
Attached is the source code that I wrote as an example of my understanding of making a component. It's a text or edit box that accepts only numbers, and only accepts one decimal point.
I'm sure everyone can improve on it.

The dll code is :
*******************************************************
#DIM ALL

#COMPILE DLL "V6NOBOX.DLL"
#INCLUDE "C:\ezgui50pro\includes\ezgui50.inc"
#IF NOT %DEF(%WINAPI)
    #INCLUDE "win32api.inc"                        'add win32api if not already added
#ENDIF

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
    ' Component include file!
   #INCLUDE "C:\ezgui50pro\components\V99frmNo.bas"

SUB EZ_InitComponent(BYVAL CMPPrefix$) EXPORT

     EZ_NOBOX_InitComponent CMPPrefix$

END SUB

***************************************************

The component code is as follows:

' *************************************************************************************
'                    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 !
' ======================================

DECLARE SUB EZ_NOBOX_InitComponent(BYVAL CMPPrefix$)
DECLARE SUB EZ_NOBOX_Design()
DECLARE SUB EZ_NOBOX_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB NOBOX_Events(CID&, CMsg&, CVal&, Cancel&)
%NOBOX_Width = 50
%NOBOX_Height = 2
' ------------------------------------------------

%NOBOX_TXTNO              = 100

DECLARE SUB NOBOX_TXTNO_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB NOBOX_TXTNO_SubClass(BYVAL CVal&, Cancel&)

'<<BEGINFORM>> "NOBOX"


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

SUB EZ_NOBOX_InitComponent(BYVAL CMPPrefix$)     ' (PROTECTED)
     EZ_DefComponent CMPPrefix$+"NOBOX", "||NOBOX.bas", CODEPTR(EZ_NOBOX_Design), CODEPTR(EZ_NOBOX_ParseEvents)
END SUB

SUB EZ_NOBOX_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_SubClass 2
     EZ_Text %NOBOX_TXTNO, 0, 0, 20, 2, "", ">EST"
     EZ_SubClass 0
     ' -----------------------------------------------
END SUB


SUB EZ_NOBOX_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               NOBOX_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %NOBOX_TXTNO
               NOBOX_TXTNO_Events CID&, CMsg&, CVal&, Cancel&
               IF CMsg&=%EZ_SubClass THEN
                    NOBOX_TXTNO_SubClass CVal&, Cancel&
               END IF
          CASE ELSE
               NOBOX_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB

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

SUB NOBOX_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 NOBOX_TXTNO_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE %EZ_KeyPress

          CASE %EZ_Focus

          CASE %EZ_Sizing
          CASE ELSE
     END SELECT
END SUB



SUB NOBOX_TXTNO_SubClass(BYVAL CVal&, Cancel&)
     DIM NoOfDP AS LONG
     DIM AText AS STRING
     DIM SelStart AS LONG
     DIM SelEnd AS LONG

     AText  = ""
     LOCAL hCtrl&, Msg&, wParam&, lParam&
     EZ_GetSubClass  CVal&, hCtrl&, Msg&, wParam&, lParam&
     SELECT CASE Msg&
          CASE %EZ_KEYDOWN

          CASE %WM_CHAR

             SELECT CASE wParam&


                AText =  EZ_GetText ("{ME}",100)
                NoOfDP = TALLY(AText,".")

                IF NoOfDP > 1 THEN

                    AText = MID$( AText,1 TO LEN(AText)-1)
                    SelStart = LEN(AText)
                    SelEnd = LEN(AText)

                    EZ_SetText "{ME}", 100, AText
                    EZ_SendMessage("{ME}",100, %EM_SETSEL, SelStart, SelEnd)
                    Cancel& = 1
                    EXIT SUB
                END IF
                CASE 48 TO 57, 45, 46, 8, 13 'only allow 0 to 9, 8,13 minus, period

             CASE ELSE

                 Cancel& = 1
                 EXIT SUB


         END SELECT
           CASE %WM_LBUTTONDOWN
          CASE ELSE
     END SELECT
END SUB


'<<END ALL FORMS>>    UnKnown Routines follow:
#IF %EZ_NOSKIPCODE
#ENDIF 'PARSE END

************************************************************
Hopefully, people can play around with this and improve it.
I have to say, EZGUIPRO makes component design easy.

Chris                                                             
13
General Discussion / Re: Powerbasic Website Demise
« Last post by Chris Boss on June 29, 2024, 09:44:10 pm »
The above app uses an external template file for different languages. I wrote a simple language editor using PB DDT using Unicode which saves text to a file template.

The EZGUI app loads the different language templates and can switch between different languages on the fly instantly.

The text for a  button may look like this:

Clear Terminal Display//0010

The ownerdraw engine removes the number after the // characters. If a different Language is selected, the app read the text in that language using the ID number after the // characters and draws that instead of the english.

14
General Discussion / Re: Powerbasic Website Demise
« Last post by Chris Boss on June 29, 2024, 09:39:27 pm »
Screenshot of a custom commercial app I created for a client company:

Top picture is showing default English.

Bottom picture is same app which changes text to Japanese (Unicode) via ownerdraw.


15
General Discussion / Re: Powerbasic Website Demise
« Last post by Chris Boss on June 29, 2024, 09:34:45 pm »
More pictures
16
General Discussion / Re: Powerbasic Website Demise
« Last post by Chris Boss on June 29, 2024, 09:31:25 pm »
More pictures
17
General Discussion / Re: Powerbasic Website Demise
« Last post by Chris Boss on June 29, 2024, 09:30:51 pm »
I have no desire to end EZGUI's usefulness just because PB is basically dead and gone.

I am working on a custom project for a client right now which takes much of my programming time, but I may later on see if EZGUI could be modified to work with other programming languages.

EZGUI users have underestimated benefit. While Powerbasic is basically defunct and no new features on the horizon, EZGUI's feature set far exceeds anything Powerbasic could come up with in a a few years time. Most EZGUI users only use only a small subset of the EZGUI command set. By tapping into the more advanced features the "sky is the limit".

For example the pictures below use things like OpenGL, Ownerdraw Listbox, Ownerdraw Combobox and more.
18
General Discussion / Powerbasic Website Demise
« Last post by Chris Gaskell on June 14, 2024, 02:39:47 am »
I don't know if anyone else has noted, but the Powerbasic website is no longer accessible. For the moment the Forum section is still working.
Anyway, I was wondering if your geat EZGUIPro5 could have new headers, include files, whatever to work with PureBasic.
I realise that it would not be easy, but I'd certainly pay for the upgrade.
I use EZGUI for all form designs. It's great, and over the years I've written software for accountants, and tax calculation software, plus a few games (for my daughter's amusement.
I realise that Chris said that he was semi-retired, but I'll keep my fingers crossed.
What do others think?
Chris Gaskell
19
EZGUI 5 support forum / Re: Autosave
« Last post by Chris Boss on June 05, 2024, 08:40:15 am »
There is an icon on the toolbar found on the Palette Window.

This icon toggles Autosave ON and OFF.

See attached picture.
20
EZGUI 5 support forum / Autosave
« Last post by Brian Reynolds on June 04, 2024, 03:17:13 am »
Somehow I have lost Autosave when compiling EZGUI code and I cannot find a way to restore it.
Could some kind member give me some advice how to recover it?
Pages: 1 [2] 3 4 ... 10