📄 zqoutlookbar.h
字号:
//---------------------------------------------------------------------------
#ifndef zqOutlookBarH
#define zqOutlookBarH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <DesignEditors.hpp>
//---------------------------------------------------------------------------
class TzqOutlookItem;
class TzqOutlookPanel;
class TzqOutlookBar;
class PACKAGE TzqCustomOutlookBar : public TWinControl
{
public:
enum TBorderStyle {bsNone, bsSingle};
enum TIconStyle {isLarge, isSmall};
private:
TzqOutlookPanel* FActivePanel;
TBorderStyle FBorderStyle;
int FBorderWidth;
TCursor FButtonCursor;
TIconStyle FIconStyle;
int FItemHeight;
TImageList* FLargeImageList;
TList* FPanels;
TImageList* FSmallImageList;
int FTitleHeight;
void __fastcall SetActivePanel(TzqOutlookPanel*);
void __fastcall SetBorderStyle(TBorderStyle);
void __fastcall SetBorderWidth(int);
void __fastcall SetButtonCursor(TCursor);
void __fastcall SetIconStyle(TIconStyle);
void __fastcall SetItemHeight(int);
void __fastcall SetLargeImageList(TImageList*);
void __fastcall SetSmallImageList(TImageList*);
void __fastcall SetTitleHeight(int);
TNotifyEvent FOnChange;
bool OnDestroy;
void __fastcall WndProc(TMessage &Message);
void __fastcall Notification(TComponent* ACompoment, TOperation Operation);
protected:
public:
__fastcall TzqCustomOutlookBar(TComponent* Owner);
__fastcall ~TzqCustomOutlookBar();
void __fastcall AddPanel(TzqOutlookPanel*);
void __fastcall RemovePanel(TzqOutlookPanel*);
__property TList* Panels = {read = FPanels};
__property TzqOutlookPanel *ActivePanel =
{read = FActivePanel, write = SetActivePanel};
__published:
__property Align;
__property Anchors;
__property Color;
__property Cursor;
__property Font;
__property ParentFont;
__property PopupMenu;
__property Visible;
__property OnCanResize;
__property OnResize;
__property TBorderStyle BorderStyle =
{read = FBorderStyle, write = SetBorderStyle, default = bsSingle};
__property int BorderWidth =
{read = FBorderWidth, write = SetBorderWidth};
__property TCursor ButtonCursor =
{read = FButtonCursor, write = SetButtonCursor};
__property TIconStyle IconStyle =
{read = FIconStyle, write = SetIconStyle};
__property int ItemHeight =
{read = FItemHeight, write = SetItemHeight};
__property TImageList* LargeImageList =
{read = FLargeImageList, write = SetLargeImageList};
__property TImageList* SmallImageList =
{read = FSmallImageList, write = SetSmallImageList};
__property int TitleHeight =
{read = FTitleHeight, write = SetTitleHeight};
__property TNotifyEvent OnChange =
{read = FOnChange, write = FOnChange};
};
//---------------------------------------------------------------------------
class PACKAGE TzqOutlookPanel : public TWinControl
{
public:
enum TScrollDirection {sdUp, sdDown};
typedef void __fastcall (__closure *TOutlookPanelScroll)
(TObject* Sender, TScrollDirection Direction);
private:
AnsiString FCaption;
TList* FItems;
TzqCustomOutlookBar* FOutlookBar;
bool FParentContainColor;
int FTopItemIndex;
bool FVisible;
void __fastcall SetCaption(AnsiString);
void __fastcall SetOutlookBar(TzqCustomOutlookBar*);
int __fastcall GetPanelIndex();
void __fastcall SetPanelIndex(int);
void __fastcall SetParentContainColor(bool);
void __fastcall SetTopItemIndex(int);
void __fastcall SetVisible(bool);
TNotifyEvent FOnCollapsed;
TNotifyEvent FOnExpanded;
TOutlookPanelScroll FOnScroll;
bool mDown;
bool mIn;
bool OnDestroy;
TWndMethod OriProc;
TWndMethod OriUpProc;
TWndMethod OriDownProc;
TWinControl* TitleBtn;
TWinControl* ScrollUpBtn;
TWinControl* ScrollDownBtn;
void __fastcall WndProc(TMessage &Message);
void __fastcall BtnProc(TMessage &Message);
void __fastcall ScrollUpProc(TMessage &Message);
void __fastcall ScrollDownProc(TMessage &Message);
void __fastcall SetPanelBounds();
void __fastcall Notification(TComponent* ACompoment, TOperation Operation);
protected:
public:
__fastcall TzqOutlookPanel(TComponent* Owner);
__fastcall ~TzqOutlookPanel();
TCursor ButtonCursor;
void __fastcall AddItem(TzqOutlookItem*);
void __fastcall RemoveItem(TzqOutlookItem*);
__published:
__property TzqCustomOutlookBar* OutlookBar =
{read = FOutlookBar, write = SetOutlookBar};
__property TList* Items = {read = FItems};
__property Color;
__property ParentColor;
__property Caption =
{read = FCaption, write = SetCaption};
__property int PanelIndex =
{read = GetPanelIndex, write = SetPanelIndex};
__property int TopItemIndex =
{read = FTopItemIndex, write = SetTopItemIndex, default = -1};
__property TNotifyEvent OnCollapsed =
{read = FOnCollapsed, write = FOnCollapsed};
__property TNotifyEvent OnExpanded =
{read = FOnExpanded, write = FOnExpanded};
__property TOutlookPanelScroll OnScroll =
{read = FOnScroll, write = FOnScroll};
__property bool Visible =
{read = FVisible, write = SetVisible, default = true};
};
//---------------------------------------------------------------------------
class PACKAGE TzqOutlookItem : public TWinControl
{
private:
AnsiString FCaption;
int FImageIndex;
TzqOutlookPanel* FOutlookPanel;
bool FVisible;
void __fastcall SetCaption(AnsiString);
int __fastcall GetItemIndex();
void __fastcall SetItemIndex(int);
void __fastcall SetImageIndex(int);
void __fastcall SetOutlookPanel(TzqOutlookPanel*);
void __fastcall SetVisible(bool);
TNotifyEvent FOnClick;
unsigned long CaptionLayout;
TFont* CaptionFont;
TRect CaptionRect;
TRect ImageRect;
Graphics::TBitmap* Image;
TWinControl* ItemBtn;
TWndMethod OriProc;
void __fastcall WndProc(TMessage &Message);
void __fastcall BtnProc(TMessage &Message);
void __fastcall SetItemBounds();
protected:
public:
__fastcall TzqOutlookItem(TComponent* Owner);
__fastcall ~TzqOutlookItem();
__property Color;
__published:
__property Caption =
{read = FCaption, write = SetCaption};
__property int ImageIndex =
{read = FImageIndex, write = SetImageIndex};
__property int ItemIndex =
{read = GetItemIndex, write = SetItemIndex};
__property TzqOutlookPanel* OutlookPanel =
{read = FOutlookPanel, write = SetOutlookPanel};
__property bool Visible =
{read = FVisible, write = SetVisible, default = true};
__property TNotifyEvent OnClick =
{read = FOnClick, write = FOnClick};
};
//---------------------------------------------------------------------------
class PACKAGE TzqOutlookBar : public TzqCustomOutlookBar
{
public:
private:
public:
__fastcall TzqOutlookBar(TComponent* Owner);
__published:
__property ActivePanel;
};
//---------------------------------------------------------------------------
class PACKAGE TzqOutlookEditor : public TDefaultEditor
{
private:
int __fastcall GetVerbCount(void);
AnsiString __fastcall GetVerb(int Index);
void __fastcall ExecuteVerb(int Index);
void __fastcall PrepareItem(int Index, const _di_IMenuItem AItem);
void __fastcall EditProperty(const _di_IProperty Prop, bool &Continue);
public:
};
//---------------------------------------------------------------------------
class PACKAGE TzqOutlookProperty : public TComponentProperty
{
private:
void __fastcall GetValues(TGetStrProc Proc);
public:
};
//---------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -