* updates for ux designer mode, supported controls: button, groupbox, checkbox, radiobox, edit, memo, richedit, listbox, combobox, progressbar, listview, treeview
git-svn-id: https://svn.code.sf.net/p/kolmck/code@149 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
This commit is contained in:
291
mckCtrlDraw.pas
291
mckCtrlDraw.pas
@ -1,5 +1,4 @@
|
|||||||
// ux themed
|
// ux themed. dufa
|
||||||
//dufa
|
|
||||||
unit mckCtrlDraw;
|
unit mckCtrlDraw;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -13,68 +12,92 @@ const
|
|||||||
WordWrapFlags: array[Boolean] of DWORD = (DT_SINGLELINE, 0);//!
|
WordWrapFlags: array[Boolean] of DWORD = (DT_SINGLELINE, 0);//!
|
||||||
CheckFlags: array[Boolean] of DWORD = (0, DFCS_CHECKED);
|
CheckFlags: array[Boolean] of DWORD = (0, DFCS_CHECKED);
|
||||||
|
|
||||||
procedure DrawButton(DC: HDC; R: TRect; aEnabled, aDefBtn: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawButton(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aDefBtn: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
procedure DrawEditBox(DC: HDC; R: TRect; aEnabled, aIsPwd: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawEditBox(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aIsPwd: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
procedure DrawMemo(DC: HDC; R: TRect; aEnabled: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawMemo(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aScrollH, aScrollV: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
procedure DrawCombobox(DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
procedure DrawCombobox(DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
procedure DrawLabel(DC: HDC; R: TRect; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawLabel(DC: HDC; R: TRect; dwTextFlags: DWORD; aText: WideString);
|
||||||
procedure DrawCheckbox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
procedure DrawCheckbox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
||||||
procedure DrawRadiobox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
procedure DrawRadiobox(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
||||||
procedure DrawListBox(DC: HDC; R: TRect; aEnabled: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawListBox(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
|
procedure DrawTreeView(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
|
procedure DrawListView(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aColumns: WideString);
|
||||||
|
procedure DrawProgressBar(DC: HDC; R: TRect; aVertical: Boolean; aProgress, aMaxProgress: Integer);
|
||||||
|
procedure DrawTrackBar(DC: HDC; R: TRect; aVertical: Boolean; aProgress, aMaxProgress: Integer);
|
||||||
|
procedure DrawGroupBox(aUX: Boolean; DC: HDC; R: TRect; aText: WideString);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure DrawButton(DC: HDC; R: TRect; aEnabled, aDefBtn: Boolean; dwTextFlags: DWORD; aText: WideString);
|
const
|
||||||
|
arrThemedEdit: array[Boolean] of TThemedEdit = (teEditTextDisabled, teEditTextNormal);
|
||||||
|
|
||||||
|
procedure DrawButton(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aDefBtn: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
const //enb defbtn
|
const //enb defbtn
|
||||||
arrTThemedButton: array[Boolean, Boolean] of TThemedButton =
|
arrThemedButton: array[Boolean, Boolean] of TThemedButton =
|
||||||
((tbPushButtonDisabled, tbPushButtonDisabled), (tbPushButtonNormal, tbPushButtonDefaulted));
|
((tbPushButtonDisabled, tbPushButtonDisabled), (tbPushButtonNormal, tbPushButtonDefaulted));
|
||||||
|
|
||||||
|
arrSimpleButton: array[Boolean] of DWORD = (DFCS_BUTTONPUSH or DFCS_INACTIVE, DFCS_BUTTONPUSH);
|
||||||
|
|
||||||
var
|
var
|
||||||
d: TThemedElementDetails;
|
d: TThemedElementDetails;
|
||||||
begin
|
begin
|
||||||
|
if ThemeServices.ThemesAvailable and aUX then begin
|
||||||
// get element
|
// get element
|
||||||
d := ThemeServices.GetElementDetails(arrTThemedButton[aEnabled, aDefBtn]);
|
d := ThemeServices.GetElementDetails(arrThemedButton[aEnabled, aDefBtn]);
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, R, nil);
|
ThemeServices.DrawElement(DC, d, R, nil);
|
||||||
// text
|
// text
|
||||||
ThemeServices.DrawText(DC, d, aText, R, dwTextFlags or DT_SINGLELINE, 0);
|
ThemeServices.DrawText(DC, d, aText, R, dwTextFlags or DT_SINGLELINE, 0);
|
||||||
|
end else begin
|
||||||
|
// draw defbtn
|
||||||
|
if aDefBtn then begin
|
||||||
|
// draw the defaulted border
|
||||||
|
FrameRect(DC, R, GetSysColorBrush(COLOR_WINDOWFRAME));
|
||||||
|
InflateRect(R, -1, -1);
|
||||||
|
end;
|
||||||
|
// draw element
|
||||||
|
DrawFrameControl(DC, R, DFC_BUTTON, arrSimpleButton[aEnabled]);
|
||||||
|
// draw text
|
||||||
|
SetBkMode(DC, TRANSPARENT);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT + Ord(aEnabled)));
|
||||||
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, dwTextFlags or DT_SINGLELINE);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawEditBox(DC: HDC; R: TRect; aEnabled, aIsPwd: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawEditBox(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aIsPwd: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
const
|
|
||||||
arrThemedEdit: array[Boolean] of TThemedEdit = (teEditTextDisabled, teEditTextNormal);
|
|
||||||
|
|
||||||
var
|
|
||||||
d: TThemedElementDetails;
|
|
||||||
// ss: WideString;
|
|
||||||
begin
|
begin
|
||||||
// get element
|
if ThemeServices.ThemesAvailable and aUX then begin
|
||||||
d := ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]);
|
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, r, nil);
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(arrThemedEdit[True]), r, nil);
|
||||||
// password text style
|
|
||||||
// ss := aText;
|
|
||||||
// if (Length(ss) > 0) and aIsPwd then
|
|
||||||
// ss := StrRepeat('*', Length(ss));
|
|
||||||
// draw text
|
// draw text
|
||||||
Inc(r.Left, 6);
|
Inc(r.Left, 6);
|
||||||
Inc(r.Top, 3);
|
Inc(r.Top, 3);
|
||||||
Dec(r.Right, 3);
|
Dec(r.Right, 3);
|
||||||
Dec(r.Bottom, 3);
|
Dec(r.Bottom, 3);
|
||||||
ThemeServices.DrawText(DC, d, {ss}aText, r, dwTextFlags or DT_SINGLELINE, 0);
|
ThemeServices.DrawText(DC, ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]), aText, r, dwTextFlags or DT_SINGLELINE, 0);
|
||||||
|
end else begin
|
||||||
|
// draw back
|
||||||
|
FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW));
|
||||||
|
DrawEdge(DC, R, EDGE_SUNKEN, BF_RECT or BF_ADJUST);
|
||||||
|
InflateRect(R, -4, -1);
|
||||||
|
// draw text
|
||||||
|
SetBkMode(DC, TRANSPARENT);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT + Ord(aEnabled)));
|
||||||
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, dwTextFlags or DT_SINGLELINE);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawMemo(DC: HDC; R: TRect; aEnabled: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawMemo(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aScrollH, aScrollV: Boolean; dwTextFlags: DWORD; aText: WideString);
|
||||||
const
|
|
||||||
arrThemedEdit: array[Boolean] of TThemedEdit = (teEditTextDisabled, teEditTextNormal);
|
|
||||||
|
|
||||||
var
|
var
|
||||||
d: TThemedElementDetails;
|
d: TThemedElementDetails;
|
||||||
|
w: Integer;
|
||||||
|
h: Integer;
|
||||||
begin
|
begin
|
||||||
// get element
|
if ThemeServices.ThemesAvailable and aUX then begin
|
||||||
d := ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]);
|
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, r, nil);
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(arrThemedEdit[True]), r, nil);
|
||||||
|
// v
|
||||||
|
if aScrollV then begin
|
||||||
// get element v-track
|
// get element v-track
|
||||||
d := ThemeServices.GetElementDetails(tsLowerTrackVertDisabled);
|
d := ThemeServices.GetElementDetails(tsLowerTrackVertDisabled);
|
||||||
// draw element
|
// draw element
|
||||||
@ -87,7 +110,9 @@ begin
|
|||||||
d := ThemeServices.GetElementDetails(tsArrowBtnDownDisabled);
|
d := ThemeServices.GetElementDetails(tsArrowBtnDownDisabled);
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, Rect(r.Right - 20, r.Bottom - 40, r.Right - 1, r.Bottom - 20), nil);
|
ThemeServices.DrawElement(DC, d, Rect(r.Right - 20, r.Bottom - 40, r.Right - 1, r.Bottom - 20), nil);
|
||||||
|
end;
|
||||||
|
// h
|
||||||
|
if aScrollH then begin
|
||||||
// get element h-track
|
// get element h-track
|
||||||
d := ThemeServices.GetElementDetails(tsLowerTrackHorzDisabled);
|
d := ThemeServices.GetElementDetails(tsLowerTrackHorzDisabled);
|
||||||
// draw element
|
// draw element
|
||||||
@ -100,64 +125,91 @@ begin
|
|||||||
d := ThemeServices.GetElementDetails(tsArrowBtnRightDisabled);
|
d := ThemeServices.GetElementDetails(tsArrowBtnRightDisabled);
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, Rect(r.Right - 40, r.Bottom - 20, r.Right - 20, r.Bottom - 1), nil);
|
ThemeServices.DrawElement(DC, d, Rect(r.Right - 40, r.Bottom - 20, r.Right - 20, r.Bottom - 1), nil);
|
||||||
|
end;
|
||||||
// draw text
|
// draw text
|
||||||
Inc(r.Left, 6);
|
Inc(r.Left, 6);
|
||||||
Inc(r.Top, 3);
|
Inc(r.Top, 3);
|
||||||
Dec(r.Right, 23);
|
Dec(r.Right, 23);
|
||||||
Dec(r.Bottom, 23);
|
Dec(r.Bottom, 23);
|
||||||
ThemeServices.DrawText(DC, d, aText, r, dwTextFlags, 0);
|
ThemeServices.DrawText(DC, ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]), aText, r, dwTextFlags, 0);
|
||||||
|
end else begin
|
||||||
|
// draw back
|
||||||
|
FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW));
|
||||||
|
DrawEdge(DC, R, EDGE_SUNKEN, BF_RECT or BF_ADJUST);
|
||||||
|
// v
|
||||||
|
if aScrollV then begin
|
||||||
|
// get btn size
|
||||||
|
w := GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
h := GetSystemMetrics(SM_CYVSCROLL);
|
||||||
|
// draw element v-track
|
||||||
|
FillRect(DC, Rect(R.Right - w, R.Top, R.Right, R.Bottom), GetSysColorBrush(COLOR_SCROLLBAR));
|
||||||
|
// draw element btn-up
|
||||||
|
DrawFrameControl(DC, Bounds(R.Right - w, R.Top, w, h), DFC_SCROLL, DFCS_SCROLLUP or DFCS_INACTIVE);
|
||||||
|
// get element btn-dn
|
||||||
|
DrawFrameControl(DC, Bounds(R.Right - w, R.Bottom - h * 2, w, h), DFC_SCROLL, DFCS_SCROLLDOWN or DFCS_INACTIVE);
|
||||||
|
end;
|
||||||
|
// h
|
||||||
|
if aScrollH then begin
|
||||||
|
// get btn size
|
||||||
|
w := GetSystemMetrics(SM_CXHSCROLL);
|
||||||
|
h := GetSystemMetrics(SM_CYHSCROLL);
|
||||||
|
// draw element v-track
|
||||||
|
FillRect(DC, Rect(R.Left, R.Bottom - h, R.Right - w, R.Bottom), GetSysColorBrush(COLOR_SCROLLBAR));
|
||||||
|
// draw element btn-left
|
||||||
|
DrawFrameControl(DC, Bounds(R.Left, R.Bottom - h, w, h), DFC_SCROLL, DFCS_SCROLLLEFT or DFCS_INACTIVE);
|
||||||
|
// get element btn-right
|
||||||
|
DrawFrameControl(DC, Bounds(R.Right - w * 2, R.Bottom - h, w, h), DFC_SCROLL, DFCS_SCROLLRIGHT or DFCS_INACTIVE);
|
||||||
|
end;
|
||||||
|
// draw text
|
||||||
|
InflateRect(R, -4, -1);
|
||||||
|
SetBkMode(DC, TRANSPARENT);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT + Ord(aEnabled)));
|
||||||
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, dwTextFlags);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawCombobox(DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
procedure DrawCombobox(DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
const
|
const
|
||||||
arrThemedComboBox: array[Boolean] of TThemedComboBox = (tcDropDownButtonDisabled, tcDropDownButtonNormal);
|
arrThemedComboBox: array[Boolean] of TThemedComboBox = (tcDropDownButtonDisabled, tcDropDownButtonNormal);
|
||||||
|
|
||||||
var
|
|
||||||
d: TThemedElementDetails;
|
|
||||||
begin
|
begin
|
||||||
// get element
|
|
||||||
d := ThemeServices.GetElementDetails(tcComboBoxRoot);
|
|
||||||
// draw element
|
// draw element
|
||||||
ThemeServices.DrawElement(DC, d, r, nil);
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(tcComboBoxRoot), r, nil);
|
||||||
// get element
|
|
||||||
d := ThemeServices.GetElementDetails(arrThemedComboBox[aEnabled]);
|
|
||||||
// draw element
|
// draw element
|
||||||
r.Left := r.Right - 18;
|
r.Left := r.Right - 18;
|
||||||
Inc(r.Top, 1);
|
Inc(r.Top, 1);
|
||||||
Dec(r.Right, 1);
|
Dec(r.Right, 1);
|
||||||
Dec(r.Bottom, 1);
|
Dec(r.Bottom, 1);
|
||||||
ThemeServices.DrawElement(DC, d, r, nil);
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(arrThemedComboBox[aEnabled]), r, nil);
|
||||||
// draw text
|
// draw text
|
||||||
r.Left := 6;
|
r.Left := 6;
|
||||||
Inc(r.Top, 2);
|
Inc(r.Top, 2);
|
||||||
Dec(r.Right, 18);
|
Dec(r.Right, 18);
|
||||||
Inc(r.Bottom, 1);
|
Inc(r.Bottom, 1);
|
||||||
ThemeServices.DrawText(DC, d, aText, r, DT_LEFT or DT_SINGLELINE, 0);
|
ThemeServices.DrawText(DC, ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]), aText, r, DT_LEFT or DT_SINGLELINE, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//TextHFlags[Sender.TextAlign] or TextVFlags[Sender.VerticalAlign] or WordWrapFlags[Sender.WordWrap]
|
//TextHFlags[Sender.TextAlign] or TextVFlags[Sender.VerticalAlign] or WordWrapFlags[Sender.WordWrap]
|
||||||
procedure DrawLabel(DC: HDC; R: TRect; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawLabel(DC: HDC; R: TRect; dwTextFlags: DWORD; aText: WideString);
|
||||||
begin
|
begin
|
||||||
// draw
|
// draw
|
||||||
FillRect(DC, r, HBRUSH(COLOR_BTNFACE + 1));
|
FillRect(DC, r, GetSysColorBrush(COLOR_BTNFACE));
|
||||||
SetBkMode(DC, TRANSPARENT);
|
SetBkMode(DC, TRANSPARENT);
|
||||||
DrawTextW(DC, PWideChar(aText), Length(aText), r, dwTextFlags);
|
DrawTextW(DC, PWideChar(aText), Length(aText), r, dwTextFlags);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawCheckbox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
procedure DrawCheckbox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
||||||
const //enb chk
|
const //enb chk
|
||||||
arrTThemedButton: array[Boolean, Boolean] of TThemedButton =
|
arrThemedCB: array[Boolean, Boolean] of TThemedButton =
|
||||||
((tbCheckBoxUncheckedDisabled, tbCheckBoxCheckedDisabled), (tbCheckBoxUncheckedNormal, tbCheckBoxCheckedNormal));
|
((tbCheckBoxUncheckedDisabled, tbCheckBoxCheckedDisabled), (tbCheckBoxUncheckedNormal, tbCheckBoxCheckedNormal));
|
||||||
|
|
||||||
var
|
var
|
||||||
d: TThemedElementDetails;
|
d: TThemedElementDetails;
|
||||||
rr: TRect;
|
rr: TRect;
|
||||||
begin
|
begin
|
||||||
// get element
|
|
||||||
d := ThemeServices.GetElementDetails(arrTThemedButton[aEnabled, aChecked]);
|
|
||||||
// draw back
|
// draw back
|
||||||
FillRect(DC, r, HBRUSH(COLOR_BTNFACE + 1));
|
FillRect(DC, r, GetSysColorBrush(COLOR_BTNFACE));
|
||||||
|
// get element
|
||||||
|
d := ThemeServices.GetElementDetails(arrThemedCB[aEnabled, aChecked]);
|
||||||
// draw border
|
// draw border
|
||||||
if aHasBorder then
|
if aHasBorder then
|
||||||
ThemeServices.DrawEdge(DC, d, r, EDGE_BUMP, BF_RECT or BF_MIDDLE);
|
ThemeServices.DrawEdge(DC, d, r, EDGE_BUMP, BF_RECT or BF_MIDDLE);
|
||||||
@ -169,45 +221,152 @@ begin
|
|||||||
ThemeServices.DrawText(DC, d, aText, r, DT_LEFT, 0);
|
ThemeServices.DrawText(DC, d, aText, r, DT_LEFT, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawRadiobox(DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
procedure DrawRadiobox(aUX: Boolean; DC: HDC; R: TRect; aEnabled, aChecked, aHasBorder: Boolean; aText: WideString);
|
||||||
const //enb chk
|
const //enb chk
|
||||||
arrFlags: array[Boolean, Boolean] of DWORD =
|
arrFlags: array[Boolean, Boolean] of DWORD =
|
||||||
((DFCS_INACTIVE, DFCS_CHECKED or DFCS_INACTIVE), (0, DFCS_CHECKED));
|
((DFCS_INACTIVE, DFCS_CHECKED or DFCS_INACTIVE), (0, DFCS_CHECKED));
|
||||||
|
//enb chk
|
||||||
|
arrThemedRB: array[Boolean, Boolean] of TThemedButton =
|
||||||
|
((tbRadioButtonUncheckedDisabled, tbRadioButtonCheckedDisabled),
|
||||||
|
(tbRadioButtonUncheckedNormal, tbRadioButtonCheckedNormal));
|
||||||
|
|
||||||
var
|
var
|
||||||
|
d: TThemedElementDetails;
|
||||||
rr: TRect;
|
rr: TRect;
|
||||||
begin
|
begin
|
||||||
// draw back
|
// draw back
|
||||||
FillRect(DC, r, HBRUSH(COLOR_BTNFACE + 1));
|
FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE));
|
||||||
|
// draw other
|
||||||
|
if aUX then begin
|
||||||
|
// get element
|
||||||
|
d := ThemeServices.GetElementDetails(arrThemedRB[aEnabled, aChecked]);
|
||||||
|
// draw border
|
||||||
|
if aHasBorder then
|
||||||
|
ThemeServices.DrawEdge(DC, d, R, EDGE_BUMP, BF_RECT or BF_MIDDLE);
|
||||||
|
// draw element
|
||||||
|
rr := Bounds(0, 0, 15, 15);
|
||||||
|
ThemeServices.DrawElement(DC, d, rr);
|
||||||
|
// draw text
|
||||||
|
r.Left := rr.Right + 2;
|
||||||
|
ThemeServices.DrawText(DC, d, aText, R, DT_LEFT, 0);
|
||||||
|
end else begin
|
||||||
// draw border
|
// draw border
|
||||||
if aHasBorder then
|
if aHasBorder then
|
||||||
DrawEdge(DC, r, EDGE_RAISED, BF_RECT or BF_MIDDLE);
|
DrawEdge(DC, r, EDGE_RAISED, BF_RECT or BF_MIDDLE);
|
||||||
// draw element
|
// draw element
|
||||||
rr := Bounds(r.Left + 2, (r.Bottom + r.Top - 13) div 2, 13, 13);
|
rr := Bounds(R.Left + 2, (R.Bottom + R.Top - 13) div 2, 13, 13);
|
||||||
DrawFrameControl(DC, rr, DFC_BUTTON, DFCS_BUTTONRADIO or arrFlags[aEnabled, aChecked]);
|
DrawFrameControl(DC, rr, DFC_BUTTON, DFCS_BUTTONRADIO or arrFlags[aEnabled, aChecked]);
|
||||||
// draw text
|
// draw text
|
||||||
Inc(r.left, 17);
|
Inc(R.Left, 17);
|
||||||
SetBkMode(DC, TRANSPARENT);
|
SetBkMode(DC, TRANSPARENT);
|
||||||
DrawTextW(DC, PWideChar(aText), Length(aText), r, DT_VCENTER or DT_SINGLELINE);
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, DT_VCENTER or DT_SINGLELINE);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawListBox(DC: HDC; R: TRect; aEnabled: Boolean; dwTextFlags: DWORD; aText: WideString);
|
procedure DrawListBox(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
const
|
begin
|
||||||
arrThemedEdit: array[Boolean] of TThemedListview = (tlListItemDisabled, tlListItemDisabled);
|
if ThemeServices.ThemesAvailable and aUX then begin
|
||||||
|
// draw element
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(tlListviewRoot), R, nil);
|
||||||
|
// draw text
|
||||||
|
Inc(R.Left, 3);
|
||||||
|
Inc(R.Top, 3);
|
||||||
|
Dec(R.Right, 3);
|
||||||
|
Dec(R.Bottom, 3);
|
||||||
|
ThemeServices.DrawText(DC, ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]), aText, R, DT_LEFT, 0);
|
||||||
|
end else begin
|
||||||
|
// draw back
|
||||||
|
FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW));
|
||||||
|
DrawEdge(DC, R, EDGE_SUNKEN, BF_RECT or BF_ADJUST);
|
||||||
|
InflateRect(R, -1, 0);
|
||||||
|
// draw text
|
||||||
|
SetBkMode(DC, TRANSPARENT);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_GRAYTEXT + Ord(aEnabled)));
|
||||||
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, DT_LEFT);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DrawTreeView(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aText: WideString);
|
||||||
|
begin
|
||||||
|
DrawListBox(aUX, DC, R, aEnabled, aText);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DrawListView(aUX: Boolean; DC: HDC; R: TRect; aEnabled: Boolean; aColumns: WideString);
|
||||||
var
|
var
|
||||||
|
w: WideString;
|
||||||
d: TThemedElementDetails;
|
d: TThemedElementDetails;
|
||||||
begin
|
begin
|
||||||
|
// draw main
|
||||||
|
DrawListBox(aUX, DC, R, aEnabled, '');
|
||||||
|
// columns
|
||||||
|
if (aColumns <> '') then begin
|
||||||
|
// draw head back
|
||||||
|
R := Bounds(2, 2, R.Right - 4, 20);
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(thHeaderRoot), R, nil);
|
||||||
|
// draw columns
|
||||||
|
R := Bounds(2, 2, 50, 20);
|
||||||
|
repeat
|
||||||
|
w := ParseW(aColumns, #13);
|
||||||
|
if (aColumns = '') and (w = '') then
|
||||||
|
Break
|
||||||
|
else begin
|
||||||
// get element
|
// get element
|
||||||
d := ThemeServices.GetElementDetails(arrThemedEdit[aEnabled]);
|
d := ThemeServices.GetElementDetails(thHeaderItemNormal);
|
||||||
// draw element
|
// draw head column
|
||||||
ThemeServices.DrawElement(DC, d, r, nil);
|
ThemeServices.DrawElement(DC, d, R, nil);
|
||||||
// draw text
|
// draw text
|
||||||
Inc(r.Left, 6);
|
Inc(R.Left, 10);
|
||||||
Inc(r.Top, 3);
|
ThemeServices.DrawText(DC, d, w, R, DT_LEFT or DT_VCENTER or DT_SINGLELINE, 0);
|
||||||
Dec(r.Right, 3);
|
// next
|
||||||
Dec(r.Bottom, 3);
|
Inc(R.Left, 40);
|
||||||
ThemeServices.DrawText(DC, d, aText, r, dwTextFlags, 0);
|
Inc(R.Right, 50);
|
||||||
|
end;
|
||||||
|
until False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DrawProgressBar(DC: HDC; R: TRect; aVertical: Boolean; aProgress, aMaxProgress: Integer);
|
||||||
|
begin
|
||||||
|
// draw bar
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(TThemedProgress(Ord(tpBar) + Ord(aVertical))), R, nil);
|
||||||
|
// draw progress
|
||||||
|
if aVertical then
|
||||||
|
R.Top := Trunc(R.Bottom - R.Bottom * aProgress / aMaxProgress)
|
||||||
|
else
|
||||||
|
R.Right := Trunc(R.Right * aProgress / aMaxProgress);
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(TThemedProgress(Ord(tpChunk) + Ord(aVertical))), R, nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DrawTrackBar(DC: HDC; R: TRect; aVertical: Boolean; aProgress, aMaxProgress: Integer);
|
||||||
|
begin
|
||||||
|
// draw root
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(ttbTrackBarRoot), R, nil);
|
||||||
|
// draw bar
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(ttbTrack), Bounds(8, 14, R.Right - 16, 4), nil);
|
||||||
|
// draw progress
|
||||||
|
R := Bounds(4 + Trunc(aProgress / aMaxProgress * R.Right), 0, GetSystemMetrics(SM_CXHTHUMB), R.Bottom);
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(ttbThumbBottomNormal), R, nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DrawGroupBox(aUX: Boolean; DC: HDC; R: TRect; aText: WideString);
|
||||||
|
begin
|
||||||
|
// draw background
|
||||||
|
FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE));
|
||||||
|
Inc(R.Top, 8);
|
||||||
|
// draw border
|
||||||
|
if ThemeServices.ThemesAvailable and aUX then begin
|
||||||
|
ThemeServices.DrawElement(DC, ThemeServices.GetElementDetails(tbGroupBoxNormal), R, nil);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_HIGHLIGHT));
|
||||||
|
end else begin
|
||||||
|
DrawEdge(DC, R, EDGE_ETCHED, BF_RECT);
|
||||||
|
SetTextColor(DC, GetSysColor(COLOR_BTNTEXT));
|
||||||
|
end;
|
||||||
|
// draw text
|
||||||
|
Inc(R.Left, 9);
|
||||||
|
Dec(R.Top, 8);
|
||||||
|
SetBkColor(DC, GetSysColor(COLOR_BTNFACE));
|
||||||
|
SetBkMode(DC, OPAQUE);
|
||||||
|
DrawTextW(DC, PWideChar(aText), Length(aText), R, DT_LEFT);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
120
mckCtrls.pas
120
mckCtrls.pas
@ -539,6 +539,9 @@ type
|
|||||||
function SupportsFormCompact: Boolean; override;
|
function SupportsFormCompact: Boolean; override;
|
||||||
procedure SetupConstruct_Compact; override;
|
procedure SetupConstruct_Compact; override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
|
procedure Paint; override;
|
||||||
constructor Create( AOwner: TComponent ); override;
|
constructor Create( AOwner: TComponent ); override;
|
||||||
function Pcode_Generate: Boolean; override;
|
function Pcode_Generate: Boolean; override;
|
||||||
published
|
published
|
||||||
@ -895,6 +898,9 @@ type
|
|||||||
function SupportsFormCompact: Boolean; override;
|
function SupportsFormCompact: Boolean; override;
|
||||||
procedure SetupConstruct_Compact; override;
|
procedure SetupConstruct_Compact; override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
|
procedure Paint; override;
|
||||||
constructor Create( AOwner: TComponent ); override;
|
constructor Create( AOwner: TComponent ); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Pcode_Generate: Boolean; override;
|
function Pcode_Generate: Boolean; override;
|
||||||
@ -993,6 +999,9 @@ type
|
|||||||
function SupportsFormCompact: Boolean; override;
|
function SupportsFormCompact: Boolean; override;
|
||||||
procedure SetupConstruct_Compact; override;
|
procedure SetupConstruct_Compact; override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
procedure Paint; override;
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
constructor Create( AOwner: TComponent ); override;
|
constructor Create( AOwner: TComponent ); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Pcode_Generate: Boolean; override;
|
function Pcode_Generate: Boolean; override;
|
||||||
@ -1215,6 +1224,9 @@ type
|
|||||||
procedure KOLControlRecreated; override;
|
procedure KOLControlRecreated; override;
|
||||||
function NoDrawFrame: Boolean; override;
|
function NoDrawFrame: Boolean; override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
procedure Paint; override;
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
constructor Create( AOwner: TComponent ); override;
|
constructor Create( AOwner: TComponent ); override;
|
||||||
function Pcode_Generate: Boolean; override;
|
function Pcode_Generate: Boolean; override;
|
||||||
function SupportsFormCompact: Boolean; override;
|
function SupportsFormCompact: Boolean; override;
|
||||||
@ -1360,6 +1372,9 @@ type
|
|||||||
procedure SaveColCount( Writer: TWriter );
|
procedure SaveColCount( Writer: TWriter );
|
||||||
procedure DoGenerateConstants( SL: TStringList ); override;
|
procedure DoGenerateConstants( SL: TStringList ); override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
procedure Paint; override;
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
procedure Loaded; override; {YS}
|
procedure Loaded; override; {YS}
|
||||||
function NoDrawFrame: Boolean; override;
|
function NoDrawFrame: Boolean; override;
|
||||||
procedure CreateKOLControl(Recreating: boolean); override;
|
procedure CreateKOLControl(Recreating: boolean); override;
|
||||||
@ -1478,6 +1493,9 @@ type
|
|||||||
procedure CreateKOLControl(Recreating: boolean); override;
|
procedure CreateKOLControl(Recreating: boolean); override;
|
||||||
function NoDrawFrame: Boolean; override;
|
function NoDrawFrame: Boolean; override;
|
||||||
public
|
public
|
||||||
|
//dufa
|
||||||
|
procedure Paint; override;
|
||||||
|
function WYSIWIGPaintImplemented: Boolean; override;
|
||||||
constructor Create( AOwner: TComponent ); override;
|
constructor Create( AOwner: TComponent ); override;
|
||||||
procedure NotifyLinkedComponent( Sender: TObject; Operation: TNotifyOperation ); override;
|
procedure NotifyLinkedComponent( Sender: TObject; Operation: TNotifyOperation ); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -2436,7 +2454,7 @@ begin
|
|||||||
Canvas.Font.Color := clBtnText;
|
Canvas.Font.Color := clBtnText;
|
||||||
Canvas.Brush.Color := clBtnFace;
|
Canvas.Brush.Color := clBtnFace;
|
||||||
//dufa
|
//dufa
|
||||||
DrawButton(Canvas.Handle, ClientRect, Enabled, DefaultBtn,
|
DrawButton(True, Canvas.Handle, ClientRect, Enabled, DefaultBtn,
|
||||||
TextHFlags[KOL.TTextAlign(TextAlign)] or TextVFlags[KOL.TVerticalAlign(VerticalAlign)], Caption);
|
TextHFlags[KOL.TTextAlign(TextAlign)] or TextVFlags[KOL.TVerticalAlign(VerticalAlign)], Caption);
|
||||||
end;
|
end;
|
||||||
inherited;
|
inherited;
|
||||||
@ -5003,6 +5021,15 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLGroupBox.Paint;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
DrawGroupBox(True, Canvas.Handle, ClientRect, Caption);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLGroupBox.Pcode_Generate: Boolean;
|
function TKOLGroupBox.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -5128,6 +5155,11 @@ begin
|
|||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLGroupBox.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TKOLCheckBox }
|
{ TKOLCheckBox }
|
||||||
|
|
||||||
constructor TKOLCheckBox.Create(AOwner: TComponent);
|
constructor TKOLCheckBox.Create(AOwner: TComponent);
|
||||||
@ -5389,7 +5421,7 @@ end;
|
|||||||
procedure TKOLRadioBox.Paint;
|
procedure TKOLRadioBox.Paint;
|
||||||
begin
|
begin
|
||||||
PrepareCanvasFontForWYSIWIGPaint( Canvas );
|
PrepareCanvasFontForWYSIWIGPaint( Canvas );
|
||||||
DrawRadioBox(Canvas.Handle, ClientRect, Enabled, Checked, HasBorder, Caption);
|
DrawRadioBox(True, Canvas.Handle, ClientRect, Enabled, Checked, HasBorder, Caption);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -5652,7 +5684,7 @@ begin
|
|||||||
//dufa
|
//dufa
|
||||||
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
DrawEditbox(Canvas.Handle, ClientRect, Enabled, (eoPassword in Options), TextHFlags[KOL.TTextAlign(TextAlign)], Caption);
|
DrawEditbox(True, Canvas.Handle, ClientRect, Enabled, (eoPassword in Options), TextHFlags[KOL.TTextAlign(TextAlign)], Caption);
|
||||||
end;
|
end;
|
||||||
{PrepareCanvasFontForWYSIWIGPaint( Canvas );
|
{PrepareCanvasFontForWYSIWIGPaint( Canvas );
|
||||||
|
|
||||||
@ -6070,7 +6102,7 @@ procedure TKOLMemo.Paint;
|
|||||||
begin
|
begin
|
||||||
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
DrawMemo(Canvas.Handle, ClientRect, Enabled, TextHFlags[KOL.TTextAlign(TextAlign)], Text.Text);
|
DrawMemo(True, Canvas.Handle, ClientRect, Enabled, True, True, TextHFlags[KOL.TTextAlign(TextAlign)], Text.Text);
|
||||||
end;
|
end;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
@ -6476,6 +6508,15 @@ begin
|
|||||||
Result:=HasBorder;
|
Result:=HasBorder;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLListBox.Paint;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
DrawListBox(True, Canvas.Handle, ClientRect, Enabled, Items.Text);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLListBox.Pcode_Generate: Boolean;
|
function TKOLListBox.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -6812,6 +6853,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLListBox.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TKOLComboBox }
|
{ TKOLComboBox }
|
||||||
|
|
||||||
function TKOLComboBox.AutoHeight(Canvas: TCanvas): Integer;
|
function TKOLComboBox.AutoHeight(Canvas: TCanvas): Integer;
|
||||||
@ -8133,6 +8179,11 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLListView.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TKOLListView.CreateKOLControl(Recreating: boolean);
|
procedure TKOLListView.CreateKOLControl(Recreating: boolean);
|
||||||
var
|
var
|
||||||
Opts: kol.TListViewOptions;
|
Opts: kol.TListViewOptions;
|
||||||
@ -8407,6 +8458,25 @@ begin
|
|||||||
Result := Result + inherited P_GenerateTransparentInits();
|
Result := Result + inherited P_GenerateTransparentInits();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLListView.Paint;
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
w: WideString;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
// cols
|
||||||
|
w := '';
|
||||||
|
if (Style = lvsDetail) then begin
|
||||||
|
for I := 0 to Pred(Cols.Count) do
|
||||||
|
w := w + Trim(TKOLListViewColumn(Cols[I]).Caption) + #13;
|
||||||
|
end;
|
||||||
|
// draw
|
||||||
|
DrawListView(True, Canvas.Handle, ClientRect, Enabled, w);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLListView.Pcode_Generate: Boolean;
|
function TKOLListView.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -8514,6 +8584,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLTreeView.Paint;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
DrawTreeView(True, Canvas.Handle, ClientRect, Enabled, Name);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLTreeView.Pcode_Generate: Boolean;
|
function TKOLTreeView.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -8829,6 +8908,11 @@ begin
|
|||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLTreeView.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TKOLRichEdit }
|
{ TKOLRichEdit }
|
||||||
|
|
||||||
function TKOLRichEdit.AdditionalUnits: String;
|
function TKOLRichEdit.AdditionalUnits: String;
|
||||||
@ -9020,6 +9104,15 @@ begin
|
|||||||
Result:=HasBorder;
|
Result:=HasBorder;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLRichEdit.Paint;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
DrawMemo(True, Canvas.Handle, ClientRect, Enabled, False, False, TextHFlags[KOL.TTextAlign(TextAlign)], Text.Text);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLRichEdit.Pcode_Generate: Boolean;
|
function TKOLRichEdit.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -9578,6 +9671,11 @@ begin
|
|||||||
Options := Options - [ eo_WantTab ];
|
Options := Options - [ eo_WantTab ];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLRichEdit.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TKOLProgressBar }
|
{ TKOLProgressBar }
|
||||||
|
|
||||||
constructor TKOLProgressBar.Create(AOwner: TComponent);
|
constructor TKOLProgressBar.Create(AOwner: TComponent);
|
||||||
@ -9633,6 +9731,15 @@ begin
|
|||||||
Result:=True;
|
Result:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TKOLProgressBar.Paint;
|
||||||
|
begin
|
||||||
|
if not (Assigned(FKOLCtrl) and (PaintType in [ptWYSIWIG, ptWYSIWIGFrames])) then begin
|
||||||
|
PrepareCanvasFontForWYSIWIGPaint(Canvas);
|
||||||
|
DrawProgressBar(Canvas.Handle, ClientRect, Vertical, Progress, MaxProgress);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
function TKOLProgressBar.Pcode_Generate: Boolean;
|
function TKOLProgressBar.Pcode_Generate: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TRUE;
|
Result := TRUE;
|
||||||
@ -9878,6 +9985,11 @@ begin
|
|||||||
Result := 'ProgressBarEx';
|
Result := 'ProgressBarEx';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TKOLProgressBar.WYSIWIGPaintImplemented: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TKOLTabControl }
|
{ TKOLTabControl }
|
||||||
|
|
||||||
procedure TKOLTabControl.AdjustPages;
|
procedure TKOLTabControl.AdjustPages;
|
||||||
|
Reference in New Issue
Block a user