jvcllaz: Add TJvOfficeColorButton. Some cosmetic changes, less hints and warnings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7006 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-06-12 13:21:57 +00:00
parent 21b927cc27
commit 5d9aaa8380
19 changed files with 3290 additions and 31 deletions

View File

@ -90,10 +90,7 @@ procedure DrawDotNetControl(Control: TWinControl; AColor: TColor; InControl: Boo
procedure HandleDotNetHighlighting(Control: TWinControl; const Msg: TLMessage;
MouseOver: Boolean; Color: TColor);
procedure CreateWMMessage(var Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM); overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
//function CreateWMMessage(Msg: Integer; WParam: PtrInt; LParam: PtrInt): TLMessage; overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
//function CreateWMMessage(Msg: Integer; WParam: PtrInt; LParam: TControl): TLMessage; overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
procedure CreateWMMessage(out Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM); overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
function SmallPointToLong(const Pt: TSmallPoint): LongInt; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
function ShiftStateToKeyData(Shift: TShiftState): Longint;
function GetFocusedControl(AControl: TControl): TWinControl;
@ -303,7 +300,7 @@ end;
begin
end;
procedure CreateWMMessage(var Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM);
procedure CreateWMMessage(out Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM);
begin
Mesg.Msg := Msg;
Mesg.WParam := WParam;

View File

@ -47,7 +47,8 @@ interface
uses
LCLIntf, LCLType,
SysUtils, Classes, Graphics;
SysUtils, Classes, Graphics,
JvTypes;
const
(******************** NOT CONVERTED
@ -322,8 +323,10 @@ function TrueInflateRect(const R: TRect; const I: Integer): TRect;
{**** Color routines }
procedure RGBToHSV(R, G, B: Integer; var H, S, V: Integer);
function RGBToBGR(Value: Cardinal): Cardinal;
***********************************)
function ColorToPrettyName(Value: TColor): string;
function PrettyNameToColor(const Value: string): TColor;
(******************** NOT CONVERTED ***
{**** other routines }
procedure SwapInt(var Int1, Int2: Integer); {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE}
@ -366,6 +369,7 @@ function ReplaceAllStrings(const S: string; Words, Frases: TStrings): string;
function ReplaceStrings(const S: string; PosBeg, Len: Integer; Words, Frases: TStrings; var NewSelStart: Integer): string;
{ CountOfLines calculates the lines count in a string, S,
each line must be separated from another with CrLf sequence }
*****************************)
function CountOfLines(const S: string): Integer;
{ DeleteLines deletes all lines from strings which in the words, words.
The word of will be deleted from strings. }
@ -373,6 +377,7 @@ procedure DeleteOfLines(Ss: TStrings; const Words: array of string);
{ DeleteEmptyLines deletes all empty lines from strings, Ss.
Lines contained only spaces also deletes. }
procedure DeleteEmptyLines(Ss: TStrings);
(************************** NOT CONVERTED ************
{ SQLAddWhere addes or modifies existing where-statement, where,
to the strings, SQL.
Note: If strings SQL allready contains where-statement,
@ -3568,6 +3573,7 @@ begin
for I := 0 to Words.Count - 1 do
Result := ReplaceString(Result, Words[I], Frases[I]);
end;
*********************************)
function CountOfLines(const S: string): Integer;
begin
@ -3600,6 +3606,7 @@ begin
DeleteOfLines(Ss,['']);
end;
(************************* NOT CONVERTED ****
procedure SQLAddWhere(SQL: TStrings; const Where: string);
var
I, J: Integer;
@ -9667,6 +9674,7 @@ begin
(Value and $0000FF00) or
((Value and $000000FF) shl 16);
end;
*************************)
function ColorToPrettyName(Value: TColor): string;
var
@ -9728,6 +9736,7 @@ begin
Result := clNone;
end;
(********************** NOT CONVERTED ****
{$IFNDEF CLR}
function StartsText(const SubStr, S: string): Boolean;
begin

View File

@ -39,7 +39,9 @@ unit JvTypes;
interface
uses
Classes, Controls, Forms, Graphics, LMessages, SysUtils;
LCLType,
Classes, Controls, Forms, Graphics, LMessages, SysUtils,
JvResources;
const
MaxPixelCount = 32767;
@ -385,11 +387,12 @@ const
DefaultHotTrackColor = $00D2BDB6;
DefaultHotTrackFrameColor = $006A240A;
(********************
type
(******************** NOT CONVERTED ***********
// from JvListView.pas
TJvSortMethod = (smAutomatic, smAlphabetic, smNonCaseSensitive, smNumeric, smDate, smTime, smDateTime, smCurrency);
TJvListViewColumnSortEvent = procedure(Sender: TObject; Column: Integer; var AMethod: TJvSortMethod) of object;
**********************************************)
// from JvOfficeColorPanel.pas
TJvAddInControlSiteInfo = record
@ -404,6 +407,10 @@ type
TJvColorQuadLayOut = (cqlNone, cqlLeft, cqlRight, cqlClient);
TJvGetAddInControlSiteInfoEvent = procedure(Sender: TControl; var ASiteInfo: TJvAddInControlSiteInfo) of object;
TJvColorDialogOption = (jcdFullOpen, jcdPreventFullOpen, jcdShowHelp,
jcdSolidColor, jcdAnyColor);
TJvColorDialogOptions = set of TJvColorDialogOption;
// from JvColorProvider.pas
TColorType = (ctStandard, ctSystem, ctCustom);
@ -417,19 +424,12 @@ const
ColCount = 20;
StandardColCount = 40;
SysColCount = 30;
{$IFDEF COMPILER5}
clSystemColor = TColor($80000000);
clHotLight = TColor(clSystemColor or COLOR_HOTLIGHT);
clGradientActiveCaption = TColor(clSystemColor or COLOR_GRADIENTACTIVECAPTION);
clGradientInactiveCaption = TColor(clSystemColor or COLOR_GRADIENTINACTIVECAPTION);
clMenuHighlight = TColor(clSystemColor or COLOR_MENUHILIGHT);
clMenuBar = TColor(clSystemColor or COLOR_MENUBAR);
{$ENDIF COMPILER5}
{$IFDEF COMPILER6}
{$IF not declared(clHotLight)}
{$MESSAGE ERROR 'You do not have installed Delphi 6 Update 2. Please install this before installing the JVCL. http://www.borland.com/downloads/registered/del6_reg_updates_prompt.html'}
{$IFEND}
{$ENDIF COMPILER6}
ColorValues: array [0 .. ColCount - 1] of TDefColorItem = (
(Value: clBlack; Constant: 'clBlack'; Description: RsClBlack),
@ -537,6 +537,7 @@ const
);
(********************** NOT CONVERTED ****
type
TJvSizeRect = packed record
Top: Integer;
@ -692,6 +693,9 @@ type
{$ENDIF !CLR}
***************)
function DrawTextBiDiModeFlags(AControl: TControl; AFlags: LongInt): LongInt;
implementation
{ TJvPersistent }
@ -788,5 +792,29 @@ begin
Changed;
end;
{------------------------------------------------------------------------------}
function DrawTextBiDiModeFlags(AControl: TControl; AFlags: LongInt): LongInt;
var
alignment: TAlignment;
begin
Result := AFlags;
if AControl.UseRightToLeftAlignment then begin
if AFlags and DT_RIGHT <> 0 then
alignment := taRightJustify
else
if AFlags and DT_CENTER <> 0 then
alignment := taCenter
else
alignment := taLeftJustify;
case alignment of
taLeftJustify: Result := Result or DT_RIGHT;
taRightJustify: Result := Result and not DT_RIGHT;
end;
end;
if AControl.UseRightToLeftReading then
Result := Result or DT_RTLREADING;
end;
end.

View File

@ -270,6 +270,13 @@ begin
ts := Canvas.TextStyle;
ts.ShowPrefix := false;
ts.RightToLeft := IsRightToLeft;
ts.ExpandTabs := Flags and DT_EXPANDTABS <> 0;
ts.Wordbreak := Flags and DT_WORDBREAK <> 0;
ts.SingleLine := not ts.WordBreak;
ts.EndEllipsis := Flags and DT_END_ELLIPSIS <> 0;
ts.Alignment := taLeftJustify;
if Flags and DT_RIGHT <> 0 then ts.Alignment := taRightJustify;
if Flags and DT_CENTER <> 0 then ts.Alignment := taCenter;
Canvas.Font := Font;
if not Enabled then
begin

View File

@ -341,8 +341,8 @@ type
procedure SetSuperSubScriptRatio(const Value: Double);
protected
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override;
procedure CalculateSize(MaxWidth: integer; var NeededWidth, NeededHeight: integer);
{%H-}WithThemeSpace: Boolean); override;
procedure CalculateSize(MaxWidth: integer; out NeededWidth, NeededHeight: integer);
function ComputeLayoutRect: TRect;
procedure FontChanged(Sender: TObject); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
@ -895,7 +895,7 @@ begin
end;
procedure TJvCustomHTLabel.CalculateSize(MaxWidth: integer;
var NeededWidth, NeededHeight: integer);
out NeededWidth, NeededHeight: integer);
begin
Canvas.Handle;
Canvas.Font.Assign(Font);

View File

@ -126,6 +126,7 @@ procedure TJvMovableBevel.DoMove(Shift: TShiftState; DeltaX, DeltaY: Integer);
begin
// Must work on it in order to make expand and shrink the way coreldraw does when
// shift and ctrl keys are pressed.
{ If ssCtrl in shift then
begin
if Abs(FStartPoint.X - Left) < Abs(FStartPoint.Y - Top) then

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ interface
uses
LCLType, LCLIntf, LMessages, Types,
SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
JvTypes, JvExtComponent, JvExControls, JvHotTrackPersistent;
JvTypes, JvExtComponent, JvHotTrackPersistent;
type
TJvPanelResizeParentEvent = procedure(Sender: TObject; nLeft, nTop, nWidth, nHeight: Integer) of object;
@ -869,9 +869,7 @@ begin
Inc(BevelSize, BevelWidth);
InflateRect(ATextRect, -BevelSize, -BevelSize);
Flags := DT_EXPANDTABS or WORDWRAPS[MultiLine] or ALIGNMENTS[Alignment];
(*************** NOT CONVERTED ***
Flags := DrawTextBiDiModeFlags(Flags);
*********************************)
Flags := DrawTextBiDiModeFlags(Self, Flags);
//calculate required rectangle size
DrawText(ACanvas.Handle, PChar(Caption), -1, ATextRect, Flags or DT_CALCRECT);