Results 1 to 10 of 22

Thread: cDbComboForm - a Better dbComboForm DataFlex Class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    1,597

    Default Re: cDbComboForm - a Better dbComboForm DataFlex Class

    Hi Dave

    I used your sample class and I didn't see the issue - pls see below:

    Click image for larger version. 

Name:	DaveR2.png 
Views:	37 
Size:	38.4 KB 
ID:	14970

    Click image for larger version. 

Name:	DaveR3.png 
Views:	34 
Size:	41.5 KB 
ID:	14971


    P/s: I would double check the DEFINE values you are using.

    Changes I did to test your code are:

    Code:
    Use cDbComboForm.pkg
    
    
    Define WM_CHANGEUISTATE                For |CI$0127
    Define WM_UPDATEUISTATE                For |CI$0128
    Define WM_QUERYUISTATE                 For |CI$0129
    Define UIS_SET                         For 1
    Define UIS_CLEAR                       For 2
    Define UIS_INITIALIZE                  For 3
    Define UISF_HIDEFOCUS                  For |CI$1
    Define UISF_HIDEACCEL                  For |CI$2
    Define UISF_ACTIVE                     For |CI$4
    
    
    Class cMyDbComboForm is a cdbComboForm
    
        //20sep2007 vincent's mod to allow wider entries than originally defined (is this needed in db-bound version?)
        Procedure Construct_Object
            Forward Send Construct_Object        
            Set Window_Style to CBS_AUTOHSCROLL True
        End_Procedure
    
    
    
    
        Procedure Page Integer iPageObject
            Integer iMargin iRet iState
            Handle hWnd //Nils post 26apr 18 re outlining the field
            Forward Send Page iPageObject
            If (iPageObject) Begin
                Get Form_Margin to iMargin
                Get Windows_Message CB_LIMITTEXT iMargin 0 to iRet
                Get Window_Handle to hWnd
                If (hWnd) Begin
                    Move (SendMessage(hWnd, WM_QUERYUISTATE, 0, 0)) to iRet
                    If (iRet iand UISF_HIDEFOCUS) Begin
                        Move (UIS_CLEAR + (UISF_HIDEFOCUS * 65536)) to iState
                        Move (SendMessage(hWnd, WM_UPDATEUISTATE, iState, 0)) to iRet
                    End
                End
            End
        End_Procedure
    
    
    
    
        //garret's way to trap use finding when they haven't saved - also in cmydbform. cmydbspinform
        Procedure Request_Find Integer mode Integer entUpdtFlag
            Integer iAnswer
            If ((HasRecord(Server(Self))) and (Should_Save(Server(Self)))) Begin
                 Move (YesNo_Box("Changes Exist. Abandon changes and continue with the find?", "Confirm")) to iAnswer
                 If (iAnswer<>MBR_Yes) Begin
                     Procedure_Return
                 End
            End
            Forward Send Request_Find mode entUpdtFlag
        End_Procedure
    
    
    
    
        // Create and augment procedure and functions
        Procedure OnSetFocus
            String sVal
            Forward Send OnSetFocus
            Set color to 16777170 // a light blue
            Get Value Item 0 to sVal
           //Set pFormOldValue to sVal
        End_Procedure
    
    
    
    
        Procedure OnKillFocus
            Forward Send OnKillFocus
            Set color to (If(enabled_state(Self),clWindow,clBtnFace))
        End_Procedure
    
    
    End_Class

    And then...

    Code:
                Object oOrderHea_Ship_Via is a cMyDbComboForm // cDbComboForm
                    Entry_Item OrderHeader.Ship_Via
                    Set Label to "Ship Via:"
                    Set Size to 12 60
                    Set Location to 64 183
                    Set peAnchors to anTopRight
                    Set Form_Border to 0
                    Set Label_Col_Offset to 2
                    Set Label_Justification_Mode to jMode_Right
                    Set psToolTip to "Custom Shipping ToolTip"
                End_Object
    Last edited by raveens; 21-Oct-2021 at 07:34 PM.
    Regards,
    Raveen Sundram

    Software Development Manager
    Excellent Software Ltd
    Auckland, New Zealand
    www.helixretail.co.nz


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •