getFontDialog

new topic     » topic index » view thread      » older message » newer message

Using CChris last win32lib, 70.2a, I've got a little test program in which I use
getFontDialog to assign font to a button control. I then use getFontDialog again
and the font size is not what I selected in the prior use of getFontDialog.

I sent the program to CChris and he says he gets the font size he selected the
first time. He suggested I post here so more people could test and report back if
their test worked or not and what version of Windows they use.

To make sure we are all testing the same way, the first time you click the
button, enter into Font Dialog "Arial", "Bold" and 14. Click OK. Now click the
button again and see if the font size is 14 or 11 or some other number.

But CChris also stated "using larger sizes like 24, I'm getting 1 more" so you
might want to test that value also.

When I run the test entering initially 14, I get back 11. When I click the
button again and enter 24 font size and then click the button again I get 20 font
size. Using XP PRO.

Here is the code for the test program:
include Win32Lib.ew
without warning

constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
0, 0 )
constant PushButton2 = createEx( PushButton, "Click to change font", Window1,
88, 108, 184, 28, 0, 0 )

procedure PushButton2_onClick (integer self, integer event, sequence
params)--params is ()
object fontdata
	fontdata=getFontDialog(PushButton2)
	if sequence(fontdata) then
		setFont(PushButton2, fontdata[1],fontdata[2],fontdata[3])	
	end if
end procedure
setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))

WinMain( Window1,Normal )


judith evans

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu