Home > Archive > Programming with dBASE > December 2005 > How to resize datasource font size in combobox?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to resize datasource font size in combobox?

2005-12-21, 1:23 pm

I'm creating a form using a combobox, with small (font size = 8, height = 8)
entryfields. I set the combobox to height = 8, font size = 8, but when it
pulls from a datasource, the actual text displayed in the combobox is still
font size 10. Is there a way to change this? Thanks for any help.


2005-12-21, 1:23 pm

Sorry, height is .75, not 8 as stated before.


<bosco@wilserv.net> wrote in message news:dGW7I1lBGHA.1448@news-server...
> I'm creating a form using a combobox, with small (font size = 8, height =
> 8) entryfields. I set the combobox to height = 8, font size = 8, but when
> it pulls from a datasource, the actual text displayed in the combobox is
> still font size 10. Is there a way to change this? Thanks for any help.
>



David Stone

2005-12-21, 8:24 pm

bosco@wilserv.net wrote:

> I'm creating a form using a combobox, with small (font size = 8, height = 8)
> entryfields.


What entryfields are you referring to? Do you mean the displayed text within the
combobox?

>I set the combobox to height = 8, font size = 8, but when it
>pulls from a datasource, the actual text displayed in the combobox is still
>font size 10. Is there a way to change this? Thanks for any help.


Hmmmmm....of course it should display at whatever fontSize you have chosen for
the control. Try the form below.

David


** END HEADER -- do not remove this line
//
// Generated on 12/21/2005
//
parameter bModal
local f
f = new combotxtsizeForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class combotxtsizeForm of FORM
with (this)
height = 9.4545
left = 51.2857
top = 1.9545
width = 34.4286
text = ""
endwith

this.COMBOBOX1 = new COMBOBOX(this)
with (this.COMBOBOX1)
height = 7.5
left = 3.2857
top = 1.0455
width = 18.7143
fontSize = 8
dataSource = 'array {"This is eight","This is eight"}'
style = 0 // Simple
autoDrop = true
endwith

this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 0.6364
left = 23.1429
top = 0.9545
width = 10.5714
text = "This is eight"
fontSize = 8
endwith

this.TEXTLABEL2 = new TEXTLABEL(this)
with (this.TEXTLABEL2)
height = 0.6364
left = 22.7143
top = 2.0909
width = 10.5714
text = "This is nine"
fontSize = 9
endwith

this.TEXTLABEL3 = new TEXTLABEL(this)
with (this.TEXTLABEL3)
height = 0.6364
left = 22.8571
top = 3.3636
width = 10.5714
text = "This is ten"
fontSize = 10
endwith

endclass




Ronnie MacGregor

2005-12-21, 8:24 pm

In article <dGW7I1lBGHA.1448@news-server>, bosco@wilserv.net says...

> but when it
> pulls from a datasource, the actual text displayed in the combobox is still
> font size 10. Is there a way to change this?


I assume you mean that you are assigning a new datasource after the
control has opened ?

If so you may find that you simply need to restate certain properties
that have been reset to their default values at the point the datasource
has been changed.

--
Ronnie MacGregor
Scotland

www.dBASEdeveloper.co.uk

2005-12-21, 8:24 pm

Thanks for the help. I think I have a different problem from what I
expected. I believe its a problem with the combobox, and not the font. The
font is changing size, but when I change the combobox height from 1.0 to
..75, it cuts the top parts of the data off that is in the combobox. Its odd
to me though, because when I use an entryfield instead of a combobox, it
displays the data fine. I took a screen shot of what I am talking about.
Thanks again.
http://wilserv.net/gallery/albums/dbase/combobox.jpg





"David Stone" <dlstone@wholegrain.com> wrote in message
news:43A9AEAB.8F2F7D66@wholegrain.com...
> bosco@wilserv.net wrote:
>
>
> What entryfields are you referring to? Do you mean the displayed text
> within the
> combobox?
>
>
> Hmmmmm....of course it should display at whatever fontSize you have chosen
> for
> the control. Try the form below.
>
> David
>
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 12/21/2005
> //
> parameter bModal
> local f
> f = new combotxtsizeForm()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class combotxtsizeForm of FORM
> with (this)
> height = 9.4545
> left = 51.2857
> top = 1.9545
> width = 34.4286
> text = ""
> endwith
>
> this.COMBOBOX1 = new COMBOBOX(this)
> with (this.COMBOBOX1)
> height = 7.5
> left = 3.2857
> top = 1.0455
> width = 18.7143
> fontSize = 8
> dataSource = 'array {"This is eight","This is eight"}'
> style = 0 // Simple
> autoDrop = true
> endwith
>
> this.TEXTLABEL1 = new TEXTLABEL(this)
> with (this.TEXTLABEL1)
> height = 0.6364
> left = 23.1429
> top = 0.9545
> width = 10.5714
> text = "This is eight"
> fontSize = 8
> endwith
>
> this.TEXTLABEL2 = new TEXTLABEL(this)
> with (this.TEXTLABEL2)
> height = 0.6364
> left = 22.7143
> top = 2.0909
> width = 10.5714
> text = "This is nine"
> fontSize = 9
> endwith
>
> this.TEXTLABEL3 = new TEXTLABEL(this)
> with (this.TEXTLABEL3)
> height = 0.6364
> left = 22.8571
> top = 3.3636
> width = 10.5714
> text = "This is ten"
> fontSize = 10
> endwith
>
> endclass
>
>
>
>



Todd Kreuter

2005-12-21, 8:24 pm

bosco@wilserv.net wrote:
>
> Thanks for the help. I think I have a different problem from what I
> expected. I believe its a problem with the combobox, and not the font. The
> font is changing size, but when I change the combobox height from 1.0 to
> .75, it cuts the top parts of the data off that is in the combobox. Its odd
> to me though, because when I use an entryfield instead of a combobox, it
> displays the data fine. I took a screen shot of what I am talking about.
> Thanks again.



Following is something you can play around with to get comboboxes to
display more like entryfields. You need the dUFLP and ComboAFS.cc
extracted and the dUFLP set up as a source alias... You also have to use
form.metric = pixels

--
Todd Kreuter [dBVIPS]


*** Copy and paste to wfm file - Watch that word wrap ****
** END HEADER -- do not remove this line
//
// Generated on 12/21/2005
//
parameter bModal
local f
f = new boscoForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class boscoForm of FORM
with (this)
metric = 6 // Pixels
height = 352.0
left = 371.0
top = 0.0
width = 280.0
text = ""
endwith

this.COMBOBOX3 = new COMBOBOX(this)
with (this.COMBOBOX3)
height = 16.0
left = 112.0
top = 33.0
width = 150.0
fontSize = 8.0
dataSource = 'array {"Bosco"}'
style = 1 // DropDown
dropDownHeight = 132.0
endwith

this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
height = 16.0
left = 112.0
top = 55.0
width = 150.0
fontSize = 8.0
value = "Bosco"
endwith

this.COMBOAFS1 = new COMBOTEST(this)
with (this.COMBOAFS1)
height = 16.0
left = 112.0
top = 77.0
width = 150.0
dataSource = 'array {"Bosco"}'
borderStyle = 3 // None
endwith

this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 14.0
left = 28.0
top = 33.0
width = 84.0
text = "Combobox"
fontSize = 8.0
endwith

this.TEXTLABEL2 = new TEXTLABEL(this)
with (this.TEXTLABEL2)
height = 14.0
left = 28.0
top = 55.0
width = 84.0
text = "EntryField"
fontSize = 8.0
endwith

this.TEXTLABEL3 = new TEXTLABEL(this)
with (this.TEXTLABEL3)
height = 14.0
left = 28.0
top = 77.0
width = 84.0
text = "ComboAFS"
fontSize = 8.0
endwith

this.RECTANGLE1 = new RECTANGLE(this)
with (this.RECTANGLE1)
left = 147.0
top = 11.0
width = 14.0
height = 121.0
text = "Rectangle1"
border = false
borderStyle = 4 // Single
endwith

endclass

class ComboTest(parentObj)
of ComboAFS(parentObj) from
:dUFLP:ComboAFS.cc

function onOpen

COMBOAFS::onOpen()

if this.form.metric # 6
// Metric has to be pixels
return
endif

extern CLOGICAL MoveWindow(CHANDLE, CUINT, CUINT, CUINT, CUINT,
CLOGICAL) User32

local nWidth, nHeight
nWidth = this.width - 21
nHeight = this.height - 4

MoveWindow(this.hwndEdit, 3, 2, nWidth, nHeight, true)

endclass
Bosco Wilson

2005-12-21, 8:24 pm

Thanks Todd, I'll give that a shot.

Bosco



Todd Kreuter Wrote:

> bosco@wilserv.net wrote:
>
>
> Following is something you can play around with to get comboboxes to
> display more like entryfields. You need the dUFLP and ComboAFS.cc
> extracted and the dUFLP set up as a source alias... You also have to use
> form.metric = pixels
>
> --
> Todd Kreuter [dBVIPS]
>
>
> *** Copy and paste to wfm file - Watch that word wrap ****
> ** END HEADER -- do not remove this line
> //
> // Generated on 12/21/2005
> //
> parameter bModal
> local f
> f = new boscoForm()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class boscoForm of FORM
> with (this)
> metric = 6 // Pixels
> height = 352.0
> left = 371.0
> top = 0.0
> width = 280.0
> text = ""
> endwith
>
> this.COMBOBOX3 = new COMBOBOX(this)
> with (this.COMBOBOX3)
> height = 16.0
> left = 112.0
> top = 33.0
> width = 150.0
> fontSize = 8.0
> dataSource = 'array {"Bosco"}'
> style = 1 // DropDown
> dropDownHeight = 132.0
> endwith
>
> this.ENTRYFIELD1 = new ENTRYFIELD(this)
> with (this.ENTRYFIELD1)
> height = 16.0
> left = 112.0
> top = 55.0
> width = 150.0
> fontSize = 8.0
> value = "Bosco"
> endwith
>
> this.COMBOAFS1 = new COMBOTEST(this)
> with (this.COMBOAFS1)
> height = 16.0
> left = 112.0
> top = 77.0
> width = 150.0
> dataSource = 'array {"Bosco"}'
> borderStyle = 3 // None
> endwith
>
> this.TEXTLABEL1 = new TEXTLABEL(this)
> with (this.TEXTLABEL1)
> height = 14.0
> left = 28.0
> top = 33.0
> width = 84.0
> text = "Combobox"
> fontSize = 8.0
> endwith
>
> this.TEXTLABEL2 = new TEXTLABEL(this)
> with (this.TEXTLABEL2)
> height = 14.0
> left = 28.0
> top = 55.0
> width = 84.0
> text = "EntryField"
> fontSize = 8.0
> endwith
>
> this.TEXTLABEL3 = new TEXTLABEL(this)
> with (this.TEXTLABEL3)
> height = 14.0
> left = 28.0
> top = 77.0
> width = 84.0
> text = "ComboAFS"
> fontSize = 8.0
> endwith
>
> this.RECTANGLE1 = new RECTANGLE(this)
> with (this.RECTANGLE1)
> left = 147.0
> top = 11.0
> width = 14.0
> height = 121.0
> text = "Rectangle1"
> border = false
> borderStyle = 4 // Single
> endwith
>
> endclass
>
> class ComboTest(parentObj)
of ComboAFS(parentObj) from
> :dUFLP:ComboAFS.cc
>
> function onOpen
>
> COMBOAFS::onOpen()
>
> if this.form.metric # 6
> // Metric has to be pixels
> return
> endif
>
> extern CLOGICAL MoveWindow(CHANDLE, CUINT, CUINT, CUINT, CUINT,
> CLOGICAL) User32
>
> local nWidth, nHeight
> nWidth = this.width - 21
> nHeight = this.height - 4
>
> MoveWindow(this.hwndEdit, 3, 2, nWidth, nHeight, true)
>
> endclass


Todd Kreuter

2005-12-22, 7:23 am

Bosco Wilson wrote:
>
> Thanks Todd, I'll give that a shot.


Okay, let me know if it works okay. I did not test in XP, which you seem
to be using.

The left alignment of the combobox edit is off 1 pixel, a minor change
tot the comboAFS control can fix that.


--
Todd Kreuter [dBVIPS]
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com