hi wxPeople...
once more i (Da german kid) have a question. First -Thx- to all
who helped me out at the past. all of it works (nearly). now i want to
change the font and the dimensions for all controls at
runtime if the user choose a new font...
But all controls (a lof of them) already initalized and owned
the "old" font which was actual at programstart. All items was
prepared with the following function...
#point, fonttype, fontfont owned values loaded from the database
def setfont( item ):
# SetFont
item.SetFont( wxFont( point, wxSWISS, wxNORMAL, fonttype, FALSE,
fontfont ) )
# Now get the new Size for the font and set the size
# Its not the point of my interest, but it also the function...
# I know its not the fine art to identify the control, but it works...
itemsize=item.GetBestSize()
checkstring=(str(item)[:16])
if checkstring== "<C wxTextCtrl in":
if item.GetSize().GetHeight()<30:
item.SetSize(wxSize(item.GetSize().GetWidth(),itemsize.GetHeight()))
else:
pass
elif checkstring== "<C wxButton inst":
item.SetSize(itemsize)
elif checkstring== "<C wxButton inst":
item.SetSize(itemsize)
elif checkstring== "<C wxCheckBox in":
if item.GetSize().GetWidth() < itemsize.GetWidth():
item.SetSize(itemsize)
else:
if item.GetSize().GetHeight() < itemsize.GetHeight():
item.SetSize(wxSize(item.GetSize().GetWidth(),itemsize.GetHeight()))
else:
pass
elif checkstring== "<C wxRadioBox in":
item.SetSize(itemsize)
elif checkstring== "<C wxRadioButton":
item.SetSize(wxSize(itemsize.GetWidth(),item.GetSize().GetHeight()))
elif checkstring== "<C wxStaticText ":
try:
if item.ReturnStaticWidth(): # Speziell
für My_wxStaticText()
item.SetSize(wxSize(item.GetSize().GetWidth(),itemsize.GetHeight()))
else:
item.SetSize(itemsize)
except:
item.SetSize(itemsize)
else:
print(str(item)[:16])
return item
All Controls (resp. all dialogs and forms) are in one file. They loaded
from there
in the mainframe. i know that i have to ""refresh"" all controls, so that
they automaticly
call setfont(item) and get the new font and size. After that the sizers
have to
layout new..
or could i import the file with the controls new, so that all controls be
new loaded, with the
new preferences?
hm, whatever. i also know (!) that my writin - english is so bad that
nobody understood my
problem. i check the list every hour. Now i m searching further for a
solution...
thx, reen
Rene Freund
···
--------------------------
rene@meder.de