Really, really, really, nit-picky....

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

Okay, no cause for alarm here...just found something in Win32lib that I 
would wager most of us have never tried (at least I never did).  Has 
anyone ever tried to change the appearance of Windows desktop and use a 
Win32lib program? What I mean is right-clicking in the desktop, 
selecting the "Properties" item from the pop-up, selecting the 
"Appearance" tab and changing the "Desktop" item scheme to something 
other than Windows Standard and then running a program that uses 
Win32lib?  Go ahead...try it...I'll wait...did you notice that your 
Win32lib program did not change the background color of labels, windows, 
checkboxes, etc.?  Not really a big thing but it would be noticed by 
users wanting to change their desktop colors.  

To that end I humbly submit the following code:

-- On a paint call check if the current button face color has changed
-- and if so set all label controls and windows to the correct 
background color
-- as well as the main window background color.
atom cur_color 
cur_color = 0

procedure MainWin_onPaint(atom x1, atom y1, atom x2, atom y2)
	object color 
	color = getSysColor(COLOR_BTNFACE)
	if color != cur_color then
		cur_color = color	
                -- Set all window controls background
		setWindowBackColor( MainWin, color )
                -- Set label background
		setWindowBackColor( CurProjLT, color )	
                -- Set group control backgrounds
		setWindowBackColor( PrintTypeGroupGC, color ) 
                -- Set radio button backgrounds
		setWindowBackColor( PrintDetailRB, color )

	end if
end procedure
onPaint[MainWin] = routine_id("MainWin_onPaint")

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

Search



Quick Links

User menu

Not signed in.

Misc Menu