Paradox Community

Items in comp.databases.paradox

Subject:Re: Dark Theme Option?
Date:Wed, 06 Nov 2019 09:44:06 +0100
From:modridirkac <jure.zorko@gmail.com>
Newsgroups:comp.databases.paradox
In my app I have option of translating texts on form (to localize forms)  
and also chanmge color of objects.

This is part of code. You can read colour from table at begining of method.


method TranslateMask(var F Form) smallint
var TC TCursor
endVar

...
...
...

F.enumUIObjectNames(":PRIV:__obj")
TC.Open(":PRIV:__obj")
scan TC :     ; check every object on Form
   switch
     case TC."ObjectClass" = "Text" :
	try    ; attach to object
		if not UI.Attach(F.(TC."ObjectName")) then loop endIf
	onFail
		loop
	endtry
	; change text on object (if you need to translate it)
	UI.Value = proc_translation(UI.Value)
	; if you need it, change colour and style		
	UI.Font.Style = FontAttribBold ; FontAttribItalic, FontAttribNormal,  
FontAttribStrikeout, FontAttribUnderline
	UI.Font.TypeFace = "Arial"
	UI.Font.Color = black
     case TC."ObjectClass"="Record" or TC."ObjectClass"="Multirecord" or  
TC."ObjectClass"="Page" or TC."ObjectClass"="FormData" or  
TC."ObjectClass"="NotePage" or TC."ObjectClass"="Box" or  
TC."ObjectClass"="TableFrame":
               if not UI.Attach(F.(TC."ObjectName")) then loop endIf
                 UI.Color = Green
               endIf
   endSwitch
endScan

return(1)	
endMethod	


Copyright © 2004 thedbcommunity.com