You've already forked lazarus-ccr
jvcllaz: Separation of designtime and runtime code and all packages complete. Use package names and location of the Delphi version (WILL BREAK EXISTING CODE). Update examples.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5436 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
36
components/jvcllaz/design/JvCtrls/JvCtrlsReg.pas
Normal file
36
components/jvcllaz/design/JvCtrls/JvCtrlsReg.pas
Normal file
@ -0,0 +1,36 @@
|
||||
unit JvCtrlsReg;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
{$R ../../resource/JvHTControlsReg.res}
|
||||
|
||||
uses
|
||||
Classes, JvDsgnConsts, JvHtControls, {JvDBHTLabel,} JvHint, JvHTHintForm,
|
||||
PropEdits, Controls;
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
// RegisterComponents(RsPaletteButton, [TJvHTButton]);
|
||||
RegisterComponents(RsPaletteLabel, [TJvHTLabel]);
|
||||
RegisterComponents(RsPaletteListComboTree, [TJvHTListBox, TJvHTComboBox]);
|
||||
RegisterComponents(RsPaletteNonVisual, [TJvHint]);
|
||||
|
||||
RegisterPropertyEditor(TypeInfo(TCaption), TJvHTLabel, 'Caption', TJvHintProperty);
|
||||
|
||||
(*
|
||||
RegisterComponents('JvHTControls', [TJvHTLabel, TJvHTComboBox, TJvHTListBox,
|
||||
TJvDBHTLabel, TJvHint]);
|
||||
*)
|
||||
end;
|
||||
|
||||
end.
|
||||
|
88
components/jvcllaz/design/JvCtrls/JvHTHintForm.lfm
Normal file
88
components/jvcllaz/design/JvCtrls/JvHTHintForm.lfm
Normal file
@ -0,0 +1,88 @@
|
||||
object JvHintEditor: TJvHintEditor
|
||||
Left = 200
|
||||
Height = 240
|
||||
Top = 108
|
||||
Width = 320
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = 'JvHtHint Editor'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 320
|
||||
Color = clBtnFace
|
||||
Constraints.MinHeight = 150
|
||||
Constraints.MinWidth = 200
|
||||
Icon.Data = {
|
||||
3E01000000000100010010101000010010002801000016000000280000001000
|
||||
0000200000000100040000000000C00000000000000000000000000000000000
|
||||
000000000000000080000080000000808000800000008000800080800000C0C0
|
||||
C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
|
||||
FF00000000000000000000000BBBB0000000000BB000BB000000000BB0000B00
|
||||
0000000BBB000BB00000000BBB000BB00000000000000BB00000000000000BB0
|
||||
0000000000000BB00000000000000BB00000000000000BB00000000000000BB0
|
||||
0000000000000BB0000000000000BBBB00000000000BBBBBB000000000000000
|
||||
0000FFFF0000F87F0000E73F0000E7BF0000E39F0000E39F0000FF9F0000FF9F
|
||||
0000FF9F0000FF9F0000FF9F0000FF9F0000FF9F0000FF0F0000FE070000FFFF
|
||||
0000
|
||||
}
|
||||
KeyPreview = True
|
||||
Position = poScreenCenter
|
||||
ShowHint = True
|
||||
LCLVersion = '1.7'
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 23
|
||||
Caption = 'Hint'
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object HintLabel: TLabel
|
||||
Left = 114
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 198
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
Caption = 'Drag mouse over this label to see hint'
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
WordWrap = True
|
||||
end
|
||||
object HintMemo: TMemo
|
||||
Left = 8
|
||||
Height = 157
|
||||
Top = 32
|
||||
Width = 304
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
OnChange = HintMemoChange
|
||||
OnKeyDown = HintMemoKeyDown
|
||||
ParentFont = False
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
end
|
||||
object BtnOk: TButton
|
||||
Left = 151
|
||||
Height = 25
|
||||
Top = 204
|
||||
Width = 75
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = '&OK'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
end
|
||||
object BtnCancel: TButton
|
||||
Left = 237
|
||||
Height = 25
|
||||
Top = 204
|
||||
Width = 75
|
||||
Anchors = [akRight, akBottom]
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
106
components/jvcllaz/design/JvCtrls/JvHTHintForm.pas
Normal file
106
components/jvcllaz/design/JvCtrls/JvHTHintForm.pas
Normal file
@ -0,0 +1,106 @@
|
||||
{-----------------------------------------------------------------------------
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
|
||||
the specific language governing rights and limitations under the License.
|
||||
|
||||
The Original Code is: JvHTHintEditor.PAS, released on 2002-07-04.
|
||||
|
||||
The Initial Developers of the Original Code are: Andrei Prygounkov <a dott prygounkov att gmx dott de>
|
||||
Copyright (c) 1999, 2002 Andrei Prygounkov
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
|
||||
located at http://jvcl.delphi-jedi.org
|
||||
|
||||
description : Design-time Hint Editor
|
||||
|
||||
Known Issues:
|
||||
-----------------------------------------------------------------------------}
|
||||
// $Id$
|
||||
|
||||
unit JvHTHintForm;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Controls, Forms, StdCtrls,
|
||||
PropEdits,
|
||||
JvHint;
|
||||
|
||||
type
|
||||
TJvHintEditor = class(TForm)
|
||||
HintMemo: TMemo;
|
||||
Label1: TLabel;
|
||||
BtnOk: TButton;
|
||||
BtnCancel: TButton;
|
||||
HintLabel: TLabel;
|
||||
procedure HintMemoChange(Sender: TObject);
|
||||
procedure HintMemoKeyDown(Sender: TObject; var Key: Word;
|
||||
{%H-}Shift: TShiftState);
|
||||
private
|
||||
public
|
||||
end;
|
||||
|
||||
TJvHintProperty = class(TStringProperty)
|
||||
public
|
||||
function GetAttributes: TPropertyAttributes; override;
|
||||
procedure Edit; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
//=== { TJvHintProperty } ====================================================
|
||||
|
||||
procedure TJvHintProperty.Edit;
|
||||
var
|
||||
OldHintWindowClass: THintWindowClass;
|
||||
begin
|
||||
OldHintWindowClass := HintWindowClass;
|
||||
with TJvHintEditor.Create(Application) do
|
||||
try
|
||||
HintMemo.Text := GetValue;
|
||||
HintWindowClass := TJvHTHintWindow;
|
||||
HintMemoChange(nil);
|
||||
if ShowModal = mrOk then
|
||||
SetValue(HintMemo.Text);
|
||||
finally
|
||||
Free;
|
||||
HintWindowClass := OldHintWindowClass;
|
||||
{ recreate hint window }
|
||||
Application.ShowHint := not Application.ShowHint;
|
||||
Application.ShowHint := not Application.ShowHint;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TJvHintProperty.GetAttributes: TPropertyAttributes;
|
||||
begin
|
||||
Result := inherited GetAttributes + [paDialog];
|
||||
end;
|
||||
|
||||
//=== { TJvHintEditor } ======================================================
|
||||
|
||||
procedure TJvHintEditor.HintMemoChange(Sender: TObject);
|
||||
begin
|
||||
HintLabel.Hint := HintMemo.Text;
|
||||
end;
|
||||
|
||||
procedure TJvHintEditor.HintMemoKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
//if Key = VK_ESCAPE then
|
||||
if Ord(Key) = 27 then //asn: With VisualCLX VK_ESCAPE <> 27
|
||||
BtnCancel.Click;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user