📄 jvqspeedbar.pas
字号:
procedure TJvSpeedItem.SetEditing(Value: Boolean);
begin
FEditing := Value;
if FEditing then
begin
FButton.Enabled := True;
FButton.Flat := False;
end
else
begin
SetEnabled(FEnabled);
if SpeedBar <> nil then
FButton.Flat := (sbFlatBtns in SpeedBar.Options);
end;
end;
function TJvSpeedItem.HasParent: Boolean;
begin
Result := True;
end;
procedure TJvSpeedItem.DefineProperties(Filer: TFiler);
function DoWrite: Boolean;
begin
if Assigned(Filer.Ancestor) then
Result := GetSectionName <> TJvSpeedItem(Filer.Ancestor).GetSectionName
else
Result := True;
end;
begin
inherited DefineProperties(Filer);
Filer.DefineProperty('Section', ReadSection, WriteSection, False);
Filer.DefineProperty('SectionName', ReadSectionName, WriteSectionName, DoWrite);
end;
procedure TJvSpeedItem.ReadSectionName(Reader: TReader);
begin
FSectionName := Reader.ReadString;
end;
procedure TJvSpeedItem.WriteSectionName(Writer: TWriter);
begin
Writer.WriteString(GetSectionName);
end;
procedure TJvSpeedItem.ReadSection(Reader: TReader);
begin
FSection := Reader.ReadInteger;
end;
procedure TJvSpeedItem.WriteSection(Writer: TWriter);
begin
UpdateSection;
Writer.WriteInteger(FSection);
end;
function TJvSpeedItem.GetParentComponent: TComponent;
begin
Result := FParent;
end;
procedure TJvSpeedItem.SetParentComponent(Value: TComponent);
var
I: Integer;
begin
if not (csLoading in ComponentState) then
begin
if FParent <> nil then
FParent.RemoveItem(Self);
if (Value <> nil) and (Value is TJvSpeedBar) then
begin
I := TJvSpeedBar(Value).SearchSection(FSectionName);
if I >= 0 then
FSection := I;
TJvSpeedBar(Value).AddItem(FSection, Self);
end;
end;
end;
procedure TJvSpeedItem.SetImageIndex(Value: Integer);
begin
if Value <> FImageIndex then
begin
FImageIndex := Value;
TJvSpeedBarButton(FButton).InvalidateGlyph;
FButton.Invalidate;
end;
end;
procedure TJvSpeedItem.ReadState(Reader: TReader);
begin
inherited ReadState(Reader);
if Reader.Parent is TJvSpeedBar then
begin
if FSectionName <> '' then
FSection := TJvSpeedBar(Reader.Parent).SearchSection(FSectionName);
TJvSpeedBar(Reader.Parent).AddItem(Max(FSection, 0), Self);
end;
end;
function TJvSpeedItem.GetSection: Integer;
begin
UpdateSection;
Result := FSection;
end;
procedure TJvSpeedItem.SetSection(Value: Integer);
begin
if SpeedBar = nil then
FSection := Value;
end;
function TJvSpeedItem.GetSectionName: string;
begin
UpdateSection;
if FSection >= 0 then
Result := FParent.Sections[FSection].Caption
else
Result := FSectionName;
end;
{
procedure TJvSpeedItem.SetSectionName(const Value: string);
begin
if FParent <> nil then FSection := FParent.SearchSection(Value)
else FSection := -1;
FSectionName := Value;
end;
}
procedure TJvSpeedItem.InvalidateItem;
begin
FSection := -1;
end;
procedure TJvSpeedItem.UpdateSection;
var
I: Integer;
begin
if FParent <> nil then
FParent.FindItem(Self, FSection, I)
else
FSection := -1;
end;
procedure TJvSpeedItem.SetEnabled(Value: Boolean);
begin
if (FButton.Enabled <> Value) or (FEnabled <> Value) then
begin
FEnabled := Value;
if not FEditing then
begin
if (SpeedBar <> nil) and Value then
FButton.Enabled := (Value and SpeedBar.Enabled)
else
FButton.Enabled := Value;
end;
end;
end;
procedure TJvSpeedItem.SetVisible(Value: Boolean);
begin
if (FButton.Visible <> Value) or (FVisible <> Value) or
(Value and (FButton.Parent = nil)) then
begin
FVisible := Value;
if (SpeedBar <> nil) and Value then
FButton.Visible := Value and SpeedBar.Visible
else
FButton.Visible := Value;
if Value then
FButton.Parent := SpeedBar;
end;
end;
function TJvSpeedItem.GetAllowAllUp: Boolean;
begin
Result := FButton.AllowAllUp;
end;
procedure TJvSpeedItem.SetAllowAllUp(Value: Boolean);
begin
FButton.AllowAllUp := Value;
end;
function TJvSpeedItem.GetAllowTimer: Boolean;
begin
Result := FButton.AllowTimer;
end;
procedure TJvSpeedItem.SetAllowTimer(Value: Boolean);
begin
FButton.AllowTimer := Value;
end;
function TJvSpeedItem.GetBtnCaption: TCaption;
begin
Result := FButton.Caption;
end;
procedure TJvSpeedItem.SetBtnCaption(const Value: TCaption);
begin
FButton.Caption := Value;
end;
function TJvSpeedItem.GetGroupIndex: Integer;
begin
Result := FButton.GroupIndex;
end;
procedure TJvSpeedItem.SetGroupIndex(Value: Integer);
begin
FButton.GroupIndex := Value;
end;
function TJvSpeedItem.GetOnClick: TNotifyEvent;
begin
Result := FButton.OnClick;
end;
procedure TJvSpeedItem.SetOnClick(Value: TNotifyEvent);
begin
FButton.OnClick := Value;
end;
function TJvSpeedItem.GetOnDblClick: TNotifyEvent;
begin
Result := FButton.OnDblClick;
end;
procedure TJvSpeedItem.SetOnDblClick(Value: TNotifyEvent);
begin
FButton.OnDblClick := Value;
end;
function TJvSpeedItem.GetOnMouseDown: TMouseEvent;
begin
Result := FButton.OnMouseDown;
end;
procedure TJvSpeedItem.SetOnMouseDown(Value: TMouseEvent);
begin
FButton.OnMouseDown := Value;
end;
function TJvSpeedItem.GetOnMouseMove: TMouseMoveEvent;
begin
Result := FButton.OnMouseMove;
end;
procedure TJvSpeedItem.SetOnMouseMove(Value: TMouseMoveEvent);
begin
FButton.OnMouseMove := Value;
end;
function TJvSpeedItem.GetOnMouseUp: TMouseEvent;
begin
Result := FButton.OnMouseUp;
end;
procedure TJvSpeedItem.SetOnMouseUp(Value: TMouseEvent);
begin
FButton.OnMouseUp := Value;
end;
function TJvSpeedItem.GetOnMouseEnter: TNotifyEvent;
begin
Result := FButton.OnMouseEnter;
end;
procedure TJvSpeedItem.SetOnMouseEnter(Value: TNotifyEvent);
begin
FButton.OnMouseEnter := Value;
end;
function TJvSpeedItem.GetOnMouseLeave: TNotifyEvent;
begin
Result := FButton.OnMouseLeave;
end;
procedure TJvSpeedItem.SetOnMouseLeave(Value: TNotifyEvent);
begin
FButton.OnMouseLeave := Value;
end;
function TJvSpeedItem.GetDown: Boolean;
begin
Result := FButton.Down;
end;
procedure TJvSpeedItem.SetDown(Value: Boolean);
begin
FButton.Down := Value;
end;
function TJvSpeedItem.GetGlyph: TBitmap;
begin
Result := FButton.Glyph;
end;
procedure TJvSpeedItem.SetGlyph(Value: TBitmap);
begin
FButton.Glyph := Value;
end;
function TJvSpeedItem.GetLayout: TButtonLayout;
begin
Result := FButton.Layout;
end;
procedure TJvSpeedItem.SetLayout(Value: TButtonLayout);
begin
FButton.Layout := Value;
end;
function TJvSpeedItem.GetMargin: Integer;
begin
Result := FButton.Margin;
end;
procedure TJvSpeedItem.SetMargin(Value: Integer);
begin
FButton.Margin := Value;
end;
function TJvSpeedItem.GetNumGlyphs: TJvNumGlyphs;
begin
Result := FButton.NumGlyphs;
end;
procedure TJvSpeedItem.SetNumGlyphs(Value: TJvNumGlyphs);
begin
FButton.NumGlyphs := Value;
end;
function TJvSpeedItem.GetParentShowHint: Boolean;
begin
Result := FButton.ParentShowHint;
end;
procedure TJvSpeedItem.SetParentShowHint(Value: Boolean);
begin
FButton.ParentShowHint := Value;
end;
function TJvSpeedItem.GetShowHint: Boolean;
begin
Result := FButton.ShowHint;
end;
procedure TJvSpeedItem.SetShowHint(Value: Boolean);
begin
FButton.ShowHint := Value;
end;
function TJvSpeedItem.GetFont: TFont;
begin
Result := FButton.Font;
end;
procedure TJvSpeedItem.SetFont(Value: TFont);
begin
FButton.Font := Value;
end;
function TJvSpeedItem.GetParentFont: Boolean;
begin
Result := FButton.ParentFont;
end;
procedure TJvSpeedItem.SetParentFont(Value: Boolean);
begin
FButton.ParentFont := Value;
end;
function TJvSpeedItem.IsFontStored: Boolean;
begin
Result := not ParentFont;
end;
function TJvSpeedItem.IsShowHintStored: Boolean;
begin
Result := not ParentShowHint;
end;
function TJvSpeedItem.GetSpacing: Integer;
begin
Result := FButton.Spacing;
end;
procedure TJvSpeedItem.SetSpacing(Value: Integer);
begin
FButton.Spacing := Value;
end;
function TJvSpeedItem.GetCursor: TCursor;
begin
Result := FButton.Cursor;
end;
procedure TJvSpeedItem.SetCursor(Value: TCursor);
begin
FButton.Cursor := Value;
end;
function TJvSpeedItem.GetHint: string;
begin
Result := FButton.Hint;
end;
procedure TJvSpeedItem.SetHint(const Value: string);
begin
FButton.Hint := Value;
end;
function TJvSpeedItem.GetAction: TBasicAction;
begin
Result := FButton.Action;
end;
procedure TJvSpeedItem.SetAction(Value: TBasicAction);
begin
FButton.Action := Value;
end;
procedure TJvSpeedItem.ButtonClick;
begin
FButton.ButtonClick;
end;
function TJvSpeedItem.CheckBtnMenuDropDown: Boolean;
begin
Result := FButton.CheckBtnMenuDropDown;
end;
procedure TJvSpeedItem.Click;
begin
FButton.Click;
end;
function TJvSpeedItem.GetTag: Longint;
begin
Result := inherited Tag;
end;
procedure TJvSpeedItem.SetTag(Value: Longint);
begin
inherited Tag := Value;
FButton.Tag := Value;
end;
function TJvSpeedItem.GetDropDownMenu: TPopupMenu;
begin
Result := FButton.DropDownMenu;
end;
procedure TJvSpeedItem.SetDropDownMenu(Value: TPopupMenu);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -