Updated some test code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,7 +24,7 @@ class TestPanel(wxPanel):
|
|||||||
row = wxBoxSizer(wxHORIZONTAL)
|
row = wxBoxSizer(wxHORIZONTAL)
|
||||||
row.Add(s1, 0, wxALL, 5)
|
row.Add(s1, 0, wxALL, 5)
|
||||||
row.Add(self.lb1, 0, wxALL, 5)
|
row.Add(self.lb1, 0, wxALL, 5)
|
||||||
row.Add(self.txt, 0, wxALL, 5)
|
row.Add(self.txt, 0, wxALL|wxADJUST_MINSIZE, 5)
|
||||||
|
|
||||||
sizer = wxBoxSizer(wxVERTICAL)
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
sizer.Add(row, 0, wxALL, 30)
|
sizer.Add(row, 0, wxALL, 30)
|
||||||
@@ -32,13 +32,27 @@ class TestPanel(wxPanel):
|
|||||||
self.Layout()
|
self.Layout()
|
||||||
|
|
||||||
self.lb1.SetSelection(0)
|
self.lb1.SetSelection(0)
|
||||||
|
self.OnSelect(None)
|
||||||
|
wxFutureCall(300, self.SetTextSize)
|
||||||
|
|
||||||
|
|
||||||
|
def SetTextSize(self):
|
||||||
|
self.txt.SetSize(self.txt.GetBestSize())
|
||||||
|
|
||||||
|
|
||||||
def OnSelect(self, evt):
|
def OnSelect(self, evt):
|
||||||
|
#print "OnSelect: "
|
||||||
face = self.lb1.GetStringSelection()
|
face = self.lb1.GetStringSelection()
|
||||||
|
#print '\t '+face
|
||||||
font = wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, False, face)
|
font = wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, False, face)
|
||||||
|
#print "\t got font"
|
||||||
|
self.txt.SetLabel(face)
|
||||||
|
#print "\t set label"
|
||||||
self.txt.SetFont(font)
|
self.txt.SetFont(font)
|
||||||
self.txt.SetSize(self.txt.GetBestSize())
|
#print "\t set font"
|
||||||
|
#self.txt.SetSize(self.txt.GetBestSize())
|
||||||
|
#print "\t set size"
|
||||||
|
|
||||||
|
|
||||||
## st = font.GetNativeFontInfo().ToString()
|
## st = font.GetNativeFontInfo().ToString()
|
||||||
## ni2 = wxNativeFontInfo()
|
## ni2 = wxNativeFontInfo()
|
||||||
|
@@ -64,6 +64,11 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
|
|||||||
self.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns");
|
self.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns");
|
||||||
|
|
||||||
|
|
||||||
|
editor = wxGridCellTextEditor()
|
||||||
|
editor.SetParameters('10')
|
||||||
|
self.SetCellEditor(0, 4, editor)
|
||||||
|
self.SetCellValue(0, 4, "Limited text")
|
||||||
|
|
||||||
|
|
||||||
# test all the events
|
# test all the events
|
||||||
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
|
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
|
||||||
|
@@ -26,7 +26,7 @@ class TestPanel(wxPanel):
|
|||||||
text = wxStaticText(self, -1, str, (20, 100))
|
text = wxStaticText(self, -1, str, (20, 100))
|
||||||
font = wxFont(18, wxSWISS, wxNORMAL, wxNORMAL)
|
font = wxFont(18, wxSWISS, wxNORMAL, wxNORMAL)
|
||||||
text.SetFont(font)
|
text.SetFont(font)
|
||||||
text.SetSize(text.GetBestSize())
|
#text.SetSize(text.GetBestSize())
|
||||||
|
|
||||||
wxStaticText(self, -1, "Multi-line wxStaticText\nline 2\nline 3\n\nafter empty line", (20,150))
|
wxStaticText(self, -1, "Multi-line wxStaticText\nline 2\nline 3\n\nafter empty line", (20,150))
|
||||||
wxStaticText(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style=wxALIGN_RIGHT)
|
wxStaticText(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style=wxALIGN_RIGHT)
|
||||||
|
@@ -29,8 +29,8 @@ class TestTreeCtrlPanel(wxPanel):
|
|||||||
self.log = log
|
self.log = log
|
||||||
tID = wxNewId()
|
tID = wxNewId()
|
||||||
|
|
||||||
self.tree = MyTreeCtrl(self, tID,
|
self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
|
||||||
style = wxTR_HAS_BUTTONS
|
wxTR_HAS_BUTTONS
|
||||||
| wxTR_EDIT_LABELS
|
| wxTR_EDIT_LABELS
|
||||||
#| wxTR_MULTIPLE
|
#| wxTR_MULTIPLE
|
||||||
#| wxTR_HIDE_ROOT
|
#| wxTR_HIDE_ROOT
|
||||||
|
Reference in New Issue
Block a user