Subject Re: AutoDropNot - A Solution
From Tom <IHaveNoEmail@ddress>
Date Mon, 5 Nov 2018 08:23:17 -0500
Newsgroups dbase.getting-started

Found a solution. How it works or why is beyond my pay grade but it does
what I want. :)

Thanks,

Tom

*
// Forcing combobox autoDrop from dUFLP code -
*
// Class name:        extCombobox
// Author: Gary White
*
#include windef.h
#include winuser.h
*
** END HEADER -- do not remove this line
//
// Generated on 11/04/2018
//
parameter bModal
local f
f = new Entryfieldtypes3Form()
if (bModal)
    f.mdi = false // ensure not MDI
    f.readModal()
else
    f.open()
endif

class Entryfieldtypes3Form of FORM
    with (this)
                onOpen = class::Form_onOpen
       metric = 6        // Pixels
       colorNormal = "LightGrey"
       height = 352.0
       left = 840.0
       top = 0.0
       width = 280.0
       text = ""
    endwith

    this.EFBOOLIAN = new ENTRYFIELD(this)
    with (this.EFBOOLIAN)
       height = 22.0
       left = 88.0
       top = 32.0
       width = 39.0
       fontSize = 11.0
       statusMessage = "Boolian: Allows input and display of TRUE,
FALSE, T, F, Y or N in upper or lower case."
       speedTip = "Boolian"
       value = false
    endwith

    this.EFNUMERIC = new ENTRYFIELD(this)
    with (this.EFNUMERIC)
       height = 22.0
       left = 88.0
       top = 65.0
       width = 60.0
       picture = "99,999,999.99"
       fontSize = 11.0
       statusMessage = "Numeric Allows a numeric value including 2
decimal places. Decimal point is required. Commas are automatic."
       speedTip = "Numeric"
       value = 0.0
    endwith

    this.EFDATE = new ENTRYFIELD(this)
    with (this.EFDATE)
                onGotFocus = class::EFDATE_ONGOTFOCUS
       height = 22.0
       left = 88.0
       top = 98.0
       width = 81.0
       picture = "99/99/9999"
       fontSize = 11.0
       statusMessage = "Date: Type two digit month, day and four digit
year. No separators are required."
       speedTip = "Date"
       value = {01/17/1947}
    endwith

    this.EFINTIGER = new ENTRYFIELD(this)
    with (this.EFINTIGER)
       height = 22.0
       left = 88.0
       top = 131.0
       width = 56.0
       picture = "99,999,999"
       fontSize = 11.0
       statusMessage = "Integer: Integers only. Commas are automatic."
       speedTip = "Intiger"
       value = 0
    endwith

    this.EFCHARACTER = new ENTRYFIELD(this)
    with (this.EFCHARACTER)
       onGotFocus = class::EFCHARACTER_ONGOTFOCUS
       height = 22.0
       left = 88.0
       top = 164.0
       width = 76.0
       fontSize = 11.0
       statusMessage = "Character: Any typable character."
       speedTip = "Character"
       value = "Entryfield1"
    endwith

    this.EFTIME = new ENTRYFIELD(this)
    with (this.EFTIME)
       height = 22.0
       left = 88.0
       top = 197.0
       width = 66.0
       picture = "99:99:99"
       fontSize = 11.0
       statusMessage = "Time: Military (24 hour) time format of hours,
minutes and seconds (hh:mm:ss). No separaters are required."
       speedTip = "Time"
       value = "10:00:00"
    endwith

    this.EFDATETIME = new ENTRYFIELD(this)
    with (this.EFDATETIME)
       height = 22.0
       left = 88.0
       top = 230.0
       width = 140.0
       picture = "99/99/9999 99:99:99"
       fontSize = 11.0
       statusMessage = "DateTime: Two digit mont and day, four digit
year, and military time format (hhmm:ss). No separaters are required."
       speedTip = "Datetime"
       value = {01/17/1947 10:00:00 AM}
    endwith

    this.CHOLLA = new COMBOBOX(this)
    with (this.CHOLLA)
       onOpen = {;this.height = 23}
                onLostFocus = class::Cholla_oLF
       systemTheme = false
       visible = false
       height = 23.0
       left = 51.0
       top = 288.0
       width = 175.0
       fontSize = 11.0
       dataSource = 'array {"Cholla"}'
       statusMessage = "Click pushbutton or use <F4> key to display list."
       style = 2        // DropDownList
       dropDownHeight = 132.0
                autoDrop = TRUE
    endwith

        Function Form_onOpen
        * ----------------------------- *
                if type('SendMessageN') # 'FP'
          extern LRESULT SendMessageN(CHANDLE, UINT, WPARAM, LPARAM)
user32 ;
          from "SendMessageA"
       endif
        return
        *

    Function EFCHARACTER_onGotFocus()
        * -------------------------------------------------- *
                //local aList
                aList = new ARRAY()
                aList.add("ABC")
                aList.add("def")
                aList.add("GHI")
                aList.add("jkl")
                aList.add("MNO")
                aList.add("pqr")
                aList.add("STU")
                aList.add("vwxyz")
                form.CHOLLA.dataSource = 'ARRAY aList'
                *
                form.oNextFocus = this.before
                form.CHOLLA.width = this.width+18
                form.CHOLLA.top = this.top
                form.CHOLLA.left = this.left
                form.CHOLLA.visible = true
                form.CHOLLA.setFocus()
                class::DropDown(true)
        return
        *
        
        Function EFDATE_onGotFocus()
        * --------------------------------------- *
                //local aList
                aList = new ARRAY()
                aList.add(Date())
                form.CHOLLA.dataSource = 'ARRAY aList'
                *
                form.oNextFocus = this.before
                form.CHOLLA.width = this.width+18
                form.CHOLLA.top = this.top
                form.CHOLLA.left = this.left
                form.CHOLLA.visible = true
                form.CHOLLA.setFocus()        
                class::DropDown(true)
        return
        *
        
                Function Cholla_oLF
                * -------------------------*
                this.visible = false
                if type("form.oNextFocus") # 'U'
                        form.oNextFocus.setFocus()
                        form.oNextFocus = null
                endif
                return
                *
                
    Function DropDown( bShow )
        * ----------------------------------- *

            // Displays, or hides the drop down list depending
       // on the parameter.  If bShow is TRUE, the list is
       // displayed.  If bShow is FALSE, the list is retracted.

       local bRet
       bRet = true
       try
//         SendMessageN( this.hwnd, CB_SHOWDROPDOWN, ;
//            iif(bShow,1,0), 0 )
                        // code called by ENTRYFIELDS focus not CHOLLA ...
          SendMessageN( this.parent.CHOLLA.hwnd, CB_SHOWDROPDOWN, ;
             iif(bShow,1,0), 0 )
       catch (exception e)
               msgbox(e.message, 'Error '+e.code, 16)
          bRet := false
       endtry

    return bRet // end of DropDown
        *
        
endclass

/*
    form.aFlavors.add( this.form.newFlavorText.value ) // Add new flavor
    form.flavorCombobox.dataSource += "" // Reassert by adding empty string
*/


On 11/4/18 12:58 PM, Tom wrote:
> Hi all,
>
>   Been fooling around with this for most of the morning. As you can see,
> numerous code changes still fail to produce a combobox autodrop.
>
> Can you straighten me out.
>
> Thanks in advance,
>
> Tom
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 11/04/2018
> //
> parameter bModal
> local f
> f = new EntryfieldtypesForm()
> if (bModal)
>     f.mdi = false // ensure not MDI
>     f.readModal()
> else
>     f.open()
> endif
>
> class EntryfieldtypesForm of FORM
>     with (this)
>        metric = 6    // Pixels
>        colorNormal = "LightGrey"
>        height = 352.0
>        left = 840.0
>        top = 0.0
>        width = 280.0
>        text = ""
>     endwith
>
>     this.EFBOOLIAN = new ENTRYFIELD(this)
>     with (this.EFBOOLIAN)
>        height = 22.0
>        left = 88.0
>        top = 32.0
>        width = 39.0
>        fontSize = 11.0
>        statusMessage = "Boolian: Allows input and display of TRUE,
> FALSE, T, F, Y or N in upper or lower case."
>        speedTip = "Boolian"
>        value = false
>     endwith
>
>     this.EFNUMERIC = new ENTRYFIELD(this)
>     with (this.EFNUMERIC)
>        height = 22.0
>        left = 88.0
>        top = 65.0
>        width = 60.0
>        picture = "99,999,999.99"
>        fontSize = 11.0
>        statusMessage = "Numeric Allows a numeric value including 2
> decimal places. Decimal point is required. Commas are automatic."
>        speedTip = "Numeric"
>        value = 0.0
>     endwith
>
>     this.EFDATE = new ENTRYFIELD(this)
>     with (this.EFDATE)
>          onGotFocus = class::EFDATE_ONGOTFOCUS
>        height = 22.0
>        left = 88.0
>        top = 98.0
>        width = 81.0
>        picture = "99/99/9999"
>        fontSize = 11.0
>        statusMessage = "Date: Type two digit month, day and four digit
> year. No separators are required."
>        speedTip = "Date"
>        value = {01/17/1947}
>     endwith
>
>     this.EFINTIGER = new ENTRYFIELD(this)
>     with (this.EFINTIGER)
>        height = 22.0
>        left = 88.0
>        top = 131.0
>        width = 56.0
>        picture = "99,999,999"
>        fontSize = 11.0
>        statusMessage = "Integer: Integers only. Commas are automatic."
>        speedTip = "Intiger"
>        value = 0
>     endwith
>
>     this.EFCHARACTER = new ENTRYFIELD(this)
>     with (this.EFCHARACTER)
>        onGotFocus = class::EFCHARACTER_ONGOTFOCUS
>        height = 22.0
>        left = 88.0
>        top = 164.0
>        width = 76.0
>        fontSize = 11.0
>        statusMessage = "Character: Any typable character."
>        speedTip = "Character"
>        value = "Entryfield1"
>     endwith
>
>     this.EFTIME = new ENTRYFIELD(this)
>     with (this.EFTIME)
>        height = 22.0
>        left = 88.0
>        top = 197.0
>        width = 66.0
>        picture = "99:99:99"
>        fontSize = 11.0
>        statusMessage = "Time: Military (24 hour) time format of hours,
> minutes and seconds (hh:mm:ss). No separaters are required."
>        speedTip = "Time"
>        value = "10:00:00"
>     endwith
>
>     this.EFDATETIME = new ENTRYFIELD(this)
>     with (this.EFDATETIME)
>        height = 22.0
>        left = 88.0
>        top = 230.0
>        width = 140.0
>        picture = "99/99/9999 99:99:99"
>        fontSize = 11.0
>        statusMessage = "DateTime: Two digit mont and day, four digit
> year, and military time format (hhmm:ss). No separaters are required."
>        speedTip = "Datetime"
>        value = {01/17/1947 10:00:00 AM}
>     endwith
>
>     this.CHOLLA = new COMBOBOX(this)
>     with (this.CHOLLA)
>        onOpen = {;this.height = 23}
>          onLostFocus = class::Cholla_oLF
>        systemTheme = false
> //      visible = false
> ***pageNo = 2
>        height = 25.0
>        left = 51.0
>        top = -100 // 288.0
>        width = 175.0
>        fontSize = 11.0
>        dataSource = 'array {"Cholla"}'
>        statusMessage = "Click pushbutton or use <F4> key to display list."
>        style = 2    // DropDownList
>        dropDownHeight = 132.0
> autoDrop = TRUE // FALSE // true
> TABSTOP = FALSE
>     endwith
>
>
>     Function EFCHARACTER_onGotFocus()
>      * -------------------------------------------------- *
>          //local aList
>          aList = new ARRAY()
>          aList.add("ABC")
>          aList.add("def")
>          aList.add("GHI")
>          aList.add("jkl")
>          aList.add("MNO")
>          aList.add("pqr")
>          aList.add("STU")
>          aList.add("vwxyz")
>          form.CHOLLA.dataSource = 'ARRAY aList'
>          *
>          form.oNextFocus = this.before
>          form.CHOLLA.width = this.width+18
>          form.CHOLLA.top = this.top
>          form.CHOLLA.left = this.left
> //form.CHOLLA.AutoDrop = true
> ***        form.CHOLLA.visible = true
> ***form.CHOLLA.pageNo = 1
> ***form.CHOLLA.AutoDrop = true
>          form.CHOLLA.setFocus()
> ///        this.keyboard "{F4}"
>     return
>      *
>
>      Function EFDATE_onGotFocus()
>      * --------------------------------------- *
>          //local aList
>          aList = new ARRAY()
>          aList.add(Date())
>          form.CHOLLA.dataSource = 'ARRAY aList'
>          *
>          form.oNextFocus = this.before
>          form.CHOLLA.width = this.width+18
>          form.CHOLLA.top = this.top
>          form.CHOLLA.left = this.left
> ***        form.CHOLLA.visible = true
> ***form.CHOLLA.pageNo = 1
>          form.CHOLLA.setFocus()
>      return
>      *
>
>          Function Cholla_oLF
>          * -------------------------*
> //        this.autoDrop = false
> ***        this.visible = false
> //this.pageNo = 2
> this.top = -100
>          if type("form.oNextFocus") # 'U'
>              form.oNextFocus.setFocus()
>              form.oNextFocus = null
>          endif
>          return
>          *
> endclass
>
> /*
>     form.aFlavors.add( this.form.newFlavorText.value ) // Add new flavor
>     form.flavorCombobox.dataSource += "" // Reassert by adding empty string
> */
>