1. DropDownList

I'm trying to figure out how to use a dropdownlist and have a question or 2.

    1. Can you change the size of the dropdown button? It makes my input
field larger
vertically?

    2. I would like to show a list of text in the dropdown but when an item
is selected I want to show the code for it in the text window, not the text
itself. For example "2% 10 Net 30" in the drop down, but move N3 code into
the field....Is this possible? Or do I not understand this control? Is there
another control I should use?




thanks if you can help.

...george

new topic     » topic index » view message » categorize

2. Re: DropDownList

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: DropDownList


>
> I'm trying to figure out how to use a dropdownlist and have a question or
2.
>
>     1. Can you change the size of the dropdown button? It makes my input
> field larger
> vertically?

No, the size is fixed by the Windows DLL based the font size being used. To
change this is a lot of work that is probably not justified. You have to do
your own drawing of the control.

>     2. I would like to show a list of text in the dropdown but when an
item
> is selected I want to show the code for it in the text window, not the
text
> itself. For example "2% 10 Net 30" in the drop down, but move N3 code into
> the field....Is this possible? Or do I not understand this control? Is
there
> another control I should use?
>

You could try something like this ...

--------------
sequence ddKeys, ddCodes
ddKeys = {"2% 10 Net 30", "3% 10 Net 60", "5% 15 Net 90" }
ddCodes= { "N3"         , "N6"          , "N9"           }

procedure Init_myDropDown()
    eraseItems(myDropDown)
    addItem(myDropDown, ddKeys)
end procedure

procedure myDropDown_Click()
    sequence pick
    integer what

    pick = getItem(myDropdown, 0)
    if length(pick) != 0 then
        what = find(pick, ddKeys)
        if what != 0 then
            theField = ddCodes[what]
        else
            setText(MsgArea, "Unknown discount selected"
        end if
    else
        setText(MsgArea, "No discount selected")
    end if
end procedure

-----------
Derek

new topic     » goto parent     » topic index » view message » categorize

3. Re: DropDownList

It seems that the font size controls the size of the button on a
dropdownlist. any way to change/override  that?

following up on this. would it not be better for the button size to be
determined by the cy of the field rather than the char size?



...george
----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, August 16, 2001 2:04 PM
Subject: DropDownList


>
> I'm trying to figure out how to use a dropdownlist and have a question or
2.
>
>     1. Can you change the size of the dropdown button? It makes my input
> field larger
> vertically?
>
>     2. I would like to show a list of text in the dropdown but when an
item
> is selected I want to show the code for it in the text window, not the
text
> itself. For example "2% 10 Net 30" in the drop down, but move N3 code into
> the field....Is this possible? Or do I not understand this control? Is
there
> another control I should use?
>
>
>
>
> thanks if you can help.
>
> ...george
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: DropDownList

Your program snipit looks like it would work fine if the dropdownlist field
width could be larger than the coded field width. Can't see how to do this..
The code in the field would be like 'n30' or 'n60' , so the editText field
only should be 3-6 chars but the descriptive text for this could be much
larger (usually about 15). The short code would be used in the DB and on
internal reports, the long on invoices, statements, etc.

...george
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: DropDownList


> >
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Friday, August 17, 2001 4:04 AM
> Subject: DropDownList
>
>
> >
> > I'm trying to figure out how to use a dropdownlist and have a question
or
> 2.
> >
> >     1. Can you change the size of the dropdown button? It makes my input
> > field larger
> > vertically?
>
> No, the size is fixed by the Windows DLL based the font size being used.
To
> change this is a lot of work that is probably not justified. You have to
do
> your own drawing of the control.
>
> >     2. I would like to show a list of text in the dropdown but when an
> item
> > is selected I want to show the code for it in the text window, not the
> text
> > itself. For example "2% 10 Net 30" in the drop down, but move N3 code
into
> > the field....Is this possible? Or do I not understand this control? Is
> there
> > another control I should use?
> >
>
> You could try something like this ...
>
> --------------
> sequence ddKeys, ddCodes
> ddKeys = {"2% 10 Net 30", "3% 10 Net 60", "5% 15 Net 90" }
> ddCodes= { "N3"         , "N6"          , "N9"           }
>
> procedure Init_myDropDown()
>     eraseItems(myDropDown)
>     addItem(myDropDown, ddKeys)
> end procedure
>
> procedure myDropDown_Click()
>     sequence pick
>     integer what
>
>     pick = getItem(myDropdown, 0)
>     if length(pick) != 0 then
>         what = find(pick, ddKeys)
>         if what != 0 then
>             theField = ddCodes[what]
>         else
>             setText(MsgArea, "Unknown discount selected"
>         end if
>     else
>         setText(MsgArea, "No discount selected")
>     end if
> end procedure
>
> -----------
> Derek
>
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: DropDownList

On Thursday 16 August 2001 16:59, George Walters wrote:
>
> Your program snipit looks like it would work fine if the dropdownlist field
> width could be larger than the coded field width. Can't see how to do
> this.. The code in the field would be like 'n30' or 'n60' , so the editText
> field only should be 3-6 chars but the descriptive text for this could be
> much larger (usually about 15). The short code would be used in the DB and
> on internal reports, the long on invoices, statements, etc.

Why not just leave the descriptive text in the dropdown?
If a person chooses "2% 10, Net 30", then that will stay on the screen, 
but your db could store a code, say: 3,  in the terms column. 

When you later print reports, etc, you can expand that 3 to read anything 
you want -  "10n30", or "2% discount if paid within ten working 
days, net 30 days from date of invoice".

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

6. Re: DropDownList

Hi George,
> Your program snipit looks like it would work fine if the dropdownlist
field
> width could be larger than the coded field width. Can't see how to do
this..
> The code in the field would be like 'n30' or 'n60' , so the editText field
> only should be 3-6 chars but the descriptive text for this could be much
> larger (usually about 15). The short code would be used in the DB and on
> internal reports, the long on invoices, statements, etc.

Maybe I'm missing something, but are you trying to display the short field
on the screen too? If so, why as it is only used in the DB and not on any
user interface (screen or paper). I can't see why you can't display the long
dropdown field and not botther showing the short data. If there is only a
fixed number of possible valid entries for this field, there is no need for
an edittext field, just a single dropdown will do.

Is there a good reason to display the short field to the user? If there is,
why can't you have both fields being displayed - the edittext being
read-only of course.

Here is an example of what I am saying...

---------------
include win32lib.ew

constant win = create(Window, "test", 0, 0, 0, 400, 300 ,0),
         MsgArea = create(StatusBar, "", win, 0, 0, 0, 0, 0),
         ef  = create(EditText, "" , win, 5, 5, 48, 20, ES_READONLY),
         dd  = create(Combo, "", win, 5, 28, 150, 140, 0)

--------------
sequence ddKeys, ddCodes
ddKeys = {"2% 10 Net 30", "3% 10 Net 60", "5% 15 Net 90" }
ddCodes= { "N3"         , "N6"          , "N9"           }

procedure Init_myDropDown()
    eraseItems(dd)
    addItem(dd, ddKeys)
end procedure

procedure myDropDown_Click()
    sequence pick
    integer what

    pick = getItem(dd, 0)
    if length(pick) != 0 then
        what = find(pick, ddKeys)
        if what != 0 then
            setText(ef, ddCodes[what])
        else
            setText(MsgArea, "Unknown discount selected")
        end if
    else
        setText(MsgArea, "No discount selected")
    end if
end procedure

onChange[dd] = routine_id("myDropDown_Click")
setWindowBackColor(ef, rgb(192,192,192))

Init_myDropDown()
WinMain(win, 0)

--------------
Derek

new topic     » goto parent     » topic index » view message » categorize

7. Re: DropDownList

Derek, the codes are their own codes so they can usually type them more
quickly than always having to pick from a list.  The pick list is just in
case the've forgotten a seldom used one. The long ones can sometimes take
too much space on the screen and are almost never on internal reports (again
space limitations). The long names only go outside the office to customers
who are not familiar with the codes.

...george
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: DropDownList


>
> Hi George,
> > Your program snipit looks like it would work fine if the dropdownlist
> field
> > width could be larger than the coded field width. Can't see how to do
> this..
> > The code in the field would be like 'n30' or 'n60' , so the editText
field
> > only should be 3-6 chars but the descriptive text for this could be much
> > larger (usually about 15). The short code would be used in the DB and on
> > internal reports, the long on invoices, statements, etc.
>
> Maybe I'm missing something, but are you trying to display the short field
> on the screen too? If so, why as it is only used in the DB and not on any
> user interface (screen or paper). I can't see why you can't display the
long
> dropdown field and not botther showing the short data. If there is only a
> fixed number of possible valid entries for this field, there is no need
for
> an edittext field, just a single dropdown will do.
>
> Is there a good reason to display the short field to the user? If there
is,
> why can't you have both fields being displayed - the edittext being
> read-only of course.
>
> Here is an example of what I am saying...
>
> ---------------
> include win32lib.ew
>
> constant win = create(Window, "test", 0, 0, 0, 400, 300 ,0),
>          MsgArea = create(StatusBar, "", win, 0, 0, 0, 0, 0),
>          ef  = create(EditText, "" , win, 5, 5, 48, 20, ES_READONLY),
>          dd  = create(Combo, "", win, 5, 28, 150, 140, 0)
>
> --------------
> sequence ddKeys, ddCodes
> ddKeys = {"2% 10 Net 30", "3% 10 Net 60", "5% 15 Net 90" }
> ddCodes= { "N3"         , "N6"          , "N9"           }
>
> procedure Init_myDropDown()
>     eraseItems(dd)
>     addItem(dd, ddKeys)
> end procedure
>
> procedure myDropDown_Click()
>     sequence pick
>     integer what
>
>     pick = getItem(dd, 0)
>     if length(pick) != 0 then
>         what = find(pick, ddKeys)
>         if what != 0 then
>             setText(ef, ddCodes[what])
>         else
>             setText(MsgArea, "Unknown discount selected")
>         end if
>     else
>         setText(MsgArea, "No discount selected")
>     end if
> end procedure
>
> onChange[dd] = routine_id("myDropDown_Click")
> setWindowBackColor(ef, rgb(192,192,192))
>
> Init_myDropDown()
> WinMain(win, 0)
>
> --------------
> Derek
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: DropDownList

Well, I guess it's because, it takes up too much space on the screen and on
some reports there's not enough room to print it and it's their own codes so
the're used to them and if the're not they need to get used to them, because
they show up on most internal documents...

This is just some design stuff that is well established and been around for
a long time..

...george
----- Original Message -----
From: "Irv Mullins" <irvm at ellijay.com>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, August 16, 2001 5:57 PM
Subject: Re: DropDownList


> >
> On Thursday 16 August 2001 16:59, George Walters wrote:
> >
> > Your program snipit looks like it would work fine if the dropdownlist
field
> > width could be larger than the coded field width. Can't see how to do
> > this.. The code in the field would be like 'n30' or 'n60' , so the
editText
> > field only should be 3-6 chars but the descriptive text for this could
be
> > much larger (usually about 15). The short code would be used in the DB
and
> > on internal reports, the long on invoices, statements, etc.
>
> Why not just leave the descriptive text in the dropdown?
> If a person chooses "2% 10, Net 30", then that will stay on the screen,
> but your db could store a code, say: 3,  in the terms column.
>
> When you later print reports, etc, you can expand that 3 to read anything
> you want -  "10n30", or "2% discount if paid within ten working
> days, net 30 days from date of invoice".
>
> Regards,
> Irv
>
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu