void AppPreview::Paint(Draw& w) { Size sz = GetSize(); FontInfo fi = CourierZ(12).Info(); int y = 0; int i = sb; while(y < sz.cy) { bool hdr = i < line.GetCount() && line[i].header; w.DrawRect(0, y, sz.cx, fi.GetHeight(), hdr ? LtCyan : SColorPaper); if(i < line.GetCount()) w.DrawText(0, y, line[i].text, hdr ? ArialZ(12).Bold().Italic() : CourierZ(12), SColorText); y += fi.GetHeight(); i++; } }
VisGenDlg::VisGenDlg(LayoutData& layout, const Vector<int>& cursor) : layout(layout) { type <<= 0; CtrlLayoutOKCancel(*this, "Code generator"); type <<= THISBACK(Type); // needs to be before Refresh to maintain the proper order of action toupper1 << [=] { tolower1 <<= false; initcaps1 <<= false; }; tolower1 << [=] { toupper1 <<= false; initcaps1 <<= false; }; initcaps1 << [=] { toupper1 <<= false; tolower1 <<= false; }; toupper2 << [=] { tolower2 <<= false; initcaps2 <<= false; }; tolower2 << [=] { toupper2 <<= false; initcaps2 <<= false; }; initcaps2 << [=] { toupper2 <<= false; tolower2 <<= false; }; for(Ctrl *q = GetFirstChild(); q; q = q->GetNext()) if(dynamic_cast<Option *>(q)) *q << [=] { Refresh(); }; name << [=] { Refresh(); }; Refresh(); view.Highlight("cpp"); view.HideBar(); view.SetFont(CourierZ(12)); if(cursor.GetCount()) sel <<= cursor; else for(int i = 0; i < layout.item.GetCount(); i++) sel.Add(i); }
NAMESPACE_UPP #define LLOG(x) // LOG(x) #define LTIMING(x) // RTIMING(x) LineEdit::LineEdit() { isdrag = false; nohbar = false; showtabs = false; tabsize = 4; font = CourierZ(12); SetFrame(ViewFrame()); sb.NoBox(); AddFrame(sb); sb.WhenScroll = THISBACK(Scroll); cutline = true; bordercolumn = -1; bordercolor = Null; overwrite = false; filter = NULL; showspaces = false; showlines = false; showreadonly = true; dorectsel = false; hline = Null; warnwhitespace = false; }
RGBACtrl::RGBACtrl() { color = Black(); BackPaint(); Add(ramp); ramp <<= THISBACK(Ramp); Add(alpha); alpha <<= THISBACK(Alpha); text.SetFont(CourierZ(11)); text.NoWantFocus(); text.SetReadOnly(); Add(text); SyncText(); }
void LineEdit::LeftDrag(Point p, dword flags) { int c = GetMousePos(p); int l, h; if(!HasCapture() && GetSelection(l, h) && c >= l && c < h) { WString sample = GetW(l, min(h - l, 3000)); Size sz = StdSampleSize(); ImageDraw iw(sz); iw.DrawRect(sz, Black()); iw.Alpha().DrawRect(sz, Black()); DrawTLText(iw.Alpha(), 0, 0, 9999, sample, CourierZ(10), White()); NextUndo(); if(DoDragAndDrop(ClipFmtsText(), iw) == DND_MOVE && !IsReadOnly()) { RemoveSelection(); Action(); } } }
void AppPreview::Layout() { sb.SetTotal(line.GetCount()); sb.SetPage(GetSize().cy / CourierZ(12).GetHeight()); }