- llist->SetFont(-1,-1,wxSLANT);
- llist->Insert(_T("Slanted"));
- llist->SetFont(-1,-1,wxNORMAL);
- llist->Insert(_T(" and normal text and "));
- llist->SetFont(-1,-1,wxSLANT);
- llist->Insert(_T("slanted"));
- llist->SetFont(-1,-1,wxNORMAL);
- llist->Insert(_T(" again."));
- llist->LineBreak();
-
- // add some more text for testing:
- llist->Insert(_T("And here the source for the test program:"));
- llist->LineBreak();
- llist->SetFont(wxTELETYPE,16);
- llist->Insert(_T("And here the source for the test program:"));
- llist->LineBreak();
- llist->Insert(_T("And here the source for the test program:"));
- llist->LineBreak();
- llist->Insert(_T("And here the source for the test program:"));
-
- wxFile file( _T("wxLayout.cpp") );
- if ( file.IsOpened() )
- {
- off_t len = file.Length();
- wxChar *data = (wxChar *)malloc(2*len);
- if ( file.Read(data, len) == len )
- {
- wxLayoutImportText(llist, data);
- }
- free(data);
- }
+ llist->Insert(_T("Hello "));
+ wxBitmap *icon = new wxBitmap (wxIcon(Micon_xpm));
+
+ llist->Insert(new wxLayoutObjectIcon(icon));
+ llist->SetFontWeight(wxBOLD);
+ llist->Insert(_T("World! "));
+ llist->SetFontWeight(wxNORMAL);
+ llist->Insert(_T("The quick brown fox jumps..."));
+ llist->LineBreak();
+
+ llist->Insert(_T("over the lazy dog."));
+ llist->SetFont(-1,-1,-1,-1,true);
+ llist->Insert(_T("underlined"));
+ llist->SetFont(-1,-1,-1,-1,false);
+ llist->SetFont(wxROMAN);
+ llist->Insert(_T("This is "));
+ llist->SetFont(-1,-1,-1,wxBOLD);
+ llist->Insert(_T("BOLD "));
+ llist->SetFont(-1,-1,-1,wxNORMAL);
+ llist->Insert(_T("and "));
+ llist->SetFont(-1,-1,wxITALIC);
+ llist->Insert(_T("italics "));
+ llist->SetFont(-1,-1,wxNORMAL);
+ llist->LineBreak();
+
+ llist->Insert(_T("and "));
+ llist->SetFont(-1,-1,wxSLANT);
+ llist->Insert(_T("slanted"));
+ llist->SetFont(-1,-1,wxNORMAL);
+ llist->Insert(_T(" text."));
+ llist->LineBreak();
+
+ llist->Insert(_T("and "));
+ llist->SetFont(-1,-1,-1,-1,-1,_T("blue"));
+ llist->Insert(_T("blue"));
+ llist->SetFont(-1,-1,-1,-1,-1,_T("black"));
+ llist->Insert(_T(" and "));
+ llist->SetFont(-1,-1,-1,-1,-1,_T("green"),_T("black"));
+ llist->Insert(_T("green on black"));
+ llist->SetFont(-1,-1,-1,-1,-1,_T("black"),_T("white"));
+ llist->Insert(_T(" text."));
+ llist->LineBreak();
+
+ llist->SetFont(-1,-1,wxSLANT);
+ llist->Insert(_T("Slanted"));
+ llist->SetFont(-1,-1,wxNORMAL);
+ llist->Insert(_T(" and normal text and "));
+ llist->SetFont(-1,-1,wxSLANT);
+ llist->Insert(_T("slanted"));
+ llist->SetFont(-1,-1,wxNORMAL);
+ llist->Insert(_T(" again."));
+ llist->LineBreak();
+
+ // add some more text for testing:
+ llist->Insert(_T("And here the source for the test program:"));
+ llist->LineBreak();
+
+ llist->SetFont(wxTELETYPE,16);
+ llist->Insert(_T("And here the source for the test program:"));
+ llist->LineBreak();
+
+ wxTextFile file(_T("wxLayout.cpp"));
+ if ( file.Open() )
+ {
+ for ( wxString s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
+ {
+ wxString line;
+ llist->Insert(line.Format(_T("%6u: %s"),file.GetCurrentLine()+1,s.c_str()));
+ llist->LineBreak();
+ }
+ }