From: <ah...@us...> - 2012-09-24 11:47:11
|
Revision: 13437 http://jvcl.svn.sourceforge.net/jvcl/?rev=13437&view=rev Author: ahuser Date: 2012-09-24 11:46:58 +0000 (Mon, 24 Sep 2012) Log Message: ----------- * Mantis #5937: TJvComboEdit unpublished properties NumbersOnly and TexhHint * Implemented TextHint for older Delphi versions, for non-themed applications and for Windows 2000. Modified Paths: -------------- trunk/jvcl/HooksAndHacks.txt trunk/jvcl/devtools/JvExVCL/src/JvExControls.macros trunk/jvcl/devtools/JvExVCL/src/JvExGrids.pas trunk/jvcl/devtools/JvExVCL/src/JvExMask.pas trunk/jvcl/devtools/JvExVCL/src/JvExStdCtrls.pas trunk/jvcl/run/JvBaseEdits.pas trunk/jvcl/run/JvCombobox.pas trunk/jvcl/run/JvDBControls.pas trunk/jvcl/run/JvDBLookup.pas trunk/jvcl/run/JvDBSearchEdit.pas trunk/jvcl/run/JvEdit.pas trunk/jvcl/run/JvExButtons.pas trunk/jvcl/run/JvExCheckLst.pas trunk/jvcl/run/JvExComCtrls.pas trunk/jvcl/run/JvExControls.pas trunk/jvcl/run/JvExDBGrids.pas trunk/jvcl/run/JvExExtCtrls.pas trunk/jvcl/run/JvExForms.pas trunk/jvcl/run/JvExGrids.pas trunk/jvcl/run/JvExMask.pas trunk/jvcl/run/JvExStdCtrls.pas trunk/jvcl/run/JvMaskEdit.pas trunk/jvcl/run/JvStringGrid.pas trunk/jvcl/run/JvToolEdit.pas trunk/jvcl/run/JvValidateEdit.pas Modified: trunk/jvcl/HooksAndHacks.txt =================================================================== --- trunk/jvcl/HooksAndHacks.txt 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/HooksAndHacks.txt 2012-09-24 11:46:58 UTC (rev 13437) @@ -18,3 +18,6 @@ JvPageSetup: * THackCommonDialog, hard typecast to get access to private fields + +JvToolEdit: + * TJvCustomComboEdit uses TCustomMaskEditAccessPrivate to get access to private field FSettingCursor Modified: trunk/jvcl/devtools/JvExVCL/src/JvExControls.macros =================================================================== --- trunk/jvcl/devtools/JvExVCL/src/JvExControls.macros 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/devtools/JvExVCL/src/JvExControls.macros 2012-09-24 11:46:58 UTC (rev 13437) @@ -5,7 +5,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit *) Modified: trunk/jvcl/devtools/JvExVCL/src/JvExGrids.pas =================================================================== --- trunk/jvcl/devtools/JvExVCL/src/JvExGrids.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/devtools/JvExVCL/src/JvExGrids.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -59,6 +59,8 @@ TJvExStringGrid = class(TStringGrid, IJvExControl) WINCONTROL_DECL + protected + property GridState: TGridState read FGridState; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/devtools/JvExVCL/src/JvExMask.pas =================================================================== --- trunk/jvcl/devtools/JvExVCL/src/JvExMask.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/devtools/JvExVCL/src/JvExMask.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -45,19 +45,52 @@ EDITCONTROL_DECL private FBeepOnError: Boolean; + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; protected procedure DoBeepOnError; dynamic; procedure SetBeepOnError(Value: Boolean); virtual; property BeepOnError: Boolean read FBeepOnError write SetBeepOnError default True; + + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} end; TJvExMaskEdit = class(TMaskEdit, IJvExControl) EDITCONTROL_DECL private FBeepOnError: Boolean; + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; protected procedure DoBeepOnError; dynamic; procedure SetBeepOnError(Value: Boolean); virtual; + + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + {$ENDIF ~COMPILER12_UP} + published + {$IFNDEF COMPILER12_UP} + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} property BeepOnError: Boolean read FBeepOnError write SetBeepOnError default True; end; @@ -75,6 +108,8 @@ BEGIN_EDITCONTROL_CONSTRUCTOR(CustomMaskEdit) FBeepOnError := True; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow END_CONSTRUCTOR EDITCONTROL_IMPL(CustomMaskEdit) @@ -92,8 +127,88 @@ FBeepOnError := Value; end; +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomMaskEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; + +procedure TJvExCustomMaskEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomMaskEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExCustomMaskEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomMaskEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExCustomMaskEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExCustomMaskEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + BEGIN_EDITCONTROL_CONSTRUCTOR(MaskEdit) FBeepOnError := True; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow END_CONSTRUCTOR EDITCONTROL_IMPL(MaskEdit) @@ -111,6 +226,84 @@ FBeepOnError := Value; end; +{$IFNDEF COMPILER12_UP} +procedure TJvExMaskEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; + +procedure TJvExMaskEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExMaskEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExMaskEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExMaskEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExMaskEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExMaskEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + {$IFDEF UNITVERSIONING} initialization RegisterUnitVersion(HInstance, UnitVersioning); Modified: trunk/jvcl/devtools/JvExVCL/src/JvExStdCtrls.pas =================================================================== --- trunk/jvcl/devtools/JvExVCL/src/JvExStdCtrls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/devtools/JvExVCL/src/JvExStdCtrls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -51,14 +51,49 @@ {$UNDEF HASAUTOSIZE} - EDITCONTROL_DECL_DEFAULT(CustomEdit) + TJvExCustomEdit = class(TCustomEdit, IJvExControl) + EDITCONTROL_DECL + private + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; + protected + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} + end; + EDITCONTROL_DECL_DEFAULT(CustomMemo) WINCONTROL_DECL_DEFAULT(CustomCombo) - WINCONTROL_DECL_DEFAULT(CustomComboBox) + TJvExCustomComboBox = class(TCustomComboBox, IJvExControl) + WINCONTROL_DECL + private + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; + function IsEditReadOnly: Boolean; + protected + procedure DoSetTextHint; {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure ComboWndProc(var Message: TMessage; ComboWnd: HWND; ComboProc: Pointer); override; + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} + end; + WINCONTROL_DECL_DEFAULT(ButtonControl) WINCONTROL_DECL_DEFAULT(Button) @@ -91,6 +126,18 @@ implementation +{$IFNDEF COMPILER12_UP} +const + ECM_FIRST = $1500; + EM_SETCUEBANNER = ECM_FIRST + 1; // Set the cue banner with the lParam = LPCWSTR + + CBM_FIRST = $1700; + CB_SETCUEBANNER = CBM_FIRST + 3; + +type + UnicodeString = WideString; +{$ENDIF ~COMPILER12_UP} + WINCONTROL_IMPL_DEFAULT(CustomGroupBox) {$DEFINE HASAUTOSIZE} @@ -101,14 +148,220 @@ {$UNDEF HASAUTOSIZE} -EDITCONTROL_IMPL_DEFAULT(CustomEdit) +BEGIN_EDITCONTROL_CONSTRUCTOR(CustomEdit) + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow +END_CONSTRUCTOR +EDITCONTROL_IMPL(CustomEdit) + +EDITCONTROL_WNDPROC(CustomEdit) + +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; + +procedure TJvExCustomEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExCustomEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExCustomEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExCustomEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + EDITCONTROL_IMPL_DEFAULT(CustomMemo) WINCONTROL_IMPL_DEFAULT(CustomCombo) -WINCONTROL_IMPL_DEFAULT(CustomComboBox) +BEGIN_WINCONTROL_CONSTRUCTOR(CustomComboBox) + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow +END_CONSTRUCTOR +WINCONTROL_IMPL(CustomComboBox) + +WINCONTROL_WNDPROC(CustomComboBox) + +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomComboBox.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint; + end; +end; + +procedure TJvExCustomComboBox.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint; +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomComboBox.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +function TJvExCustomComboBox.IsEditReadOnly: Boolean; +begin + Result := HandleAllocated and (GetWindowLong(FEditHandle, GWL_STYLE) and ES_READONLY <> 0); +end; + +procedure TJvExCustomComboBox.DoSetTextHint; +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint; + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if StyleServices.Enabled and HandleAllocated then + begin + if CheckWin32Version(6) then + SendMessage(Handle, CB_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(FTextHint)))) + else if CheckWin32Version(5, 1) then + SendMessage(FEditHandle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(FTextHint)))); + end; + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not IsEditReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomComboBox.ComboWndProc(var Message: TMessage; ComboWnd: HWND; ComboProc: Pointer); + + procedure EditPaintWindow(DC: HDC); + var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; + begin + if UserTextHint and (TextHint <> '') and + Enabled and not IsEditReadOnly and not Focused and (Text = '') then + begin + SendMessage(FEditHandle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; + end; + +var + DC: HDC; + PaintStruct: TPaintStruct; +begin + DC := 0; + try + if (ComboWnd = FEditHandle) and UserTextHint and (Message.Msg = WM_PAINT) then + begin + if TWMPaint(Message).DC = 0 then + begin + DC := BeginPaint(ComboWnd, PaintStruct); + TWMPaint(Message).DC := DC; + end; + end; + + inherited ComboWndProc(Message, ComboWnd, ComboProc); + + if ComboWnd = FEditHandle then + begin + case Message.Msg of + WM_PAINT: + EditPaintWindow(DC); + + WM_PRINTCLIENT: + EditPaintWindow(HDC(Message.WParam)); + + WM_KILLFOCUS, WM_SETFOCUS: + if UserTextHint and (TextHint <> '') then + Invalidate; + end; + end; + finally + if DC <> 0 then + begin + EndPaint(ComboWnd, PaintStruct); + TWMPaint(Message).DC := 0; + end; + end; +end; + WINCONTROL_IMPL_DEFAULT(ButtonControl) WINCONTROL_IMPL_DEFAULT(Button) Modified: trunk/jvcl/run/JvBaseEdits.pas =================================================================== --- trunk/jvcl/run/JvBaseEdits.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvBaseEdits.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -203,6 +203,11 @@ property OnMouseMove; property OnMouseUp; property OnStartDrag; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; TJvCustomCalcEdit = class(TJvCustomNumEdit) @@ -281,12 +286,10 @@ property Value; property Visible; property ZeroEmpty; - (* ++ RDB ++ *) property ClipboardCommands; property DisabledTextColor; property DisabledColor; - (* -- RDB -- *) - property DecimalPlacesAlwaysShown; {WAP Added.} + property DecimalPlacesAlwaysShown; property OnButtonClick; property OnChange; property OnClick; @@ -306,6 +309,11 @@ property OnStartDrag; property OnPopupHidden; property OnPopupShown; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvCombobox.pas =================================================================== --- trunk/jvcl/run/JvCombobox.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvCombobox.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -396,6 +396,11 @@ property OnMouseEnter; property OnMouseLeave; property OnParentColorChange; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvDBControls.pas =================================================================== --- trunk/jvcl/run/JvDBControls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvDBControls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -297,11 +297,14 @@ property OnContextPopup; property OnEndDock; property OnStartDock; - (* ++ RDB ++ *) property ClipboardCommands; property DisabledTextColor; property DisabledColor; - (* -- RDB -- *) + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF RTL230_UP} Modified: trunk/jvcl/run/JvDBLookup.pas =================================================================== --- trunk/jvcl/run/JvDBLookup.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvDBLookup.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -667,6 +667,11 @@ property OnContextPopup; property OnEndDock; property OnStartDock; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; Modified: trunk/jvcl/run/JvDBSearchEdit.pas =================================================================== --- trunk/jvcl/run/JvDBSearchEdit.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvDBSearchEdit.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -136,6 +136,11 @@ property OnMouseEnter; property OnMouseLeave; property OnParentColorChange; + + {$IFDEF COMPILER12_UP} + property NumbersOnly; + {$ENDIF} + property TextHint; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvEdit.pas =================================================================== --- trunk/jvcl/run/JvEdit.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvEdit.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -262,6 +262,14 @@ property OnStartDrag; property DataConnector; + + {$IFDEF COMPILER12_UP} + property NumbersOnly; + {$ENDIF} + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvExButtons.pas =================================================================== --- trunk/jvcl/run/JvExButtons.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExButtons.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExCheckLst.pas =================================================================== --- trunk/jvcl/run/JvExCheckLst.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExCheckLst.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExComCtrls.pas =================================================================== --- trunk/jvcl/run/JvExComCtrls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExComCtrls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExControls.pas =================================================================== --- trunk/jvcl/run/JvExControls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExControls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExDBGrids.pas =================================================================== --- trunk/jvcl/run/JvExDBGrids.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExDBGrids.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExExtCtrls.pas =================================================================== --- trunk/jvcl/run/JvExExtCtrls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExExtCtrls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExForms.pas =================================================================== --- trunk/jvcl/run/JvExForms.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExForms.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit Modified: trunk/jvcl/run/JvExGrids.pas =================================================================== --- trunk/jvcl/run/JvExGrids.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExGrids.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit @@ -398,7 +398,6 @@ procedure MouseLeave(AControl: TControl); reintroduce; dynamic; property MouseOver: Boolean read FMouseOver write FMouseOver; property HintColor: TColor read FHintColor write FHintColor default clDefault; - property GridState: TGridState read FGridState; property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave; property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged; @@ -429,6 +428,8 @@ {$ENDIF JVCLThemesEnabledD6} published property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False; + protected + property GridState: TGridState read FGridState; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvExMask.pas =================================================================== --- trunk/jvcl/run/JvExMask.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExMask.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit @@ -114,10 +114,25 @@ property ClipboardCommands: TJvClipboardCommands read FClipboardCommands write SetClipboardCommands default [caCopy..caUndo]; private FBeepOnError: Boolean; + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; protected procedure DoBeepOnError; dynamic; procedure SetBeepOnError(Value: Boolean); virtual; property BeepOnError: Boolean read FBeepOnError write SetBeepOnError default True; + + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} end; TJvExMaskEdit = class(TMaskEdit, IJvExControl) @@ -187,9 +202,27 @@ property ClipboardCommands: TJvClipboardCommands read FClipboardCommands write SetClipboardCommands default [caCopy..caUndo]; private FBeepOnError: Boolean; + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; protected procedure DoBeepOnError; dynamic; procedure SetBeepOnError(Value: Boolean); virtual; + + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + {$ENDIF ~COMPILER12_UP} + published + {$IFNDEF COMPILER12_UP} + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} property BeepOnError: Boolean read FBeepOnError write SetBeepOnError default True; end; @@ -211,6 +244,8 @@ FHintColor := clDefault; FClipboardCommands := [caCopy..caUndo]; FBeepOnError := True; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow end; function TJvExCustomMaskEdit.BaseWndProc(Msg: Cardinal; WParam: WPARAM = 0; LParam: LPARAM = 0): LRESULT; @@ -535,12 +570,92 @@ FBeepOnError := Value; end; +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomMaskEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; + +procedure TJvExCustomMaskEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomMaskEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExCustomMaskEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomMaskEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExCustomMaskEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExCustomMaskEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + constructor TJvExMaskEdit.Create(AOwner: TComponent); begin inherited Create(AOwner); FHintColor := clDefault; FClipboardCommands := [caCopy..caUndo]; FBeepOnError := True; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow end; function TJvExMaskEdit.BaseWndProc(Msg: Cardinal; WParam: WPARAM = 0; LParam: LPARAM = 0): LRESULT; @@ -865,6 +980,84 @@ FBeepOnError := Value; end; +{$IFNDEF COMPILER12_UP} +procedure TJvExMaskEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; + +procedure TJvExMaskEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExMaskEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExMaskEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExMaskEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExMaskEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExMaskEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + {$IFDEF UNITVERSIONING} initialization RegisterUnitVersion(HInstance, UnitVersioning); Modified: trunk/jvcl/run/JvExStdCtrls.pas =================================================================== --- trunk/jvcl/run/JvExStdCtrls.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvExStdCtrls.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -32,7 +32,7 @@ * WARNING: Do not edit this file. * This file is autogenerated from the source in devtools/JvExVCL/src. * If you do it despite this warning your changes will be discarded by the next - * update of this file. Do your changes in the template files. + * update of this file. Make your changes in the template files. ****************************************************************************} {$D-} // do not step into this unit @@ -258,6 +258,22 @@ protected procedure SetClipboardCommands(const Value: TJvClipboardCommands); virtual; property ClipboardCommands: TJvClipboardCommands read FClipboardCommands write SetClipboardCommands default [caCopy..caUndo]; + private + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; + protected + procedure DoSetTextHint(const Value: string); {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure PaintWindow(DC: HDC); override; + procedure WMSetFocus(var Msg: TWMSetFocus); message WM_SETFOCUS; + procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} end; TJvExCustomMemo = class(TCustomMemo, IJvExControl) @@ -449,6 +465,21 @@ {$ENDIF JVCLThemesEnabledD6} published property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False; + private + {$IFNDEF COMPILER12_UP} + FTextHint: string; + procedure SetTextHint(const Value: string); + {$ENDIF ~COMPILER12_UP} + function UserTextHint: Boolean; + function IsEditReadOnly: Boolean; + protected + procedure DoSetTextHint; {$IFDEF COMPILER12_UP}override;{$ELSE}virtual;{$ENDIF} + procedure ComboWndProc(var Message: TMessage; ComboWnd: HWND; ComboProc: Pointer); override; + + {$IFNDEF COMPILER12_UP} + procedure CreateWnd; override; + property TextHint: string read FTextHint write SetTextHint; + {$ENDIF ~COMPILER12_UP} end; TJvExButtonControl = class(TButtonControl, IJvExControl) @@ -1083,6 +1114,18 @@ implementation +{$IFNDEF COMPILER12_UP} +const + ECM_FIRST = $1500; + EM_SETCUEBANNER = ECM_FIRST + 1; // Set the cue banner with the lParam = LPCWSTR + + CBM_FIRST = $1700; + CB_SETCUEBANNER = CBM_FIRST + 3; + +type + UnicodeString = WideString; +{$ENDIF ~COMPILER12_UP} + constructor TJvExCustomGroupBox.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -1681,6 +1724,8 @@ inherited Create(AOwner); FHintColor := clDefault; FClipboardCommands := [caCopy..caUndo]; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow end; function TJvExCustomEdit.BaseWndProc(Msg: Cardinal; WParam: WPARAM = 0; LParam: LPARAM = 0): LRESULT; @@ -1994,8 +2039,84 @@ end; end; -//============================================================================ +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomEdit.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint(FTextHint); + end; +end; +procedure TJvExCustomEdit.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint(FTextHint); +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomEdit.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +procedure TJvExCustomEdit.DoSetTextHint(const Value: string); +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint(Value); + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if CheckWin32Version(5, 1) and StyleServices.Enabled and HandleAllocated then + SendMessage(Handle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(Value)))); + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not ReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomEdit.PaintWindow(DC: HDC); +var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; +begin + inherited PaintWindow(DC); + + if UserTextHint and (TextHint <> '') and + Enabled and not ReadOnly and not Focused and (Text = '') then + begin + SendMessage(Handle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; +end; + +procedure TJvExCustomEdit.WMKillFocus(var Msg: TWMKillFocus); +begin + inherited; + if UserTextHint and (TextHint <> '') then + Invalidate; +end; + +procedure TJvExCustomEdit.WMSetFocus(var Msg: TWMSetFocus); +begin + if UserTextHint and (TextHint <> '') then + Invalidate; + inherited; +end; + constructor TJvExCustomMemo.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -2609,6 +2730,8 @@ begin inherited Create(AOwner); FHintColor := clDefault; + if UserTextHint then + ControlState := ControlState + [csCustomPaint]; // needed for PaintWindow end; function TJvExCustomComboBox.BaseWndProc(Msg: Cardinal; WParam: WPARAM = 0; LParam: LPARAM = 0): LRESULT; @@ -2892,8 +3015,120 @@ end; end; -//============================================================================ +{$IFNDEF COMPILER12_UP} +procedure TJvExCustomComboBox.SetTextHint(const Value: string); +begin + if FTextHint <> Value then + begin + FTextHint := Value; + if not (csLoading in ComponentState) then + DoSetTextHint; + end; +end; +procedure TJvExCustomComboBox.CreateWnd; +begin + inherited CreateWnd; + DoSetTextHint; +end; +{$ENDIF ~COMPILER12_UP} + +function TJvExCustomComboBox.UserTextHint: Boolean; +begin + {$IFDEF JVCLThemesEnabled} + Result := not (CheckWin32Version(5, 1) and StyleServices.Enabled); + {$ELSE} + Result := True; + {$ENDIF JVCLThemesEnabled} +end; + +function TJvExCustomComboBox.IsEditReadOnly: Boolean; +begin + Result := HandleAllocated and (GetWindowLong(FEditHandle, GWL_STYLE) and ES_READONLY <> 0); +end; + +procedure TJvExCustomComboBox.DoSetTextHint; +begin + {$IFDEF COMPILER12_UP} + inherited DoSetTextHint; + {$ELSE} + {$IFDEF JVCLThemesEnabled} + if StyleServices.Enabled and HandleAllocated then + begin + if CheckWin32Version(6) then + SendMessage(Handle, CB_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(FTextHint)))) + else if CheckWin32Version(5, 1) then + SendMessage(FEditHandle, EM_SETCUEBANNER, WPARAM(0), LPARAM(PWideChar(UnicodeString(FTextHint)))); + end; + {$ENDIF JVCLThemesEnabled} + {$ENDIF COMPILER12_UP} + if UserTextHint and HandleAllocated and + not Focused and Enabled and not IsEditReadOnly and (Text = '') then + Invalidate; +end; + +procedure TJvExCustomComboBox.ComboWndProc(var Message: TMessage; ComboWnd: HWND; ComboProc: Pointer); + + procedure EditPaintWindow(DC: HDC); + var + R: TRect; + OldFont: HFONT; + OldTextColor: TColorRef; + begin + if UserTextHint and (TextHint <> '') and + Enabled and not IsEditReadOnly and not Focused and (Text = '') then + begin + SendMessage(FEditHandle, EM_GETRECT, 0, LPARAM(@R)); + + OldFont := SelectObject(DC, Font.Handle); + OldTextColor := SetTextColor(DC, ColorToRGB(clGrayText)); + DrawText(DC, PChar(TextHint), Length(TextHint), R, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); + + SetTextColor(DC, OldTextColor); + SelectObject(DC, OldFont); + end; + end; + +var + DC: HDC; + PaintStruct: TPaintStruct; +begin + DC := 0; + try + if (ComboWnd = FEditHandle) and UserTextHint and (Message.Msg = WM_PAINT) then + begin + if TWMPaint(Message).DC = 0 then + begin + DC := BeginPaint(ComboWnd, PaintStruct); + TWMPaint(Message).DC := DC; + end; + end; + + inherited ComboWndProc(Message, ComboWnd, ComboProc); + + if ComboWnd = FEditHandle then + begin + case Message.Msg of + WM_PAINT: + EditPaintWindow(DC); + + WM_PRINTCLIENT: + EditPaintWindow(HDC(Message.WParam)); + + WM_KILLFOCUS, WM_SETFOCUS: + if UserTextHint and (TextHint <> '') then + Invalidate; + end; + end; + finally + if DC <> 0 then + begin + EndPaint(ComboWnd, PaintStruct); + TWMPaint(Message).DC := 0; + end; + end; +end; + constructor TJvExButtonControl.Create(AOwner: TComponent); begin inherited Create(AOwner); Modified: trunk/jvcl/run/JvMaskEdit.pas =================================================================== --- trunk/jvcl/run/JvMaskEdit.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvMaskEdit.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -183,6 +183,11 @@ property OnSetFocus; property OnKillFocus; property OnStartDrag; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF UNITVERSIONING} Modified: trunk/jvcl/run/JvStringGrid.pas =================================================================== --- trunk/jvcl/run/JvStringGrid.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvStringGrid.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -142,7 +142,8 @@ procedure InvalidateRow(ARow: Integer); procedure MoveColumn(FromIndex, ToIndex: Integer); procedure MoveRow(FromIndex, ToIndex: Longint); - property GridState; + + property GridState: TGridState read FGridState; property InplaceEditor; // Calculates and sets the width of a specific column or all columns if Index < 0 Modified: trunk/jvcl/run/JvToolEdit.pas =================================================================== --- trunk/jvcl/run/JvToolEdit.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvToolEdit.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -505,6 +505,14 @@ property OnPopupHidden; property OnPopupChange; property OnPopupValueAccepted; + + {$IFDEF COMPILER12_UP} + property NumbersOnly; + {$ENDIF} + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; { TJvFileDirEdit } @@ -576,6 +584,11 @@ {$ELSE} property OEMConvert default True; // Mantis 3621 {$ENDIF UNICODE} + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; TFileDialogKind = (dkOpen, dkSave, dkOpenPicture, dkSavePicture); @@ -1085,6 +1098,11 @@ property OnPopupShown; property DataConnector; + + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; EComboEditError = class(EJVCLException); @@ -1132,9 +1150,11 @@ {$R JvToolEdit.res} type - {$HINTS OFF} TCustomMaskEditAccessPrivate = class(TCustomEdit) - private + protected + {$IFDEF COMPILER18_UP} + {$MESSAGE WARNING 'Check if Vcl.Mask.TCustomMaskEdit still has the exact same fields and adjust the IFDEF'} + {$ENDIF} // Do not remove these fields, although they are not used. FEditMask: TEditMask; FMaskBlank: Char; @@ -1144,9 +1164,8 @@ FCaretPos: Integer; FBtnDownX: Integer; FOldValue: string; - FSettingCursor: Boolean; + FSettingCursor: Boolean; // << this field can't be read end; - {$HINTS ON} TCustomEditAccessProtected = class(TCustomEdit); TCustomFormAccessProtected = class(TCustomForm); Modified: trunk/jvcl/run/JvValidateEdit.pas =================================================================== --- trunk/jvcl/run/JvValidateEdit.pas 2012-09-19 14:21:04 UTC (rev 13436) +++ trunk/jvcl/run/JvValidateEdit.pas 2012-09-24 11:46:58 UTC (rev 13437) @@ -337,6 +337,14 @@ property OnIsValid; property OnDecimalRounding; property DataConnector; + + {$IFDEF COMPILER12_UP} + //property NumbersOnly; + {$ENDIF} + {$IFDEF COMPILER14_UP} + property Touch; + {$ENDIF COMPILER14_UP} + property TextHint; end; {$IFDEF UNITVERSIONING} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |