mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-28 06:12:53 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
263ff5f895
2665 changed files with 642923 additions and 0 deletions
32
reference/Display/Display.cpp
Normal file
32
reference/Display/Display.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "CtrlLib/CtrlLib.h"
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct FontFaceDisplay : Display {
|
||||
virtual void Paint(Draw& w, const Rect& r, const Value& q,
|
||||
Color ink, Color paper, dword style) const
|
||||
{
|
||||
Font fnt = Font(q, r.Height() - 2);
|
||||
String txt = Font::GetFaceName(q);
|
||||
w.DrawRect(r, paper);
|
||||
w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink);
|
||||
}
|
||||
};
|
||||
|
||||
struct MyApp : TopWindow {
|
||||
DropList dl;
|
||||
|
||||
MyApp()
|
||||
{
|
||||
Add(dl.HSizePos().TopPos(5, Ctrl::STDSIZE));
|
||||
dl.SetDisplay(Single<FontFaceDisplay>());
|
||||
for(int i = 0; i < Font::GetFaceCount(); i++)
|
||||
dl.Add(i);
|
||||
SetRect(0, 0, 200, 70);
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue