1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont demo
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999 Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
19 // for all others, include the necessary headers (this file is usually all you
20 // need because it includes almost all standard wxWindows headers
27 #include "wx/choicdlg.h"
28 #include "wx/fontdlg.h"
29 #include "wx/fontenum.h"
30 #include "wx/fontmap.h"
31 #include "wx/encconv.h"
32 #include "wx/splitter.h"
33 #include "wx/textfile.h"
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
39 // Define a new application type, each program should derive a class from wxApp
40 class MyApp
: public wxApp
43 // override base class virtuals
44 // ----------------------------
46 // this one is called on application startup and is a good place for the app
47 // initialization (doing it here and not in the ctor allows to have an error
48 // return: if OnInit() returns false, the application terminates)
49 virtual bool OnInit();
52 // MyCanvas is a canvas on which we show the font sample
53 class MyCanvas
: public wxWindow
56 MyCanvas( wxWindow
*parent
);
59 // accessors for the frame
60 const wxFont
& GetTextFont() const { return m_font
; }
61 const wxColour
& GetColour() const { return m_colour
; }
62 void SetTextFont(const wxFont
& font
) { m_font
= font
; }
63 void SetColour(const wxColour
& colour
) { m_colour
= colour
; }
66 void OnPaint( wxPaintEvent
&event
);
75 // Define a new frame type: this is going to be our main frame
76 class MyFrame
: public wxFrame
80 MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
83 MyCanvas
*GetCanvas() const { return m_canvas
; }
85 // event handlers (these functions should _not_ be virtual)
86 void OnQuit(wxCommandEvent
& event
);
87 void OnAbout(wxCommandEvent
& event
);
89 void OnIncFont(wxCommandEvent
& event
) { DoResizeFont(+2); }
90 void OnDecFont(wxCommandEvent
& event
) { DoResizeFont(-2); }
92 void OnBold(wxCommandEvent
& event
);
93 void OnItalic(wxCommandEvent
& event
);
94 void OnUnderline(wxCommandEvent
& event
);
96 void OnwxPointerFont(wxCommandEvent
& event
);
98 void OnViewMsg(wxCommandEvent
& event
);
99 void OnSelectFont(wxCommandEvent
& event
);
100 void OnEnumerateFamiliesForEncoding(wxCommandEvent
& event
);
101 void OnEnumerateFamilies(wxCommandEvent
& WXUNUSED(event
))
102 { DoEnumerateFamilies(FALSE
); }
103 void OnEnumerateFixedFamilies(wxCommandEvent
& WXUNUSED(event
))
104 { DoEnumerateFamilies(TRUE
); }
105 void OnEnumerateEncodings(wxCommandEvent
& event
);
107 void OnCheckNativeToFromString(wxCommandEvent
& event
);
110 bool DoEnumerateFamilies(bool fixedWidthOnly
,
111 wxFontEncoding encoding
= wxFONTENCODING_SYSTEM
,
112 bool silent
= FALSE
);
114 void DoResizeFont(int diff
);
115 void DoChangeFont(const wxFont
& font
, const wxColour
& col
= wxNullColour
);
117 size_t m_fontSize
; // in points
119 wxTextCtrl
*m_textctrl
;
123 // any class wishing to process wxWindows events must use this macro
124 DECLARE_EVENT_TABLE()
127 // ----------------------------------------------------------------------------
129 // ----------------------------------------------------------------------------
131 // IDs for the controls and the menu commands
149 Font_EnumFamiliesForEncoding
,
151 Font_EnumFixedFamilies
,
153 Font_CheckNativeToFromString
,
157 // ----------------------------------------------------------------------------
158 // event tables and other macros for wxWindows
159 // ----------------------------------------------------------------------------
161 // the event tables connect the wxWindows events with the functions (event
162 // handlers) which process them. It can be also done at run-time, but for the
163 // simple menu events like this the static method is much simpler.
164 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
165 EVT_MENU(Font_Quit
, MyFrame::OnQuit
)
166 EVT_MENU(Font_ViewMsg
, MyFrame::OnViewMsg
)
167 EVT_MENU(Font_About
, MyFrame::OnAbout
)
169 EVT_MENU(Font_IncSize
, MyFrame::OnIncFont
)
170 EVT_MENU(Font_DecSize
, MyFrame::OnDecFont
)
171 EVT_MENU(Font_Bold
, MyFrame::OnBold
)
172 EVT_MENU(Font_Italic
, MyFrame::OnItalic
)
173 EVT_MENU(Font_Underlined
, MyFrame::OnUnderline
)
175 EVT_MENU(Font_wxNORMAL_FONT
, MyFrame::OnwxPointerFont
)
176 EVT_MENU(Font_wxSMALL_FONT
, MyFrame::OnwxPointerFont
)
177 EVT_MENU(Font_wxITALIC_FONT
, MyFrame::OnwxPointerFont
)
178 EVT_MENU(Font_wxSWISS_FONT
, MyFrame::OnwxPointerFont
)
180 EVT_MENU(Font_CheckNativeToFromString
, MyFrame::OnCheckNativeToFromString
)
182 EVT_MENU(Font_Choose
, MyFrame::OnSelectFont
)
183 EVT_MENU(Font_EnumFamiliesForEncoding
, MyFrame::OnEnumerateFamiliesForEncoding
)
184 EVT_MENU(Font_EnumFamilies
, MyFrame::OnEnumerateFamilies
)
185 EVT_MENU(Font_EnumFixedFamilies
, MyFrame::OnEnumerateFixedFamilies
)
186 EVT_MENU(Font_EnumEncodings
, MyFrame::OnEnumerateEncodings
)
189 // Create a new application object: this macro will allow wxWindows to create
190 // the application object during program execution (it's better than using a
191 // static object for many reasons) and also declares the accessor function
192 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
196 // ============================================================================
198 // ============================================================================
200 // ----------------------------------------------------------------------------
201 // the application class
202 // ----------------------------------------------------------------------------
204 // `Main program' equivalent: the program execution "starts" here
207 // Create the main application window
208 MyFrame
*frame
= new MyFrame(wxT("Font wxWindows demo"),
209 wxPoint(50, 50), wxSize(600, 400));
211 // Show it and tell the application that it's our main window
215 // success: wxApp::OnRun() will be called which will enter the main message
216 // loop and the application will run. If we returned FALSE here, the
217 // application would exit immediately.
221 // ----------------------------------------------------------------------------
223 // ----------------------------------------------------------------------------
226 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
227 : wxFrame((wxFrame
*)NULL
, -1, title
, pos
, size
), m_textctrl(NULL
)
232 wxMenu
*menuFile
= new wxMenu
;
234 menuFile
->Append(Font_ViewMsg
, wxT("&View...\tCtrl-V"),
235 wxT("View an email message file"));
236 menuFile
->AppendSeparator();
237 menuFile
->Append(Font_About
, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
238 menuFile
->AppendSeparator();
239 menuFile
->Append(Font_Quit
, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
241 wxMenu
*menuFont
= new wxMenu
;
242 menuFont
->Append(Font_IncSize
, wxT("&Increase font size by 2 points\tCtrl-I"));
243 menuFont
->Append(Font_DecSize
, wxT("&Decrease font size by 2 points\tCtrl-D"));
244 menuFont
->AppendSeparator();
245 menuFont
->Append(Font_Bold
, wxT("&Bold\tCtrl-B"), wxT("Toggle bold state"), TRUE
);
246 menuFont
->Append(Font_Italic
, wxT("&Oblique\tCtrl-O"), wxT("Toggle italic state"), TRUE
);
247 menuFont
->Append(Font_Underlined
, wxT("&Underlined\tCtrl-U"),
248 wxT("Toggle underlined state"), TRUE
);
250 menuFont
->AppendSeparator();
251 menuFont
->Append(Font_CheckNativeToFromString
,
252 wxT("Check Native Font Info To/From String"));
254 wxMenu
*menuSelect
= new wxMenu
;
255 menuSelect
->Append(Font_Choose
, wxT("&Select font...\tCtrl-S"),
256 wxT("Select a standard font"));
258 wxMenu
*menuStdFonts
= new wxMenu
;
259 menuStdFonts
->Append(Font_wxNORMAL_FONT
, wxT("wxNORMAL_FONT"), wxT("Normal font used by wxWindows"));
260 menuStdFonts
->Append(Font_wxSMALL_FONT
, wxT("wxSMALL_FONT"), wxT("Small font used by wxWindows"));
261 menuStdFonts
->Append(Font_wxITALIC_FONT
, wxT("wxITALIC_FONT"), wxT("Italic font used by wxWindows"));
262 menuStdFonts
->Append(Font_wxSWISS_FONT
, wxT("wxSWISS_FONT"), wxT("Swiss font used by wxWindows"));
263 menuSelect
->Append(-2, wxT("Standar&d fonts"), menuStdFonts
);
265 menuSelect
->AppendSeparator();
266 menuSelect
->Append(Font_EnumFamilies
, wxT("Enumerate font &families\tCtrl-F"));
267 menuSelect
->Append(Font_EnumFixedFamilies
,
268 wxT("Enumerate fi&xed font families\tCtrl-X"));
269 menuSelect
->Append(Font_EnumEncodings
,
270 wxT("Enumerate &encodings\tCtrl-E"));
271 menuSelect
->Append(Font_EnumFamiliesForEncoding
,
272 wxT("Find font for en&coding...\tCtrl-C"),
273 wxT("Find font families for given encoding"));
275 // now append the freshly created menu to the menu bar...
276 wxMenuBar
*menuBar
= new wxMenuBar
;
277 menuBar
->Append(menuFile
, wxT("&File"));
278 menuBar
->Append(menuFont
, wxT("F&ont"));
279 menuBar
->Append(menuSelect
, wxT("&Select"));
281 // ... and attach this menu bar to the frame
284 wxSplitterWindow
*splitter
= new wxSplitterWindow(this);
286 m_textctrl
= new wxTextCtrl(splitter
, -1,
287 wxT("Paste text here to see how it looks\nlike in the given font"),
288 wxDefaultPosition
, wxDefaultSize
,
291 m_canvas
= new MyCanvas(splitter
);
293 splitter
->SplitHorizontally(m_textctrl
, m_canvas
, 100);
295 // create a status bar just for fun (by default with 1 pane only)
297 SetStatusText(wxT("Welcome to wxWindows font demo!"));
300 // --------------------------------------------------------
302 class MyEncodingEnumerator
: public wxFontEnumerator
305 MyEncodingEnumerator()
308 const wxString
& GetText() const
312 virtual bool OnFontEncoding(const wxString
& facename
,
313 const wxString
& encoding
)
316 text
.Printf(wxT("Encoding %d: %s (available in facename '%s')\n"),
317 ++m_n
, encoding
.c_str(), facename
.c_str());
327 void MyFrame::OnEnumerateEncodings(wxCommandEvent
& WXUNUSED(event
))
329 MyEncodingEnumerator fontEnumerator
;
331 fontEnumerator
.EnumerateEncodings();
333 wxLogMessage(wxT("Enumerating all available encodings:\n%s"),
334 fontEnumerator
.GetText().c_str());
337 // -------------------------------------------------------------
339 class MyFontEnumerator
: public wxFontEnumerator
343 { return !m_facenames
.IsEmpty(); }
345 const wxArrayString
& GetFacenames() const
346 { return m_facenames
; }
349 virtual bool OnFacename(const wxString
& facename
)
351 m_facenames
.Add(facename
);
356 wxArrayString m_facenames
;
359 bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly
,
360 wxFontEncoding encoding
,
363 MyFontEnumerator fontEnumerator
;
365 fontEnumerator
.EnumerateFacenames(encoding
, fixedWidthOnly
);
367 if ( fontEnumerator
.GotAny() )
369 int nFacenames
= fontEnumerator
.GetFacenames().GetCount();
372 wxLogStatus(this, wxT("Found %d %sfonts"),
373 nFacenames
, fixedWidthOnly
? wxT("fixed width ") : wxT(""));
380 facename
= fontEnumerator
.GetFacenames().Item(0);
384 // let the user choose
385 wxString
*facenames
= new wxString
[nFacenames
];
387 for ( n
= 0; n
< nFacenames
; n
++ )
388 facenames
[n
] = fontEnumerator
.GetFacenames().Item(n
);
390 n
= wxGetSingleChoiceIndex(wxT("Choose a facename"), wxT("Font demo"),
391 nFacenames
, facenames
, this);
394 facename
= facenames
[n
];
399 if ( !facename
.IsEmpty() )
401 wxFont
font(12, wxFONTFAMILY_DEFAULT
, wxFONTSTYLE_NORMAL
,
402 wxFONTWEIGHT_NORMAL
, FALSE
, facename
, encoding
);
411 wxLogWarning(wxT("No such fonts found."));
417 void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent
& WXUNUSED(event
))
419 static wxFontEncoding encodings
[] =
421 wxFONTENCODING_ISO8859_1
,
422 wxFONTENCODING_ISO8859_2
,
423 wxFONTENCODING_ISO8859_5
,
424 wxFONTENCODING_ISO8859_7
,
425 wxFONTENCODING_ISO8859_15
,
427 wxFONTENCODING_CP1250
,
428 wxFONTENCODING_CP1251
,
429 wxFONTENCODING_CP1252
,
432 static const wxString encodingNames
[] =
434 wxT("Western European (ISO-8859-1)"),
435 wxT("Central European (ISO-8859-2)"),
436 wxT("Cyrillic (ISO-8859-5)"),
437 wxT("Greek (ISO-8859-7)"),
438 wxT("Western European with Euro (ISO-8859-15)"),
440 wxT("Windows Central European (CP 1250)"),
441 wxT("Windows Cyrillic (CP 1251)"),
442 wxT("Windows Western European (CP 1252)"),
445 int n
= wxGetSingleChoiceIndex(wxT("Choose an encoding"), wxT("Font demo"),
446 WXSIZEOF(encodingNames
),
452 DoEnumerateFamilies(FALSE
, encodings
[n
]);
456 void MyFrame::OnCheckNativeToFromString(wxCommandEvent
& WXUNUSED(event
))
458 wxString fontInfo
= m_canvas
->GetTextFont().GetNativeFontInfoDesc();
460 if ( fontInfo
.IsEmpty() )
462 wxLogError(wxT("Native font info string is empty!"));
466 wxFont
*font
= wxFont::New(fontInfo
);
467 if ( fontInfo
!= font
->GetNativeFontInfoDesc() )
468 wxLogError(wxT("wxNativeFontInfo ToString()/FromString() broken!"));
470 wxLogMessage(wxT("wxNativeFontInfo works: %s"), fontInfo
.c_str());
476 void MyFrame::DoResizeFont(int diff
)
478 wxFont font
= m_canvas
->GetTextFont();
480 font
.SetPointSize(font
.GetPointSize() + diff
);
484 void MyFrame::OnBold(wxCommandEvent
& event
)
486 wxFont font
= m_canvas
->GetTextFont();
488 font
.SetWeight(event
.IsChecked() ? wxFONTWEIGHT_BOLD
: wxFONTWEIGHT_NORMAL
);
492 void MyFrame::OnItalic(wxCommandEvent
& event
)
494 wxFont font
= m_canvas
->GetTextFont();
496 font
.SetStyle(event
.IsChecked() ? wxFONTSTYLE_ITALIC
: wxFONTSTYLE_NORMAL
);
500 void MyFrame::OnUnderline(wxCommandEvent
& event
)
502 wxFont font
= m_canvas
->GetTextFont();
504 font
.SetUnderlined(event
.IsChecked());
508 void MyFrame::OnwxPointerFont(wxCommandEvent
& event
)
512 switch (event
.GetId())
514 case Font_wxNORMAL_FONT
: font
= wxFont(*wxNORMAL_FONT
); break;
515 case Font_wxSMALL_FONT
: font
= wxFont(*wxSMALL_FONT
); break;
516 case Font_wxITALIC_FONT
: font
= wxFont(*wxITALIC_FONT
); break;
517 case Font_wxSWISS_FONT
: font
= wxFont(*wxSWISS_FONT
); break;
518 default : font
= wxFont(*wxNORMAL_FONT
); break;
521 GetMenuBar()->Check(Font_Bold
, FALSE
);
522 GetMenuBar()->Check(Font_Italic
, FALSE
);
523 GetMenuBar()->Check(Font_Underlined
, FALSE
);
528 void MyFrame::DoChangeFont(const wxFont
& font
, const wxColour
& col
)
530 m_canvas
->SetTextFont(font
);
532 m_canvas
->SetColour(col
);
535 m_textctrl
->SetFont(font
);
537 m_textctrl
->SetForegroundColour(col
);
540 void MyFrame::OnSelectFont(wxCommandEvent
& WXUNUSED(event
))
543 data
.SetInitialFont(m_canvas
->GetTextFont());
544 data
.SetColour(m_canvas
->GetColour());
546 wxFontDialog
dialog(this, data
);
547 if ( dialog
.ShowModal() == wxID_OK
)
549 wxFontData retData
= dialog
.GetFontData();
550 wxFont font
= retData
.GetChosenFont();
551 wxColour colour
= retData
.GetColour();
553 DoChangeFont(font
, colour
);
555 // update the state of the bold/italic/underlined menu items
556 wxMenuBar
*mbar
= GetMenuBar();
559 mbar
->Check(Font_Bold
, font
.GetWeight() == wxFONTWEIGHT_BOLD
);
560 mbar
->Check(Font_Italic
, font
.GetStyle() == wxFONTSTYLE_ITALIC
);
561 mbar
->Check(Font_Underlined
, font
.GetUnderlined());
566 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
568 // TRUE is to force the frame to close
572 void MyFrame::OnViewMsg(wxCommandEvent
& WXUNUSED(event
))
574 // first, choose the file
575 static wxString s_dir
, s_file
;
576 wxFileDialog
dialog(this, wxT("Open an email message file"),
578 if ( dialog
.ShowModal() != wxID_OK
)
581 // save for the next time
582 s_dir
= dialog
.GetDirectory();
583 s_file
= dialog
.GetFilename();
585 wxString filename
= dialog
.GetPath();
587 // load it and search for Content-Type header
588 wxTextFile
file(filename
);
594 static const wxChar
*prefix
= wxT("Content-Type: text/plain; charset=");
595 const size_t len
= wxStrlen(prefix
);
597 size_t n
, count
= file
.GetLineCount();
598 for ( n
= 0; n
< count
; n
++ )
600 wxString line
= file
[n
];
604 // if it is an email message, headers are over, no need to parse
609 if ( line
.Left(len
) == prefix
)
612 const wxChar
*pc
= line
.c_str() + len
;
613 if ( *pc
== wxT('"') )
616 while ( *pc
&& *pc
!= wxT('"') )
627 wxLogError(wxT("The file '%s' doesn't contain charset information."),
633 // ok, now get the corresponding encoding
634 wxFontEncoding fontenc
= wxFontMapper::Get()->CharsetToEncoding(charset
);
635 if ( fontenc
== wxFONTENCODING_SYSTEM
)
637 wxLogError(wxT("Charset '%s' is unsupported."), charset
.c_str());
641 m_textctrl
->LoadFile(filename
);
643 if ( fontenc
== wxFONTENCODING_UTF8
||
644 !wxFontMapper::Get()->IsEncodingAvailable(fontenc
) )
646 // try to find some similar encoding:
647 wxFontEncoding encAlt
;
648 if ( wxFontMapper::Get()->GetAltForEncoding(fontenc
, &encAlt
) )
650 wxEncodingConverter conv
;
652 if (conv
.Init(fontenc
, encAlt
))
655 m_textctrl
-> SetValue(conv
.Convert(m_textctrl
-> GetValue()));
659 wxLogWarning(wxT("Cannot convert from '%s' to '%s'."),
660 wxFontMapper::GetEncodingDescription(fontenc
).c_str(),
661 wxFontMapper::GetEncodingDescription(encAlt
).c_str());
665 wxLogWarning(wxT("No fonts for encoding '%s' on this system."),
666 wxFontMapper::GetEncodingDescription(fontenc
).c_str());
669 // and now create the correct font
670 if ( !DoEnumerateFamilies(FALSE
, fontenc
, TRUE
/* silent */) )
672 wxFont
font(12, wxFONTFAMILY_DEFAULT
, wxFONTSTYLE_NORMAL
,
673 wxFONTWEIGHT_NORMAL
, FALSE
/* !underlined */,
674 wxEmptyString
/* facename */, fontenc
);
681 wxLogWarning(wxT("No fonts for encoding '%s' on this system."),
682 wxFontMapper::GetEncodingDescription(fontenc
).c_str());
687 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
689 wxMessageBox(wxT("wxWindows font demo\n")
690 wxT("(c) 1999 Vadim Zeitlin"),
692 wxOK
| wxICON_INFORMATION
, this);
695 // ----------------------------------------------------------------------------
697 // ----------------------------------------------------------------------------
699 BEGIN_EVENT_TABLE(MyCanvas
, wxWindow
)
700 EVT_PAINT(MyCanvas::OnPaint
)
703 MyCanvas::MyCanvas( wxWindow
*parent
)
704 : wxWindow( parent
, -1 ),
705 m_colour(*wxRED
), m_font(*wxNORMAL_FONT
)
709 MyCanvas::~MyCanvas()
713 void MyCanvas::OnPaint( wxPaintEvent
&WXUNUSED(event
) )
719 dc
.SetBackground(wxBrush(wxT("white"), wxSOLID
));
722 // one text line height
723 wxCoord hLine
= dc
.GetCharHeight();
725 // the current text origin
729 // output the font name/info
731 fontInfo
.Printf(wxT("Font size is %d points, family: %s, encoding: %s"),
732 m_font
.GetPointSize(),
733 m_font
.GetFamilyString().c_str(),
734 wxFontMapper::Get()->
735 GetEncodingDescription(m_font
.GetEncoding()).c_str());
737 dc
.DrawText(fontInfo
, x
, y
);
740 fontInfo
.Printf(wxT("Style: %s, weight: %s, fixed width: %s"),
741 m_font
.GetStyleString().c_str(),
742 m_font
.GetWeightString().c_str(),
743 m_font
.IsFixedWidth() ? _T("yes") : _T("no"));
745 dc
.DrawText(fontInfo
, x
, y
);
750 wxNativeFontInfo
*info
= m_font
.GetNativeFontInfo();
755 wxString fontDesc
= m_font
.GetNativeFontInfoUserDesc();
756 fontInfo
.Printf(wxT("Native font info: %s"), fontDesc
.c_str());
758 dc
.DrawText(fontInfo
, x
, y
);
765 // prepare to draw the font
767 dc
.SetTextForeground(m_colour
);
769 // the size of one cell (Normally biggest char + small margin)
770 long maxCharWidth
, maxCharHeight
;
771 dc
.GetTextExtent(wxT("W"), &maxCharWidth
, &maxCharHeight
);
772 int w
= maxCharWidth
+ 5,
773 h
= maxCharHeight
+ 4;
776 // print all font symbols from 32 to 256 in 7 rows of 32 chars each
777 for ( int i
= 0; i
< 7; i
++ )
779 for ( int j
= 0; j
< 32; j
++ )
781 wxChar c
= 32 * (i
+ 1) + j
;
783 long charWidth
, charHeight
;
784 dc
.GetTextExtent(c
, &charWidth
, &charHeight
);
788 x
+ w
*j
+ (maxCharWidth
- charWidth
) / 2 + 1,
789 y
+ h
*i
+ (maxCharHeight
- charHeight
) / 2
794 // draw the lines between them
795 dc
.SetPen(wxPen(wxColour("blue"), 1, wxSOLID
));
799 for ( l
= 0; l
< 8; l
++ )
801 int yl
= y
+ h
*l
- 2;
802 dc
.DrawLine(x
- 2, yl
, x
+ 32*w
- 1, yl
);
806 for ( l
= 0; l
< 33; l
++ )
808 int xl
= x
+ w
*l
- 2;
809 dc
.DrawLine(xl
, y
- 2, xl
, y
+ 7*h
- 1);