📄 jvqinspector.pas
字号:
{******************************************************************************}
{* WARNING: JEDI VCL To CLX Converter generated unit. *}
{* Manual modifications will be lost on next release. *}
{******************************************************************************}
{-----------------------------------------------------------------------------
Project JEDI Visible Component Library (J-VCL)
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/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Marcel Bestebroer
<jedi_mbe (at) users (dot) sf (dot) net>.
Portions created by Marcel Bestebroer are Copyright (C) 2000 - 2002 mbeSoft.
All Rights Reserved.
******************************************************************************
Object Inspector like control which can inspect not only published
properties, but also variables, string lists (can be parsed as INI files)
anything you can think of (e.g. DataSet based or event based).
You may retrieve the latest version of this file at the Project JEDI home
page, located at http://www.delphi-jedi.org
RECENT CHANGES:
May 23, 2004, Markus Spoettl:
- Added DrawNameEndEllipsis property to Painter (1745)
- Fixed list-deactivate bugs (1651) and list drop-down bug 1672
May 3, 2004, Marcel Bestebroer:
- Additional checks for value list location and size.
- Correction list width calculation for non-ownerdrawn value lists.
May 3, 2004, Markus Spoettl:
- Right align value list instead of left align (compatible with both
Borland inspector and VS.NET property grid).
- Fixed width measurement for font name item (used empty font name if
fonts where not displayed in the actual font).
May 2, 2004, Markus Spoettl:
- Added iifOwnerDrawListMaxHeight flag; using this flag will result in
a fixed height owner draw list; the item height used will be that of
the tallest item in the list (i.e. DoMeasureListItem is called on each
item before the list is shown; the largest Height value returned will
be used as the list box's ItemHeight value).
- Font name item will use the new iifOwnerDrawListMaxHeight flag instead
of iifOwnerDrawListVariable.
Apr 30, 2004, Marcel Bestebroer:
- Using the MouseWheel during drop down, will no longer result in the
scrolling of the inspector. Unfortunately, it will also not scroll
the drop down list.
- Mantis 1617: Allow Ctrl+Enter to toggle Expanded state, Ctrl+Left to
collapse and Ctrl+Right to expand.
- Added UseFont property to TJvInspectorFontNameItem. When set to True
the actualy font represented is used to render the font name, \
otherwise the standard font is used. Note: the property defaults to
False which breaks backwards compatability. This is deliberate, since
the previous mechanism was to slow on slower machines to be usable.
Borland has the same default settings for the Object Inspector.
Apr 28, 2004, Markus Spoettl:
- Added rectangle around check mark boolean items (Mantis #1645).
- Exposed DropDownCount to specify the number of rows in a drop down
list (Mantis #1646).
- Fixed minor issue regarding item heights (Mantis #1647).
- Added default bkTile to TJvCustomInspector.BevelKind property.
Apr 23, 2004, Marcel Bestebroer:
- Added OnItemValueError event, which is fired when an exception occurs
during the Item's Apply method. If no handler is assigned, the
exception will be raised, otherwise the event handler is called.
Apr 16, 2004, Marcel Bestebroer:
- Fixed an issue regarding resizable items or items with non-default
sizes in combination with the .Net painter.
Apr 15, 2004, Marcel Bestebroer:
- Type mapper also mapped all types of the same class to the first
mapping of that class (as in all enums mapped to the first added
enum type mapping, all sets mapped to the first added set type
mapping, etc). Will be changed to allow mapping of descendants of
the specified class instead (or ranges of the integer types?) at a
later date.
Apr 11, 2004, Marcel Bestebroer:
- Index out of range errors and/or AV could show up when closing an
application. This happened mostly in cases where you had a number
of class items with sub items for the properties of that class.
- Corrected OnEnter/OnExit behavior of the inspector (often got fired
when switching from edit control back to inspector or edit control
of next/previous item).
- Added 'hide selection' support. The DotNET painter is currently the
only painter that supports this. When focus is moved out of the
inspector (and not to an inline edit control) the HideSelectColor and
HideSelectTextColor properties are used instead of the SelectedColor
and SelectedTextColor properties.
- .Net painter issue: divider line between two categories were missing
the pixels where the divider between the name and value should have
been.
- Various paint issues when the divider was dragged further left than
where the name started (expand/collapse button drawn over the value,
name selection rectangle partly visible above/below and to the left
of the value and other minor visual side effects).
- Class item editor can now be treated as a category.
Apr 10, 2004, Marcel Bestebroer:
- Double clicking a category item will now expand/collapse regardless
of the position of the mouse (used to work only when clicking left of
the divider bar). See mantis issue 1610.
- Changed the MatchPercentage of the type mapper (changing the weights
of the various parts so that a type info match will always override
a class+name match).
- Removed the mechanism used to save the edited value before the focus
changes or the editor button is clicked; the mechanism used would
change the selected item which is bad. Besides that, the saving can
be accomplished by either calling Apply on the item or use SaveValues
of the inspector.
- Editor events exposed at the inspector are renamed to OnEditorXxxx as
to not interfere (or to be confused) with the standard events
supported by the inspector (the inspector key and mouse events are now
also exposed by TJvInspector).
- Property Name was redeclared in TJvInspectorCustomCategory. It is now
properly overridden (with only a new write acces specifier specified).
Apr 9, 2004, Marcel Bestebroer:
- Any item can now be treated like a category item (not just
TJvInspectorCustomCategoryItem and descendants), using the IsCategory
virtual protected method. As a result the (Get)BaseCategory and
(Get)Category properties/methods will return a TJvCustomInspectorItem
instance.
- Set items main class can now be displayed as a category item; when the
new isfRenderAsCategory flag is specified, the set members are always
created as sub items (i.e. isfCreateMembers is implied to be set).
- AddComponent can now add any object instance (not only TComponent
instances). If not category name is specified, properties are added to
the root (Expanded parameter is ignored in this case).
- Add type mapper for TJvInspectorPropData. The mapper allows to map the
properties actual type to a custom type (e.g. a type generated by
JclGenerateEnumType). Mappings can be based on the class of the
instance, the name of the property and/or the type of the property.
Apr 8, 2004, Marcel Bestebroer:
- trigger the AfterDataCreate event in TJvCustomInspectorData.NewItem.
Mar 16, 2004, anonymous:
- do not show own class for TControl selection in property.
make sure that you set ComponentIndex to DisplayIndex
Feb 8, 2004, Olivier Sannier obones att altern dott org
- Introduced the TJvTypeInfoHelper class to help C++ Builder
users to get Type Information
- Corrected heaps of C++ Builder compatibility problems, especially
with parameters that are const pointers
Oct 10, 2003, Andreas Hausladen Andreas dott Hausladen att gmx dott de
- implemented Theming and MouseWheel
Oct 1, 2003, Warren Postma warrenpstma att hotmail dott com
- New Name, UserData properties in TJvInspectorCustomCategoryItem
September 30, Warren Postma warrenpstma att hotmail dott com
- New string property Name, in inspector and category items
(TJvCustomInspectorItem, and descendants, ie TJvInspectorCustomCategoryItem )
holds the variable name or property name or ini file entry name, whereas
the DisplayName is a description for the end-user only. Note that this is
sometimes duplicated by the Item.Data.Name, but sometimes Item.Data is nil,
so this becomes important as a backup.
- System Sound (Beep) on enter key removed.
-----------------------------------------------------------------------------}
// $Id: JvQInspector.pas,v 1.30 2005/02/06 14:06:12 asnepvangers Exp $
unit JvQInspector;
{$I jvcl.inc}
interface
uses
SysUtils, Classes, Contnrs, TypInfo, IniFiles,
QWindows, QMessages, QGraphics, QControls, QStdCtrls, QExtCtrls,
Qt, JvQExExtCtrls,
JvQAutoComplete, JvQJVCLUtils, JvQComponent, JvQTypes, JvQExControls;
const
{ Inspector Row Size constants }
irsNoReSize = $00000000;
irsNameHeight = $10000000;
irsValueHeight = $20000000;
irsItemHeight = $40000000;
irsValueMask = $0FFFFFFF;
type
// do not create instances of this class.
// use with TMemo/TEdit
TOpenEdit = class(TWidgetControl)
private
procedure SetModified(Value: Boolean);
function GetModified: Boolean;
procedure SetOnChange(Value: TNotifyEvent);
function GetOnChange: TNotifyEvent;
procedure SetReadOnly(Value: Boolean);
function GetReadOnly: Boolean;
procedure SetBorderStyle(Value: TBorderStyle);
function GetBorderStyle: TBorderStyle;
public
procedure SelectAll;
property Text: TCaption read GetText write SetText;
property Modified: Boolean read GetModified write SetModified;
property OnChange: TNotifyEvent read GetOnChange write SetOnChange;
property ReadOnly: Boolean read GetReadOnly write SetReadOnly;
property BorderStyle: TBorderStyle read GetBorderStyle write SetBorderStyle;
end;
TCustomEditAccessProtected = Class(TOpenEdit);
type
// early declarations
TJvCustomInspector = class;
TJvInspectorPainter = class;
TJvInspectorItemSizing = class;
TJvCustomInspectorItem = class;
TJvInspectorCompoundColumn = class;
TJvInspectorCustomCompoundItem = class;
TJvInspectorCustomCategoryItem = class;
TJvCustomInspectorData = class;
TJvInspectorRegister = class;
TJvCustomInspectorRegItem = class;
TJvInspectorEventData = class;
TJvInspectorPropData = class;
// For some reason, the hpp generator won't recognize our early
// declarations just yet, so we output them manually.
// In the process, we are careful to enclose them in a namespace
// declaration or we would create two ambiguities for those classes.
// The first one being between TJvCustomInspectorItem and
// Jvinspector::TJvCustomInspectorItem.
// This would puzzle the users quite a bit when they use the header
// and would force them to use an ugly #define to lift the ambiguity.
// And even so, this would trigger other problems.
// So we'd better be careful here.
{$HPPEMIT 'namespace Jvinspector'}
{$HPPEMIT '{'}
{$HPPEMIT 'class TJvCustomInspectorItem;'}
{$HPPEMIT 'class TJvCustomInspectorData;'}
(*$HPPEMIT '}'*)
{$HPPEMIT ''}
TInspectorItemFlag = (iifReadonly, iifHidden, iifExpanded, iifVisible,
iifQualifiedNames, iifAutoUpdate, iifMultiLine, iifValueList,
iifAllowNonListValues, iifOwnerDrawListFixed, iifOwnerDrawListVariable,
iifEditButton, iifEditFixed, iifOwnerDrawListMaxHeight);
TInspectorItemFlags = set of TInspectorItemFlag;
TInspectorSetFlag = (isfEditString, isfCreateMemberItems, isfRenderAsCategory);
TInspectorSetFlags = set of TInspectorSetFlag;
TInspectorClassFlag = (icfCreateMemberItems, icfShowClassName, icfRenderAsCategory);
TInspectorClassFlags = set of TInspectorClassFlag;
TInspectorComponentFlag = (icfShowOwnerNames, icfNoShowFirstOwnerName, icfSortComponents,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -