• 去除标题栏, 绘制标题栏,设置最大化不盖住任务栏


    unit TMEModelImputForm;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
    Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, GQIModelInput, TB2Item, TBX,
    lbDockFormControl, lbVIDDockStyle, lbVSNETDockStyle, Vcl.Menus, Vcl.ActnList,
    TBXDkPanels, TBXExtItems, TB2ExtItems, DockPanel, Vcl.ComCtrls, WizardPage,
    TBXStatusBars, TB2Dock, TB2Toolbar, Vcl.ExtCtrls, dxGDIPlusClasses, Vcl.Buttons,
    Vcl.StdCtrls, Vcl.ToolWin, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
    dxSkinsDefaultPainters, dxRibbonSkins, dxSkinsdxRibbonPainter, cxDropDownEdit,
    cxDBExtLookupComboBox, cxDBLookupComboBox, cxColorComboBox, cxCheckComboBox,
    cxStyles, cxClasses, Vcl.ImgList, dxBarApplicationMenu, dxRibbon, dxBar, dxSkinsCore,
    dxBarExtItems, cxBarEditItem, dxScreenTip, dxStatusBar, dxRibbonStatusBar,
    cxCheckGroup, cxSpinEdit, GAEAModelElementsFram, GGCInterface, TMEReportPreview,
    GAEAProjectNavBarFrm, StdActns, Vcl.AppEvnts;

    type
    //最大最小化按纽类
    TMDIButton = class(TBitbtn)
    private
    public
    //由于由Tbitn继承而来,因此需要屏蔽其获得焦点的消息
    procedure WndProc(var Msg: TMessage); override;
    end;

    TWindowMinimize = class(TWindowAction)
    public
    //按纽功能,将当前最前的子window状态改为wsMinimize;
    procedure ExecuteTarget(Target: TObject); override;
    end;

    TWindowRestore = class(TWindowAction)
    public
    //按纽功能,将当前最前的子window状态改为wsNormal;
    procedure ExecuteTarget(Target: TObject); override;
    end;

    TWindowCloseApp = class(TWindowAction)
    public
    //按纽功能,将关闭程序;
    procedure ExecuteTarget(Target: TObject); override;
    end;

    TWindowMax = class(TWindowAction)
    public
    //按纽功能,将最大化程序;
    procedure ExecuteTarget(Target: TObject); override;
    end;

    type
    TTMEModelInputForm = class(TGQIModelInputForm)
    {$REGION 'COMP_DEF'}
    cxImageList1: TcxImageList;
    cxImageList2: TcxImageList;
    tbi6: TTBXItem;
    dxRibbon1: TdxRibbon;
    dxTab_Device: TdxRibbonTab;
    dxBarManager1: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    dxBarManager1Bar5_: TdxBar;
    dxBarManager1Bar15_: TdxBar;
    dxBarManager1Bar22_: TdxBar;
    dxBarManager1Bar27_: TdxBar;
    dxBarButton1_New: TdxBarButton;
    dxBarButton2_Open: TdxBarButton;
    dxBarButton3_Save: TdxBarButton;
    dxBarButton4_SaveAs: TdxBarButton;
    dxBarButton11_Undo: TdxBarButton;
    dxBarButton12_Redo: TdxBarButton;
    dxBarSubItem1: TdxBarSubItem;
    dxBarToolbarsListItem1: TdxBarToolbarsListItem;
    dxBarSubItem3: TdxBarSubItem;
    dxBarSubItem4: TdxBarSubItem;
    dxBarSubItem5: TdxBarSubItem;
    dxBarSeparator1: TdxBarSeparator;
    dxBarSeparator2: TdxBarSeparator;
    dxBarSeparator3: TdxBarSeparator;
    dxBarSeparator4: TdxBarSeparator;
    dxBarSeparator5: TdxBarSeparator;
    dxBarSeparator6: TdxBarSeparator;
    dxBarSeparator7: TdxBarSeparator;
    dxBarSubItem6: TdxBarSubItem;
    dxBarSubItem7: TdxBarSubItem;
    dxBarSubItem8: TdxBarSubItem;
    dxBarSubItem9: TdxBarSubItem;
    dxBarSubItem10: TdxBarSubItem;
    dxBarSubItem11: TdxBarSubItem;
    dxBarSubItem12: TdxBarSubItem;
    dxBarSubItem13: TdxBarSubItem;
    dxBarSubItem14: TdxBarSubItem;
    dxBarSubItem17: TdxBarSubItem;
    dxBarSubItem18: TdxBarSubItem;
    dxBarSubItem19: TdxBarSubItem;
    dxBarSubItem20: TdxBarSubItem;
    dxBarSubItem21: TdxBarSubItem;
    dxBarButton121_IFC: TdxBarButton;
    dxBarButton122_TME: TdxBarButton;
    dxBarButton123_EntFile: TdxBarButton;
    dxBarButton124_BlockFile: TdxBarButton;
    dxBarSubItem22: TdxBarSubItem;
    dxBarSubItem23: TdxBarSubItem;
    dxBarButton126_PDF: TdxBarButton;
    dxBarButton127_DWG: TdxBarButton;
    dxBarButton128_EntFile: TdxBarButton;
    dxBarButton129_BlockFile: TdxBarButton;
    dxBarSubItem24_ProjSettings: TdxBarSubItem;
    dxBarButton130_FlorSettings: TdxBarButton;
    dxBarButton131_CalcRule: TdxBarButton;
    dxBarButton132_OtherSettings: TdxBarButton;
    dxBarButton133_Options: TdxBarButton;
    dxBarLargeButton73_DrawingFolder: TdxBarLargeButton;
    dxBarSubItem25_IO: TdxBarSubItem;
    dxBarSubItem26_Import: TdxBarSubItem;
    dxBarSubItem27: TdxBarSubItem;
    dxBarSubItem28: TdxBarSubItem;
    dxBarSubItem29_Export: TdxBarSubItem;
    dxBarSubItem30_: TdxBarSubItem;
    dxBarSubItem31_ScanDraw: TdxBarSubItem;
    dxBarSubItem32_: TdxBarSubItem;
    dxBarButton135_: TdxBarButton;
    dxBarButton136_Move: TdxBarButton;
    dxBarButton138_CADI: TdxBarButton;
    dxBarButton139_: TdxBarButton;
    dxBarButton140_InsertCADEpure: TdxBarButton;
    dxBarButton141_: TdxBarButton;
    dxBarButton142: TdxBarButton;
    dxBarButton143_: TdxBarButton;
    dxBarButton144_: TdxBarButton;
    dxBarButton145_: TdxBarButton;
    dxBarButton146_SetPlottingScale: TdxBarButton;
    dxBarButton147_: TdxBarButton;
    dxBarButton148_: TdxBarButton;
    dxBarSubItem33: TdxBarSubItem;
    dxBarButton150_: TdxBarButton;
    dxBarSubItem34_TextIden: TdxBarSubItem;
    dxBarButton152_TxtIdentigy: TdxBarButton;
    dxBarButton153_: TdxBarButton;
    dxDevice_Identify_: TdxBarSubItem;
    dxBarButton154_: TdxBarButton;
    dxBarButton155_: TdxBarButton;
    dxBarButton156_: TdxBarButton;
    dxBarSubItem37: TdxBarSubItem;
    dxBarSubItem38: TdxBarSubItem;
    dxBarButton160_PicLabelIden: TdxBarButton;
    dxBarSubItem42_: TdxBarSubItem;
    dxBarButton162_: TdxBarButton;
    dxBarButton163_: TdxBarButton;
    dxBarButton164_: TdxBarButton;
    dxBarButton169_: TdxBarButton;
    dxBarSubItem43_: TdxBarSubItem;
    dxBarButton170_ShrinkTxt: TdxBarButton;
    dxBarButton171_: TdxBarButton;
    dxBarSubItem44_: TdxBarSubItem;
    dxBarButton172_: TdxBarButton;
    dxBarButton173_: TdxBarButton;
    dxBarButton174_: TdxBarButton;
    dxBarSubItem45: TdxBarSubItem;
    dxBarSubItem46: TdxBarSubItem;
    dxBarButton175_: TdxBarButton;
    dxBarButton176_: TdxBarButton;
    dxBarButton179_: TdxBarButton;
    dxBarSubItem47: TdxBarSubItem;
    dxBarButton180: TdxBarButton;
    dxBarButton181_: TdxBarButton;
    dxBarButton182_: TdxBarButton;
    dxArrange_: TdxBarSubItem;
    dxBarButton184_: TdxBarButton;
    dxBarButton190_: TdxBarButton;
    dxBarButton191_: TdxBarButton;
    dxBarSubItem35_: TdxBarSubItem;
    dxBarButton192_: TdxBarButton;
    dxBarButton193_: TdxBarButton;
    dxBarButton194_: TdxBarButton;
    dxBarButton195_: TdxBarButton;
    dxBarButton196_: TdxBarButton;
    dxBarButton199_: TdxBarButton;
    dxBarSubItem36: TdxBarSubItem;
    dxBarButton202_: TdxBarButton;
    dxBarButton204_: TdxBarButton;
    dxBarButton168_: TdxBarButton;
    dxBarButton166_: TdxBarButton;
    dxBarButton167_: TdxBarButton;
    dxBarButton207_: TdxBarButton;
    dxBarButton209_: TdxBarButton;
    dxBarButton210_: TdxBarButton;
    dxBarButton_FullScreen: TdxBarButton;
    dxBarButton215: TdxBarButton;
    dxBarButton216_: TdxBarButton;
    dxBarButton217_: TdxBarButton;
    dxBarButton218_: TdxBarButton;
    dxBarButton29_FlorDisplaySettings: TdxBarButton;
    dxModify_: TdxBarSubItem;
    dxBarButton30_: TdxBarButton;
    dxBarButton31_: TdxBarButton;
    dxBarButton32_: TdxBarButton;
    dxBarButton33_: TdxBarButton;
    dxBarButton34_: TdxBarButton;
    dxBarButton35_: TdxBarButton;
    dxBarButton36_: TdxBarButton;
    dxBarLargeButton21_IdenOption: TdxBarLargeButton;
    dxBarButton1: TdxBarButton;
    dxBarApplicationMenu1: TdxBarApplicationMenu;
    dxPopupMenu_Layer: TdxRibbonPopupMenu;
    dxPopupMenu_3D: TdxRibbonPopupMenu;
    dxPopupMenu_Color: TdxRibbonPopupMenu;
    dxPopup_Select: TdxRibbonPopupMenu;
    dxBarButton2: TdxBarButton;
    dxBarButton3: TdxBarButton;
    dxBarButton4: TdxBarButton;
    dxBarButton5_Rotate: TdxBarButton;
    dxBarButton6: TdxBarButton;
    dxPipe_Identify: TdxBarSubItem;
    dxBarButton_SingleLine: TdxBarButton;
    dxBarButton_DoubleLine: TdxBarButton;
    dxBarButton_AutoIdenWaterPipe: TdxBarButton;
    dxBarButton9: TdxBarButton;
    dxBarButton10: TdxBarButton;
    dxBarButton11: TdxBarButton;
    dxBarButton12: TdxBarButton;
    dxBarButton13_: TdxBarButton;
    dxBarButton14: TdxBarButton;
    dxPopup_Tool: TdxRibbonPopupMenu;
    dxBarButton15: TdxBarButton;
    dxBarButton16: TdxBarButton;
    cxBarEditItem1: TcxBarEditItem;
    dxBarCombo1: TdxBarCombo;
    cxBarEditItem2: TcxBarEditItem;
    dxBarButton17: TdxBarButton;
    CustomdxBarCombo1: TCustomdxBarCombo;
    cxBarEditItem3: TcxBarEditItem;
    cxBarEditItem4: TcxBarEditItem;
    dxBarButton19: TdxBarButton;
    dxBarButton18: TdxBarButton;
    dxBarButton20: TdxBarButton;
    dxfloors: TdxBarCombo;
    dxBarButton5: TdxBarButton;
    dxBarButton21: TdxBarButton;
    dxBarButton22: TdxBarButton;
    dxBarButton23: TdxBarButton;
    dxBarButton24: TdxBarButton;
    dxBarButton25: TdxBarButton;
    dxBarButton13: TdxBarButton;
    tbi9_EntTree: TTBXItem;
    tbi_EntEditor: TTBXItem;
    TBXSeparatorItem27: TTBXSeparatorItem;
    dxBarButton_FirePipeMarkIdentify: TdxBarButton;
    dxBarButton27: TdxBarButton;
    dxBarButton_AutoIdenDuct: TdxBarButton;
    dxBarButton7: TdxBarButton;
    dxBarButton_CircuitIden: TdxBarButton;
    dxBarButton_IdenCableTray: TdxBarButton;
    dxBarButton8: TdxBarButton;
    dxBarButton26: TdxBarButton;
    spl1: TSplitter;
    dxBarButton29_Copy: TdxBarButton;
    dxBarButton28_RotateCadImageID: TdxBarButton;
    dxBarButton28: TdxBarButton;
    dxBarButton29: TdxBarButton;
    dxBarButton30: TdxBarButton;
    dxBarSeparator8: TdxBarSeparator;
    dxBarButton31: TdxBarButton;
    dxBarSeparator9: TdxBarSeparator;
    dxBarButton32_2DDrawingsComparison: TdxBarButton;
    dxBarButton32_RotateScreen: TdxBarButton;
    dxBarLargeButton1_max: TdxBarLargeButton;
    dxBarLargeButton2_min: TdxBarLargeButton;
    dxBarLargeButton3_close: TdxBarLargeButton;
    dxBarLargeButton1_default: TdxBarLargeButton;
    actlstImageList_WindowBtn: TActionList;
    cxImageList__WindowBtn: TcxImageList;
    cxImageList3: TcxImageList;
    {$ENDREGION}
    procedure tbi_EntEditorClick(Sender: TObject);
    procedure dxBarButton_SingleLineClick(Sender: TObject);
    procedure dxBarButton_DoubleLineClick(Sender: TObject);
    procedure dxBarButton135_BreakCADLine(Sender: TObject);
    procedure dxBarButton139_MergeCADLine(Sender: TObject);
    procedure dxBarButton141_DrawCADLine(Sender: TObject);
    procedure dxBarButton148_Click(Sender: TObject);
    procedure dxBarButton143_TrimImage(Sender: TObject);
    procedure dxBarButton144_CombineImage(Sender: TObject);
    procedure dxBarButton145_Relocate(Sender: TObject);
    procedure dxBarButton147_DelImage(Sender: TObject);
    procedure dxBarButton170_ShrinkTxtClick(Sender: TObject);
    procedure dxBarButton171_RotateTxt(Sender: TObject);
    procedure dxBarButton136_MoveClick(Sender: TObject);
    procedure dxBarButton146_SetPlottingScaleClick(Sender: TObject);
    procedure dxBarButton5_RotateClick(Sender: TObject);
    procedure dxBarButton140_InsertCADEpureClick(Sender: TObject);
    procedure dxBarButton168_Click(Sender: TObject);
    procedure dxBarButton166_Click(Sender: TObject);
    procedure dxBarButton204_Click(Sender: TObject);
    procedure dxBarButton167_Click(Sender: TObject);
    procedure dxBarButton153_Click(Sender: TObject);
    procedure dxBarButton152_TxtIdentigyClick(Sender: TObject);
    procedure dxBarButton160_PicLabelIdenClick(Sender: TObject);
    procedure dxBarButton156_Click(Sender: TObject);
    procedure dxBarButton154_Click(Sender: TObject);
    procedure dxBarButton155_Click(Sender: TObject);
    procedure dxBarButton163_Click(Sender: TObject);
    procedure dxBarButton162_Click(Sender: TObject);
    procedure dxBarLargeButton21_IdenOptionClick(Sender: TObject);
    procedure dxBarButton_FullScreenClick(Sender: TObject);
    procedure dxBarButton210_Click(Sender: TObject);
    procedure dxBarButton1_NewClick(Sender: TObject);
    procedure dxBarButton2_OpenClick(Sender: TObject);
    procedure dxBarSubItem24Click(Sender: TObject);
    procedure dxBarSubItem25Click(Sender: TObject);
    procedure dxBarButton164_Click(Sender: TObject);
    procedure dxBarButton11Click(Sender: TObject);
    procedure dxBarButton130_FlorSettingsClick(Sender: TObject);
    procedure dxBarButton131_CalcRuleClick(Sender: TObject);
    procedure dxBarButton132_OtherSettingsClick(Sender: TObject);
    procedure dxBarButton196_Click(Sender: TObject);
    procedure dxBarButton13_AddTxt(Sender: TObject);
    procedure tbiCrossJointClick(Sender: TObject);
    procedure tbSnapSettingDockChanged(Sender: TObject);
    procedure dxBarButton27Click(Sender: TObject);
    procedure dxBarButton_AutoIdenDuctClick(Sender: TObject);
    procedure dxBarButton_AutoIdenWaterPipeClick(Sender: TObject);
    procedure dxBarButton_FirePipeMarkIdentifyClick(Sender: TObject);
    procedure dxBarButton_CircuitIdenClick(Sender: TObject);
    procedure dxfloorsChange(Sender: TObject);
    procedure dxBarButton_IdenCableTrayClick(Sender: TObject);
    procedure tbi9_EntTreeClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure dxBarLargeButton73_DrawingFolderClick(Sender: TObject);
    procedure dxBarSubItem30_Click(Sender: TObject);
    procedure dxBarButton29_CopyClick(Sender: TObject);
    procedure dxBarButton28_RotateCadImageIDClick(Sender: TObject);
    procedure dxBarButton169_Click(Sender: TObject);
    procedure dxBarButton3Click(Sender: TObject);
    procedure dxBarButton10Click(Sender: TObject);
    procedure dxBarButton14Click(Sender: TObject);
    procedure dxBarButton32_2DDrawingsComparisonClick(Sender: TObject);
    procedure dxBarButton32_RotateScreenClick(Sender: TObject);
    procedure FormMouseActivate(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y, HitTest: Integer;
    var MouseActivate: TMouseActivate);
    procedure FormPaint(Sender: TObject);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    procedure pnlModelInputMouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    procedure FormResize(Sender: TObject);
    procedure dxRibbon1DblClick(Sender: TObject);
    procedure dxRibbon1MouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    private
    FNavForm: TGAEAProjectNavBarForm;
    FReportPreviewForm: TTMEReportPreviewForm;
    //模拟mdiform窗体最小化,关闭及恢复按纽对象
    FBtnMin, FBtnRestore, FBtnClose, FBtnMax: TMDIButton;
    FWindowcloseApp: TWindowCloseApp;
    FWindowMinimize: TWindowMinimize;
    FWindowRestore: TWindowRestore;
    FWindowMax: TWindowMax;
    procedure ResetImageAndHint;
    procedure ReverFormStyle;
    procedure SetBtnEnable(AEnable: Boolean);
    procedure RefreshFrm;
    procedure DoClearSelSetEdos;
    procedure CreateWindowBtn;
    procedure SetMDIFormActionPos;
    //释放资源
    procedure FreeResource;

    protected
    procedure ShowModifyPopup(X, Y: Integer); override;
    procedure UpdateFloorsComboBox; override;
    procedure ResponseCurLayerChanged(); override;
    procedure FloorChange(Sender: TObject); override;
    procedure WMNCPaint(var Msg: TWMNCPaint) ; message WM_NCPAINT;
    procedure WMNCACTIVATE(var Msg: TWMNCActivate) ; message WM_NCACTIVATE;
    procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
    procedure DrawCaptionText() ;
    procedure CoordinateChanged(Sender: TObject); override;
    procedure EditorMouseMove(Sender: TObject); override;
    public
    // 由于Dock控件会使用DockServer所属Form的FormDestroy事件,占用的话会导致Dock控件报错
    // 变通的方法就是将释放代码放到析构函数中,将FormDestroy事件留空
    destructor Destroy; override;
    end;

    procedure SetMaxScreen;
    implementation

    uses
    GAEAMainFrm, GrandFileUtils, GAEAIconsDM, GGCDBConsts, GAEACADEpureOperator,
    GAEATypes, GGCElementTypeIDConst, GAEAReplaceElementFrm, GQIConst, GQICommandType,
    GAEACADCmdStateType, GAEACommon, GGLGeo2DTypes, GAEACommandType, math, GrandUiUtils,
    GQICommon, GQICommandOperate, GGCSceneViewer, GGCCommandType, TMEFrmProjectSettings,
    GAEAUiUtils, GAEAMessage, GAEASysInfo, GAEADbConsts, GGCTypes, System.Types,
    GQIActionsModule, DataAnalytics, GAEAUiService, GSPInterface, GAEAUserInfo,
    GrandClasses, GAEAModelModifyCmdState, GGCCommandState;

    var
    oCommonFunc: TStringList;

    const
    CIconFileType = '*.bmp';
    CImagesCatalog = 'Images';
    CIFCFile = 'IFC File(.IFC)';
    CTMEFile = 'TME Project(.TME2)';
    CEntFile = 'Element File(.TMEBGAR)';
    CPDFFile = 'PDF File(.pdf)';
    CDWGFile = 'DWG File(.dwg)';
    CCADIFile = 'CADI File(.CADI)';

    const
    InElectmentId = [etCablePipe,
    etElectricityPipe, etFireElectPipe,
    etFireCablePipe, etVentilationPipe,
    etWeakCurrentPipe, etWeakCurrentCablePipe];
    const
    BtnTop = 8;

    resourcestring
    SNavBarCaption = 'Navigation Bar';
    SDrawingFolderCaption = 'Drawings Folder';
    sNeedZeroScreenANgle = '屏幕旋转角度不为0,无法使用此功能,请修改屏幕角度为0再使用';

    {$R *.dfm}

    {-------------------------------------------------------------------------------
    作者: huangsn
    日期: 2017.08.27
    说明: 单边线识别
    -------------------------------------------------------------------------------}
    procedure TTMEModelInputForm.dxBarButton_SingleLineClick(Sender: TObject);
    begin
    inherited;
    if (FProject.State.CurElementType in ElectricPipeEntTypeSet)
    or (FProject.State.CurElementType in ElectricCableEntTypeSet)
    or (FProject.State.CurElementType = etBusPipe)
    or (FProject.State.CurElementType = etLightningProtection) then
    Execute(cmdIdentifyElecPipe)
    else
    case FProject.State.CurElementType of
    etHeatingPipes, etWaterPipe,
    etFireServicePipe, etVentilationWaterPipe: Execute(cmdIdentifySglWaterPipe);
    end;
    end;

    procedure TTMEModelInputForm.dxBarLargeButton21_IdenOptionClick(Sender: TObject);
    var
    nGroupID: Integer;
    begin
    if FProject.GSPModel.TableByName(ptnScreenSettings).Records[0].AsInteger[pfnIdentifyMode] = 2 then
    Exit;
    inherited;
    nGroupID := GetGroupID(FProject.State.CurElementType);
    if nGroupID in [CWarterGroupID, CHeatingGroupID, CWeakCurrentGroupID, CElectricGroupID,
    CFireGroupID, CVentilationGroupID, CStructureGroupID] then
    ExcuteCADCommand(Self, cmdShowCADOptionsFormID);
    end;

    procedure TTMEModelInputForm.dxBarLargeButton73_DrawingFolderClick(
    Sender: TObject);
    begin
    inherited;
    ShowCADFileMgrFrm(not FCADFileMgrFrm.Visible);
    if FElementsForm.Visible then
    acEntBrowserExecute(nil);
    if FPropEditorForm.Visible then
    acPropEditorExecute(nil);
    end;

    {-----------------------------------------------------------------------------
    函数:SetBtnEnable
    作者: zhangzf-g 2017.09.18
    参数: AEnable: Boolean
    返回: None
    功能: 设置按钮是否可用
    -----------------------------------------------------------------------------}
    procedure TTMEModelInputForm.SetBtnEnable(AEnable: Boolean);
    begin
    dxBarSubItem31_ScanDraw.Enabled := AEnable;
    dxBarButton146_SetPlottingScale.Enabled := AEnable;
    dxBarButton140_InsertCADEpure.Enabled := AEnable;
    end;


    procedure TTMEModelInputForm.dxBarSubItem24Click(Sender: TObject);
    begin
    inherited;
    MainForm.acUndo.Execute;
    end;

    procedure TTMEModelInputForm.dxBarSubItem25Click(Sender: TObject);
    begin
    inherited;
    MainForm.acRedo.Execute;
    end;

    procedure TTMEModelInputForm.dxBarSubItem30_Click(Sender: TObject);
    begin
    inherited;
    SetBtnEnable(FProject.GGCModel.CADElementDrawObjs.State.CurFloorCAD);
    end;

    procedure TTMEModelInputForm.dxBarButton135_BreakCADLine(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADLine;
    Execute(cmdCADLineBreak, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton136_MoveClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    DoClearSelSetEdos;
    SetLength(oParam, 1);
    oParam[0] := etAll;
    Execute(cmdMove, oParam);
    end;

    procedure TTMEModelInputForm.DoClearSelSetEdos;
    var
    oCmdState: TGGCCommandState;
    begin
    if FProject.State.CurLayer = CCADrawingLayer then
    Exit;
    if Assigned(FSceneViewer.LeafCmdState) then
    begin
    oCmdState := TGGCCommandState(GetImplObject(FSceneViewer.LeafCmdState));
    oCmdState.SelSet.Clear;
    end;
    end;


    procedure TTMEModelInputForm.DrawCaptionText;
    var
    iX: integer;
    begin
    if dxRibbon1.Width< 800 then
    begin
    iX := 60;
    end
    else
    begin
    iX := Trunc(dxRibbon1.Width/3);
    end;

    with dxRibbon1.Canvas do
    begin
    Brush.Style := bsClear;
    Font.Color := clWhite;
    Font.Size := 12;
    Font.Name := 'Tahoma';
    TextOut(ix, 8, Caption);
    end;
    end;

    procedure TTMEModelInputForm.CoordinateChanged(Sender: TObject);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.EditorMouseMove(Sender: TObject);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.WMNCACTIVATE(var Msg: TWMNCActivate);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.WMNCPaint(var Msg: TWMNCPaint);
    begin
    inherited;
    DrawCaptionText;
    end;


    procedure TTMEModelInputForm.WMPaint(var Message: TWMPaint);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.FormMouseActivate(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer;
    var MouseActivate: TMouseActivate);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.FormMouseDown(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.FormMouseMove(Sender: TObject; Shift: TShiftState;
    X, Y: Integer);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.FormPaint(Sender: TObject);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.FormResize(Sender: TObject);
    begin
    inherited;
    SetMDIFormActionPos;
    end;

    procedure TTMEModelInputForm.pnlModelInputMouseDown(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    inherited;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.dxBarButton170_ShrinkTxtClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADText;
    Execute(cmdScaleTextEdo, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton139_MergeCADLine(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADLine;
    Execute(cmdCADLineMerge, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton13_AddTxt(Sender: TObject);
    begin
    inherited;
    Execute(cmdAddLabels);
    end;

    procedure TTMEModelInputForm.dxBarButton140_InsertCADEpureClick(Sender: TObject);
    begin
    inherited;
    Execute(cmdInsertCADEpureID);
    end;

    procedure TTMEModelInputForm.dxBarButton141_DrawCADLine(Sender: TObject);
    begin
    inherited;
    FProject.State.SetCADDrawLineMode(True);
    acDrawLineExecute(nil);
    Execute(cmdCaptureLayerColor);
    end;

    procedure TTMEModelInputForm.dxBarButton148_Click(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADLine;
    Execute(cmdChangeLineColorAndLayer, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton14Click(Sender: TObject);
    begin
    inherited;
    dxBarButton14.DropDown(True);
    end;

    procedure TTMEModelInputForm.dxBarButton143_TrimImage(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADImage;
    Execute(cmdTrimPicture, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton144_CombineImage(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADImage;
    Execute(cmdMergeDivideImage, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton145_Relocate(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADImage;
    Execute(cmdRepositionCadImageID, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton147_DelImage(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADImage;
    Execute(cmdDeleteCadImageID, oParam);
    TAutoMapOperation.IsDeletImageEDO := True;
    end;

    procedure TTMEModelInputForm.dxBarButton146_SetPlottingScaleClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    if FProject.GSPModel.TableByName(ptnScreenSettings).Records[0].AsInteger[pfnIdentifyMode] = 2 then
    Execute(cmdScaleCadImageID)
    else begin
    SetLength(oParam, 1);
    oParam[0] := etAll;
    Execute(cmdSetPlottingScaleID, oParam);
    end;
    end;

    procedure TTMEModelInputForm.dxBarButton152_TxtIdentigyClick(Sender: TObject);
    begin
    inherited;
    Execute(cmdReplacePDFText);
    end;

    procedure TTMEModelInputForm.dxBarButton153_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdOneKeyIdentTxt);
    end;

    procedure TTMEModelInputForm.dxBarButton154_Click(Sender: TObject);
    begin
    inherited;
    SceneContext.EDOSelSet.Clear;

    if FProject.GSPModel.TableByName(ptnScreenSettings).Records[0].AsInteger[pfnIdentifyMode] = 0 then
    Execute(cmdIdentifyPDFDevice)
    else
    Execute(cmdIdentifyDevice);
    end;

    procedure TTMEModelInputForm.dxBarButton155_Click(Sender: TObject);
    begin
    inherited;
    if FProject.GSPModel.TableByName(ptnScreenSettings).Records[0].AsInteger[pfnIdentifyMode] = 0 then
    Execute(cmdMarkIdentifyPDFDev)
    else
    Execute(cmdIdenCADDevByLineAndTxt);
    end;

    procedure TTMEModelInputForm.dxBarButton156_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdOneKeyIdentDev);
    end;

    procedure TTMEModelInputForm.dxBarButton160_PicLabelIdenClick(Sender: TObject);
    var
    dAngle: Double;
    rVector2d: TGGLVector2d;
    begin
    rVector2d := Vector2d(SceneViewer.Camera.Up.X, SceneViewer.Camera.Up.Y);
    dAngle := Round(RadToDeg(rVector2d.Angle) - 90);
    if dAngle <> 0 then
    ShowPrompt(sNeedZeroScreenANgle)
    else
    Execute(cmdImageTxtIdentify);
    end;

    procedure TTMEModelInputForm.dxBarButton162_Click(Sender: TObject);
    var
    dAngle: Double;
    rVector2d: TGGLVector2d;
    begin
    inherited;
    rVector2d := Vector2d(SceneViewer.Camera.Up.X, SceneViewer.Camera.Up.Y);
    dAngle := Round(RadToDeg(rVector2d.Angle) - 90);
    if dAngle <> 0 then
    ShowPrompt(sNeedZeroScreenANgle)
    else
    Execute(cmdImageMarkIdentify);
    end;

    procedure TTMEModelInputForm.dxBarButton163_Click(Sender: TObject);
    var
    dAngle: Double;
    rVector2d: TGGLVector2d;
    begin
    inherited;
    rVector2d := Vector2d(SceneViewer.Camera.Up.X, SceneViewer.Camera.Up.Y);
    dAngle := Round(RadToDeg(rVector2d.Angle) - 90);
    if dAngle <> 0 then
    ShowPrompt(sNeedZeroScreenANgle)
    else
    Execute(cmdPDFImageIdentifyCmdState);
    end;

    procedure TTMEModelInputForm.dxBarButton166_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdShowSelCadEDOID);
    end;

    procedure TTMEModelInputForm.dxBarButton167_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdSelectSameLayerID);
    end;

    procedure TTMEModelInputForm.dxBarButton168_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdHideSelCadEDOID);
    end;

    procedure TTMEModelInputForm.dxBarButton169_Click(Sender: TObject);
    begin
    inherited;
    dxBarButton169_.DropDown(True);
    end;

    procedure TTMEModelInputForm.dxBarButton171_RotateTxt(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADText;
    Execute(cmdAdjustTextAngle);
    end;

    procedure TTMEModelInputForm.dxBarButton196_Click(Sender: TObject);
    begin
    inherited;
    if not Assigned(FReportPreviewForm) then
    begin
    FReportPreviewForm := TTMEReportPreviewForm.Create(Self, FProject);
    FReportPreviewForm.FormStyle := fsStayOnTop;
    end;
    if FReportPreviewForm.tv1.Selected <> nil then
    FReportPreviewForm.tv1Change(nil, nil);
    FReportPreviewForm.Show;
    end;

    procedure TTMEModelInputForm.dxBarButton1_NewClick(Sender: TObject);
    begin
    inherited;
    MainForm.acNew.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton204_Click(Sender: TObject);
    begin
    inherited;
    Execute(cmdSelectSameColorID);
    end;

    procedure TTMEModelInputForm.dxBarButton210_Click(Sender: TObject);
    begin
    inherited;
    dxBarButton210_.DropDown(True);
    end;

    procedure TTMEModelInputForm.dxBarButton_FirePipeMarkIdentifyClick(Sender: TObject);
    begin
    inherited;
    GQIModelInputActionsModule.acFirePipeTxtIdentify.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton27Click(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    DoClearSelSetEdos;
    SetLength(oParam, 1);
    oParam[0] := etAll;
    Execute(30, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton28_RotateCadImageIDClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    SetLength(oParam, 1);
    oParam[0] := etCADImage;
    Execute(cmdRotateCadImageID, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton29_CopyClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    DoClearSelSetEdos;
    SetLength(oParam, 1);
    oParam[0] := etAll;
    Execute(cmdCopy, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton_FullScreenClick(Sender: TObject);
    begin
    inherited;
    FSceneViewer.ZoomAll;
    SendEvent(SDAToolBar, GetCaption(Sender), -149);
    end;

    procedure TTMEModelInputForm.dxBarButton_IdenCableTrayClick(Sender: TObject);
    begin
    inherited;
    GQIModelInputActionsModule.acIdentifyBridge.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton2_OpenClick(Sender: TObject);
    begin
    inherited;
    MainForm.acOpen.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton32_RotateScreenClick(Sender: TObject);
    begin
    inherited;
    acRotateScreenExecute(acRotateScreen);
    end;

    procedure TTMEModelInputForm.dxBarButton32_2DDrawingsComparisonClick(
    Sender: TObject);
    begin
    inherited;
    MainForm.acCompare2dDrawing.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton3Click(Sender: TObject);
    begin
    inherited;
    dxBarButton3.DropDown(True);
    end;

    procedure TTMEModelInputForm.dxBarButton5_RotateClick(Sender: TObject);
    var
    oParam: TIntegerDynArray;
    begin
    inherited;
    DoClearSelSetEdos;
    SetLength(oParam, 1);
    oParam[0] := etALL;
    Execute(cmdRotate, oParam);
    end;

    procedure TTMEModelInputForm.dxBarButton_CircuitIdenClick(Sender: TObject);
    begin
    inherited;
    GQIModelInputActionsModule.acIdentifyPipeAttachment.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton_AutoIdenWaterPipeClick(Sender: TObject);
    begin
    inherited;
    GQIModelInputActionsModule.acAutoIdentifyWaterPipe.Execute;
    end;

    procedure TTMEModelInputForm.dxBarButton_AutoIdenDuctClick(Sender: TObject);
    begin
    inherited;
    Execute(cmdAutoIdentifyVentPipe);
    end;

    procedure TTMEModelInputForm.dxBarButton_DoubleLineClick(Sender: TObject);
    begin
    inherited;
    if FProject.State.CurElementType = etVentilationPipe then
    Execute(cmdIdentifyetVentilationPipe)
    else
    Execute(cmdIdentifyDblWaterPipe);
    end;

    procedure TTMEModelInputForm.dxfloorsChange(Sender: TObject);
    var
    oNewFloor: IGGCFloor;
    iNewFloorID: Integer;
    begin
    if dxFloors.Items.Count = 0 then Exit;
    if dxFloors.ItemIndex = -1 then Exit;

    iNewFloorID := Integer(dxFloors.Items.Objects[dxFloors.ItemIndex]);
    oNewFloor := FProject.State.CurRegion.Floors.Find(iNewFloorID);
    Assert(oNewFloor <> nil);
    FSceneViewer.CancelCommandState;
    FProject.GGCModel.CADElementDrawObjs.State.CADEpureVisible := True;
    FProject.State.CurFloor := oNewFloor;
    end;


    //双击
    procedure TTMEModelInputForm.dxRibbon1DblClick(Sender: TObject);
    begin
    inherited;
    FBtnRestore.Visible := not FBtnRestore.Visible;
    FBtnMax.Visible := not FBtnMax.Visible;
    if FBtnRestore.Visible then
    begin
    SetMaxScreen;
    // MainForm.WindowState := wsMaximized;

    // SetWindowLong(MainForm.Handle, GWL_STYLE, GetWindowLong(MainForm.Handle, GWL_STYLE) or WS_MAXIMIZE or not WS_SIZEBOX);
    end;

    if FBtnMax.Visible then
    MainForm.WindowState := wsNormal;
    SetMDIFormActionPos;
    end;

    //移动
    procedure TTMEModelInputForm.dxRibbon1MouseDown(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    inherited;
    ReleaseCapture;
    SendMessage(MainForm.Handle,WM_NCLBUTTONDOWN,HTCAPTION,0);
    if MainForm.WindowState = wsNormal then
    if not FBtnMax.Visible then
    begin
    FBtnRestore.Visible := False;
    FBtnMax.Visible := True;
    SetMDIFormActionPos;
    end;
    end;

    procedure TTMEModelInputForm.FloorChange(Sender: TObject);
    var
    oFloor: IGGCFloor;
    begin
    inherited;
    if FCADFileMgrFrm.gvdFloorMapinfoGrid.Row = 0 then Exit;
    LockWindowUpdate(Self.Handle);
    try
    oFloor := FCADFileMgrFrm.GetFloorGridFloorByRow(FCADFileMgrFrm.gvdFloorMapinfoGrid.Row);
    if oFloor = nil then Exit;
    dxFloors.ItemIndex:= dxFloors.Items.IndexOfObject(TObject(oFloor.ID));
    finally
    LockWindowUpdate(0);
    end;
    end;

    procedure TTMEModelInputForm.FormCreate(Sender: TObject);
    begin
    inherited;
    dxRibbon1.Parent := MainForm;
    FNavForm := TGAEAProjectNavBarForm(GetimplObject(MainForm.ProjectForm.NavBar));
    FNavForm.Caption := ' ' + SNavBarCaption;
    tbi9_EntTree.Caption := SNavBarCaption;

    MainForm.dkTop.Visible := False;

    FCADLayerFrm.lbdckclnt1.CanFloat := False;
    FNavForm.lbdcNavBar.CanFloat := False;
    FElementsForm.lbdckclnt1.CanFloat := False;
    FPropEditorForm.lbdckclnt1.CanFloat := False;

    TlbVIDConjoinServerOption(FNavForm.lbdcNavBar.RelativeServer.DockStyle.ConjoinServerOption).ActiveTitleStartColor := clAppWorkSpace;
    TlbVIDConjoinServerOption(FNavForm.lbdcNavBar.RelativeServer.DockStyle.ConjoinServerOption).ActiveTitleEndColor := clAppWorkSpace;
    TlbVIDConjoinServerOption(FNavForm.lbdcNavBar.RelativeServer.DockStyle.ConjoinServerOption).InActiveTitleStartColor := clBtnFace;
    TlbVIDConjoinServerOption(FNavForm.lbdcNavBar.RelativeServer.DockStyle.ConjoinServerOption).InActiveTitleEndColor := clBtnFace;
    FElementsForm.ElementsFram.tbxtlbrElements.Color := clbtnface;

    ResetImageAndHint;
    ReverFormStyle;
    FCADFileMgrFrm.Caption := ' ' + SDrawingFolderCaption;
    FElementsForm.Caption := ' ' + FElementsForm.Caption;
    FPropEditorForm.Caption := ' ' + FPropEditorForm.Caption;
    FCADLayerFrm.Caption := ' ' + FCADLayerFrm.Caption;
    tvModelNavigation.Font.Height := -12;

    FOptionMgr.ObjSnap.Enable := True;
    CreateWindowBtn;
    SetMDIFormActionPos;
    end;

    destructor TTMEModelInputForm.Destroy;
    begin
    FreeAndNil(FReportPreviewForm);
    FreeResource;
    inherited;
    end;

    {-----------------------------------------------------------------------------
    函数: RefreshFrm
    作者: zhangzf-g 2017.09.20
    参数: None
    返回: None
    功能: 切换专业时刷新构件列表和显示构件列表
    -----------------------------------------------------------------------------}
    procedure TTMEModelInputForm.RefreshFrm;
    var
    nID: Integer;
    begin
    case FProject.State.CurLayer of
    34:
    begin
    ShowDockForm(FCADFileMgrFrm);
    HideDockForm(FElementsForm);
    HideDockForm(FPropEditorForm);
    end;
    else
    begin
    ShowCADFileMgrFrm(False);
    FElementsForm.Visible := true;
    FPropEditorForm.Visible := True;
    nID := Integer(tvModelNavigation.Selected.Data);
    // liuem 2009.04.09 fix bug~1386 只有图层结点才刷新
    if (nID <> -1) and (tvModelNavigation.Selected.Level > 0) then
    FElementsForm.Refresh(nID, FProject.State.CurFloor);
    ShowDockForm(FElementsForm);
    ShowDockForm(FPropEditorForm);
    end;
    end;
    end;

    procedure TTMEModelInputForm.ShowModifyPopup(X, Y: Integer);
    begin
    FSceneViewer.CancelLeafCmdState;
    end;

    procedure TTMEModelInputForm.ResetImageAndHint;
    var
    I: Integer;
    begin
    FCADFileMgrFrm.tbxOprater.Images := GAEAIconsModule.ilMain;
    FCADFileMgrFrm.tbxOprater.ItemTransparency := itEnable;
    FCADFileMgrFrm.tbGeneratedDrawing.ItemTransparency := itEnable;
    FCADFileMgrFrm.tbGeneratedDrawing.Images := GAEAIconsModule.ilMain;
    FCADFileMgrFrm.tbxScale.ImageIndex := GAEAIconsModule.GetImageIndex('SetPlottingScale');
    FCADFileMgrFrm.tbxMoveUp.ImageIndex := GAEAIconsModule.GetImageIndex('MoveUp');
    FCADFileMgrFrm.TBXItem6.ImageIndex := GAEAIconsModule.GetImageIndex('MoveUp');
    FCADFileMgrFrm.TBXItem1.ImageIndex := GAEAIconsModule.GetImageIndex('MoveDown');
    FCADFileMgrFrm.tbxMoveDown.ImageIndex := GAEAIconsModule.GetImageIndex('MoveDown');
    FCADFileMgrFrm.TBXItem3.ImageIndex := GAEAIconsModule.GetImageIndex('DeleteEnts');
    FCADFileMgrFrm.tbxDelete.ImageIndex := GAEAIconsModule.GetImageIndex('DeleteEnts');
    FCADFileMgrFrm.tbxAdd.ImageIndex := GAEAIconsModule.GetImageIndex('Add');
    FCADFileMgrFrm.tbxAllocation.ImageIndex := GAEAIconsModule.GetImageIndex('Allocated');
    FCADFileMgrFrm.tbxDivide.ImageIndex := GAEAIconsModule.GetImageIndex('Divide');

    for I := 0 to dxArrange_.ItemLinks.Count - 1 do
    if (dxArrange_.ItemLinks[I].Item.Action <> nil)
    and (dxArrange_.ItemLinks[I].Item.Action is TAction) then
    (dxArrange_.ItemLinks[I].Item.Action as TAction).Hint := '';

    for I := 0 to dxModify_.ItemLinks.Count - 1 do
    if (dxModify_.ItemLinks[I].Item.Action <> nil)
    and (dxModify_.ItemLinks[I].Item.Action is TAction) then
    (dxModify_.ItemLinks[I].Item.Action as TAction).Hint := '';
    for I := 0 to dxBarManager1Bar1.ItemLinks.Count -1 do
    if dxBarManager1Bar1.ItemLinks.Items[I].Item.ClassName = 'TdxBarButton' then
    TdxBarButton(dxBarManager1Bar1.ItemLinks.Items[I].Item).Hint := '';
    acLayerEntDisp.ShortCut := scNone;
    dxBarButton29.Caption := 'Copy to Other Floor';
    acCopyEDOToOther.Caption := 'Copy to Other Floor';
    GQIModelInputActionsModule.acRapidCreateFirePipe.Caption := 'Auto-generate Pipe';
    acIntsSnap.ImageIndex := -1;

    acDownView.Hint := '';
    acShow3DView.Hint := '';
    acRender.Hint := '';
    acFloorVisibleSetting.Hint := '';

    tbiOrthoDraw.ImageIndex := 41;
    tbiCrossJoint.ImageIndex := 48;
    tbi6.ImageIndex := 49;

    cxImageList1.Clear;
    cxImageList1.Assign(GAEAIconsModule.ilMain);

    for I := 0 to dxBarSubItem24_ProjSettings.ItemLinks.Count - 1 do
    dxBarSubItem24_ProjSettings.ItemLinks.Items[I].Item.ImageIndex :=
    GAEAIconsModule.GetImageIndex(dxBarSubItem24_ProjSettings.ItemLinks.Items[I].Item.Caption);

    MainForm.acImportIFC.Caption := CIFCFile;
    MainForm.acMergeTMEProject.Caption := CTMEFile;
    GQIModelInputActionsModule.acElementAbstract.Caption := CEntFile;
    MainForm.acExportPdf.Caption := CPDFFile;
    MainForm.acExportDWG.Caption := CDWGFile;
    GQIModelInputActionsModule.acElementArchive.Caption := CEntFile;
    dxBarButton1_New.ImageIndex := GAEAIconsModule.GetImageIndex('New');
    dxBarButton2_Open.ImageIndex := GAEAIconsModule.GetImageIndex('Open');
    dxBarButton3.ImageIndex := GAEAIconsModule.GetImageIndex('ColorAndLayer');
    dxBarButton5_Rotate.ImageIndex := GAEAIconsModule.GetImageIndex('RotateEnts');
    dxBarButton10.ImageIndex := GAEAIconsModule.GetImageIndex('3DView');
    dxBarButton13_.ImageIndex := GAEAIconsModule.GetImageIndex('AddLabels');
    dxBarButton14.ImageIndex := GAEAIconsModule.GetImageIndex('Tools');
    dxBarButton12.ImageIndex := GAEAIconsModule.GetImageIndex('MultiSelectVerPipe');
    dxBarButton27.ImageIndex := GAEAIconsModule.GetImageIndex('ClearCADEpure');
    dxBarButton29_Copy.ImageIndex := GAEAIconsModule.GetImageIndex('Copy');
    dxBarButton29.ImageIndex := GAEAIconsModule.GetImageIndex('Copy');
    dxBarSubItem31_ScanDraw.ImageIndex := GAEAIconsModule.GetImageIndex('ScanDraw');
    dxBarSubItem32_.ImageIndex := GAEAIconsModule.GetImageIndex('PDFDrawings');
    dxBarSubItem43_.ImageIndex := GAEAIconsModule.GetImageIndex('ModifyTxt');
    dxBarButton135_.ImageIndex := GAEAIconsModule.GetImageIndex('CADLineBreak');
    dxBarButton136_Move.ImageIndex := GAEAIconsModule.GetImageIndex('MoveDrawing');
    dxBarButton139_.ImageIndex := GAEAIconsModule.GetImageIndex('CADLineMerge');
    dxBarButton140_InsertCADEpure.ImageIndex := GAEAIconsModule.GetImageIndex('InsertCADEpure');
    dxBarButton141_.ImageIndex := GAEAIconsModule.GetImageIndex('DrawLine');
    dxBarSubItem42_.ImageIndex := GAEAIconsModule.GetImageIndex('ScanDraw');
    dxBarButton143_.ImageIndex := GAEAIconsModule.GetImageIndex('TrimPicture');
    dxBarButton144_.ImageIndex := GAEAIconsModule.GetImageIndex('MergePicture');
    dxBarButton145_.ImageIndex := GAEAIconsModule.GetImageIndex('RepositionCadEpure');
    dxBarButton146_SetPlottingScale.ImageIndex := GAEAIconsModule.GetImageIndex('SetPlottingScale');
    dxBarButton147_.ImageIndex := GAEAIconsModule.GetImageIndex('DeletePicture');
    dxBarButton148_.ImageIndex := GAEAIconsModule.GetImageIndex('ChangeLineColorAndLayer');
    dxBarButton152_TxtIdentigy.ImageIndex := GAEAIconsModule.GetImageIndex('ReplacePDFText');
    dxBarButton153_.ImageIndex := GAEAIconsModule.GetImageIndex('OneKeyIdentifyTxt');
    dxBarButton154_.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyDevice');
    dxBarButton155_.ImageIndex := GAEAIconsModule.GetImageIndex('IdenCADDevByLineAndTxt');
    dxBarButton156_.ImageIndex := GAEAIconsModule.GetImageIndex('OneKeyIdentifyDev');
    dxBarButton160_PicLabelIden.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyImageText');
    dxBarButton162_.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyImageMarkDev');
    dxBarButton163_.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyImageDevice');
    dxBarButton164_.ImageIndex := GAEAIconsModule.GetImageIndex('ShowCADLayer');
    dxBarButton166_.ImageIndex := GAEAIconsModule.GetImageIndex('ShowSelCadEDOID');
    dxBarButton167_.ImageIndex := GAEAIconsModule.GetImageIndex('SelectSameLayer');
    dxBarButton168_.ImageIndex := GAEAIconsModule.GetImageIndex('HideSelCadEDOID');
    dxBarButton169_.ImageIndex := GAEAIconsModule.GetImageIndex('HideAndShow');
    dxBarButton170_ShrinkTxt.ImageIndex := GAEAIconsModule.GetImageIndex('ScaleTextEdo');
    dxBarButton171_.ImageIndex := GAEAIconsModule.GetImageIndex('AdjustTextAngle');
    dxBarButton196_.ImageIndex := GAEAIconsModule.GetImageIndex('ReportPreview');
    dxBarButton204_.ImageIndex := GAEAIconsModule.GetImageIndex('SelectSameColor');
    dxBarButton210_.ImageIndex := GAEAIconsModule.GetImageIndex('Select');
    dxBarButton216_.ImageIndex := GAEAIconsModule.GetImageIndex('multiSelect');
    dxBarButton217_.ImageIndex := GAEAIconsModule.GetImageIndex('PolySelect');
    dxBarButton_AutoIdenDuct.ImageIndex := GAEAIconsModule.GetImageIndex('AutoIdentifyVentPipe');
    dxBarButton_AutoIdenWaterPipe.ImageIndex := GAEAIconsModule.GetImageIndex('AutoIdentifyWaterPipe');
    dxBarButton_FirePipeMarkIdentify.ImageIndex := GAEAIconsModule.GetImageIndex('AutoIdentifyWaterPipe');
    dxBarButton_FullScreen.ImageIndex := GAEAIconsModule.GetImageIndex('ZoomAll');
    dxBarButton_SingleLine.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifySglWaterPipe');
    dxBarButton_DoubleLine.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyetVentilationPipe');
    dxBarButton_IdenCableTray.ImageIndex := GAEAIconsModule.GetImageIndex('IdentifyetVentilationPipe');
    dxBarButton28_RotateCadImageID.ImageIndex := GAEAIconsModule.GetImageIndex('RotateDrawing');
    dxBarButton_CircuitIden.ImageIndex := GAEAIconsModule.GetImageIndex('AutoIdentifyWaterPipe');
    dxBarButton32_2DDrawingsComparison.ImageIndex := GAEAIconsModule.GetImageIndex('Compare2dDrawing');
    dxBarButton32_RotateScreen.ImageIndex := GAEAIconsModule.GetImageIndex('RotateScreen');

    GQIModelInputActionsModule.acIdentifyVentPipeLink.Caption := 'Auto-Generate Duct Fittings';

    if tbSnapSetting.CurrentDock = dkModleInputBottom then
    tbSnapSetting.images := nil
    else
    tbSnapSetting.images := cxImageList2;
    end;

    procedure TTMEModelInputForm.tbi9_EntTreeClick(Sender: TObject);
    begin
    inherited;
    if not FNavForm.Visible then
    ShowDockForm(FNavForm)
    else
    HideDockForm(FNavForm);
    end;

    procedure TTMEModelInputForm.tbiCrossJointClick(Sender: TObject);
    begin
    tbiCrossJoint.Checked := not tbiCrossJoint.Checked;
    GNeedCrossJoint := tbiCrossJoint.Checked;
    SendEvent(SDAToolBar, GetCaption(Sender), -219);
    end;

    procedure TTMEModelInputForm.tbi_EntEditorClick(Sender: TObject);
    begin
    LockWindowUpdate(self.Handle);
    try
    ShowCADFileMgrFrm(False);
    if FElementsForm.Visible <> FPropEditorForm.Visible then
    begin
    if not FElementsForm.Visible then
    acEntBrowserExecute(nil)
    else
    acPropEditorExecute(nil);
    Exit;
    end;
    acEntBrowserExecute(nil);
    acPropEditorExecute(nil);
    finally
    LockWindowUpdate(0);
    end;
    end;

    procedure TTMEModelInputForm.tbSnapSettingDockChanged(Sender: TObject);
    begin
    inherited;
    if tbSnapSetting.CurrentDock = dkModleInputBottom then
    begin
    tbSnapSetting.images := nil;
    tbi9_EntTree.DisplayMode := nbdmTextOnly;
    tbi9_EntTree.Caption := 'Element Tree';

    tbi_EntEditor.DisplayMode := nbdmTextOnly;
    tbi_EntEditor.Caption := 'Element';

    tbiOrthoDraw.DisplayMode := nbdmTextOnly;
    tbiOrthoDraw.Caption := (tbiOrthoDraw.Action as TAction).Caption;
    tbiCrossJoint.DisplayMode := nbdmTextOnly;
    tbiCrossJoint.Caption := 'Cross Joint';
    tbi6.DisplayMode := nbdmTextOnly;
    tbi6.Caption := (tbi6.Action as TAction).Caption;
    end
    else begin
    tbSnapSetting.images := cxImageList2;
    tbi9_EntTree.DisplayMode := nbdmImageAndText;
    tbi9_EntTree.Caption := '';

    tbi_EntEditor.DisplayMode := nbdmImageAndText;
    tbi_EntEditor.Caption := '';

    tbiOrthoDraw.DisplayMode := nbdmImageAndText;
    tbiOrthoDraw.Caption := '';
    tbiCrossJoint.DisplayMode := nbdmImageAndText;
    tbiCrossJoint.Caption := '';
    tbi6.DisplayMode := nbdmImageAndText;
    tbi6.Caption := '';
    end;
    end;
    procedure TTMEModelInputForm.UpdateFloorsComboBox;
    var
    I: Integer;
    oFloors: IGGCFloors;
    begin
    inherited;
    dxFloors.Items.BeginUpdate;
    try
    dxFloors.Items.Clear;
    oFloors := FProject.State.CurRegion.Floors;
    for I := 0 to oFloors.Count - 1 do
    dxFloors.Items.AddObject(oFloors[I].Name, TObject(oFloors[I].ID));
    dxFloors.ItemIndex := dxFloors.Items.IndexOfObject(TObject(FProject.State.CurFloor.ID));
    finally
    dxFloors.Items.EndUpdate;
    end;
    end;

    procedure TTMEModelInputForm.dxBarButton164_Click(Sender: TObject);
    begin
    inherited;
    ShowCADLayerForm(not FCADLayerFrm.Visible);
    end;

    procedure TTMEModelInputForm.dxBarButton10Click(Sender: TObject);
    begin
    inherited;
    dxBarButton10.DropDown(True);
    end;

    procedure TTMEModelInputForm.dxBarButton11Click(Sender: TObject);
    begin
    inherited;
    TFrmProjectSettings.ProjSettingExecute(FProject, BQInfo);
    end;

    procedure TTMEModelInputForm.dxBarButton130_FlorSettingsClick(Sender: TObject);
    begin
    inherited;
    TFrmProjectSettings.ProjSettingExecute(FProject, FloorInfo);
    LockWindowUpdate(self.Handle);
    try
    UpdateFloorsComboBox;
    if FCADFileMgrFrm.Visible then
    FCADFileMgrFrm.RefreshFileTableUI;
    finally
    LockWindowUpdate(0);
    end;
    end;

    procedure TTMEModelInputForm.dxBarButton131_CalcRuleClick(Sender: TObject);
    begin
    inherited;
    TFrmProjectSettings.ProjSettingExecute(FProject, CalcRule);
    end;

    procedure TTMEModelInputForm.dxBarButton132_OtherSettingsClick(Sender: TObject);
    begin
    inherited;
    TFrmProjectSettings.ProjSettingExecute(FProject, OtherInfo);
    end;

    procedure TTMEModelInputForm.ResponseCurLayerChanged;
    var
    I, iCurElementType, iCurLayer: Integer;
    begin
    FCommandEnabledByLayer.SetLayerID(FProject.State.CurLayer);
    //切换图纸命令状态
    if NeedCancelCmd then
    FSceneViewer.CancelCommandState;
    iCurElementType := -1;
    iCurLayer := FProject.State.CurLayer;
    if iCurLayer <> -1 then
    iCurElementType := SysModelMgr[CSysInfo].FindTable(pdbDB, ptnLayerDict).
    FindByID(iCurLayer).AsInteger[pfnElementTypeID];

    FProject.State.CurElementType := iCurElementType;
    //先刷新构件列表
    if iCurLayer = -1 then
    iCurLayer := 1000;
    SendIntfMessage(FElementManagerModule, UM_MODELELEMENTTYPECHANGED, iCurLayer);
    DoChangeNewItemMenu;
    FProject.State.CADDrawLineMode := False;

    if not FProject.State.Updating then
    FElementsForm.Refresh(FProject.State.CurLayer, FProject.State.CurFloor);
    if not FProject.State.Updating then
    FEDODisplayOperator.Build3DObjectForLayer(True, False);
    FSceneViewer.Invalidate;
    dxBarSubItem34_TextIden.Enabled := True;
    case iCurElementType of
    -1, 71, 72, 73, 74, 77, 98: begin //axis, drawing,custom-(pointlinearea egion)
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := False;
    if iCurElementType = -1 then
    dxBarSubItem34_TextIden.Enabled := False;
    end;
    etWaterPipe, etVentilationWaterPipe, etHeatingPipes: begin
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := True;
    dxBarButton_SingleLine.Visible := ivAlways;
    dxBarButton_DoubleLine.Visible := ivAlways;
    dxBarButton_AutoIdenWaterPipe.Visible := ivAlways;
    dxBarButton_IdenCableTray.Visible := ivNever;
    dxBarButton_AutoIdenDuct.Visible := ivNever;
    dxBarButton_FirePipeMarkIdentify.Visible := ivNever;
    dxBarButton_CircuitIden.Visible := ivNever;
    end;
    etFireServicePipe: begin
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := True;
    dxBarButton_SingleLine.Visible := ivAlways;
    dxBarButton_DoubleLine.Visible := ivAlways;
    dxBarButton_FirePipeMarkIdentify.Visible := ivAlways;
    dxBarButton_AutoIdenWaterPipe.Visible := ivNever;
    dxBarButton_IdenCableTray.Visible := ivNever;
    dxBarButton_AutoIdenDuct.Visible := ivNever;
    dxBarButton_CircuitIden.Visible := ivNever;
    end;
    etVentilationPipe: begin
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := True;
    dxBarButton_SingleLine.Visible := ivNever;
    dxBarButton_DoubleLine.Visible := ivAlways;
    dxBarButton_FirePipeMarkIdentify.Visible := ivNever;
    dxBarButton_AutoIdenWaterPipe.Visible := ivNever;
    dxBarButton_IdenCableTray.Visible := ivNever;
    dxBarButton_AutoIdenDuct.Visible := ivAlways;
    dxBarButton_CircuitIden.Visible := ivNever;
    end;
    etElectricityPipe, etCablePipe, etFireElectPipe, etFireCablePipe,
    etWeakCurrentPipe, etWeakCurrentCablePipe: begin
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := True;
    dxPipe_Identify.Enabled := True;
    dxBarButton_SingleLine.Visible := ivAlways;
    dxBarButton_DoubleLine.Visible := ivNever;
    dxBarButton_FirePipeMarkIdentify.Visible := ivNever;
    dxBarButton_AutoIdenWaterPipe.Visible := ivNever;
    dxBarButton_IdenCableTray.Visible := ivAlways;
    dxBarButton_AutoIdenDuct.Visible := ivNever;
    dxBarButton_CircuitIden.Visible := ivAlways;
    end;
    etBusPipe: begin
    dxDevice_Identify_.Enabled := False;
    dxPipe_Identify.Enabled := True;
    dxBarButton_SingleLine.Visible := ivAlways;
    dxBarButton_DoubleLine.Visible := ivNever;
    dxBarButton_FirePipeMarkIdentify.Visible := ivNever;
    dxBarButton_AutoIdenWaterPipe.Visible := ivNever;
    dxBarButton_IdenCableTray.Visible := ivNever;
    dxBarButton_AutoIdenDuct.Visible := ivNever;
    dxBarButton_CircuitIden.Visible := ivAlways;
    end
    else begin
    dxDevice_Identify_.Enabled := (not (iCurElementType in NeedLinkPipeTypeSet)) and (not (iCurElementType in PipeLinkEntTypeSet))
    and (not (iCurElementType in OtherPointElementTypeSet));
    dxPipe_Identify.Enabled := iCurElementType in NeedLinkPipeTypeSet;
    end;
    end;
    dxArrange_.Enabled := (iCurElementType <> etCAD) and (iCurElementType <> -1);
    dxModify_.Enabled := (iCurElementType <> etCAD) and (iCurElementType <> -1);
    for I := pmCommon.Items.Count - 1 downto 0 do
    if pmCommon.Items[I] is TTBXSubMenuItem then
    pmCommon.Items.Delete(I)
    else if pmCommon.Items[I] is TTBXItem then
    if oCommonFunc.IndexOf((pmCommon.Items[I] as TTBXItem).Name) = -1 then
    pmCommon.Items.Delete(I);
    pmModify.Items.Clear;
    FCommandEnabledController.RefreshActionEnabled;

    //20170918 zhangzf-g 增加iCurElementType <> -1 判断, 如果切换到专业名称, 则按钮也不让用, 如果是pdf图片模式 也灰显
    dxBarLargeButton21_IdenOption.Enabled := (iCurElementType <> etCAD) and (iCurElementType <> -1)
    and (iCurLayer <> 0) and (FProject.GSPModel.TableByName(ptnScreenSettings).Records[0].AsInteger[pfnIdentifyMode] <> 2);
    if Visible then
    RefreshFrm;
    dxBarButton29.Enabled := acCopyents.enabled;
    acCopyEDOToOther.enabled := acCopyents.enabled;

    end;

    procedure TTMEModelInputForm.ReverFormStyle;
    var
    oTMEFormInfoTable, oFormInfoTable: IGSPTable;
    begin
    oTMEFormInfoTable := SysModelMgr[CSysInfo].FindTable(pdbDB, 'TMEStyleFormInfo');
    oFormInfoTable := UserInfo.Model.FindTable(pdbDB, ptnFormInfo);
    oFormInfoTable.Clear;
    oFormInfoTable.AppendFrom(oTMEFormInfoTable);
    if MainForm.ProjectForm <> nil then
    begin
    MainForm.FormConfig.Layout(CModelInputModuleID);
    MainForm.ProjectForm.NeedLayoutForm;
    end;
    FNavForm.FOutlookBar.Visible := False;
    Panel1.Parent := FNavForm;
    Panel1.Align := alClient;
    Panel1.Visible := True;
    DrawCaptionText;
    end;

    procedure TTMEModelInputForm.CreateWindowBtn;
    begin
    //建立关闭Button
    FBtnClose := TMDIButton.Create(dxRibbon1);
    FBtnClose.Visible := True;
    FBtnClose.Parent := dxRibbon1;
    FBtnClose.Width := 24;
    FBtnClose.Height := 24;
    //建立关闭功能Action
    FWindowcloseApp := TWindowCloseApp.Create(nil);
    //指定其图标
    FWindowcloseApp.ActionList := actlstImageList_WindowBtn;
    FWindowcloseApp.ImageIndex := 0; //关闭;
    FWindowcloseApp.Caption := '';
    //将action与button关联
    FBtnClose.Action := FWindowcloseApp;
    FBtnClose.BringToFront;
    FBtnClose.Visible := True;

    //建立最小化Button
    FBtnMin := TMDIButton.Create(dxRibbon1);
    FBtnMin.Visible := True;
    FBtnMin.Parent := dxRibbon1;
    FBtnMin.width := 24;
    FBtnMin.height := 24;
    //建立最小化功能action
    FWindowMinimize := TWindowMinimize.Create(nil);
    //指定其图标
    FWindowMinimize.ActionList := actlstImageList_WindowBtn;
    FWindowMinimize.Caption := '';
    FWindowMinimize.ImageIndex := 1;
    //将action与button关联
    FBtnMin.Action := FWindowMinimize; //最小化
    FBtnMin.BringToFront;
    FBtnMin.Visible := True;

    //建立恢复功能Button
    FBtnRestore := TMDIButton.Create(dxRibbon1);
    FBtnRestore.Visible := True;
    FBtnRestore.Parent := dxRibbon1;
    FBtnRestore.Width := 24;
    FBtnRestore.height := 24;
    //建立恢复功能action
    FWindowRestore := TWindowRestore.Create(nil);
    //指定其图标
    FWindowRestore.ActionList := actlstImageList_WindowBtn;
    FWindowRestore.Caption := '';
    FWindowRestore.ImageIndex := 2;
    //将action与button关联
    FBtnRestore.Action := FWindowRestore;
    FBtnRestore.BringToFront;
    FBtnRestore.Visible := True;


    //建立最大化功能Button
    FBtnMax := TMDIButton.Create(dxRibbon1);
    FBtnMax.Visible := False;
    FBtnMax.Parent := dxRibbon1;
    FBtnMax.Width := 24;
    FBtnMax.height := 24;
    //建立最大化功能action
    FWindowMax := TWindowMax.Create(nil);
    //指定其图标
    FWindowMax.ActionList := actlstImageList_WindowBtn;
    FWindowMax.Caption := '';
    FWindowMax.ImageIndex := 3;
    //将action与button关联
    FBtnMax.Action := FWindowMax;
    FBtnMax.BringToFront;
    FBtnMax.Visible := False;
    end;

    procedure TTMEModelInputForm.SetMDIFormActionPos;
    begin
    if assigned(FBtnClose) then
    begin
    FBtnClose.left := dxRibbon1.Width - 40;
    FBtnClose.top := BtnTop;
    end;

    if assigned(FBtnMax) then
    begin
    if FBtnMax.Visible then
    begin
    if assigned(FBtnMax) then
    begin
    FBtnMax.Left := dxRibbon1.Width - 40-24-1;
    FBtnMax.Top := BtnTop;
    end;
    end
    else
    begin
    if assigned(FBtnRestore) then
    begin
    FBtnRestore.Left := dxRibbon1.Width -40-24-1;
    FBtnRestore.Top := BtnTop;
    end;
    end;
    end;

    if assigned(FBtnMin) then
    begin
    FBtnMin.Left := dxRibbon1.Width - 40-24-1-24-1;
    FBtnMin.Top := BtnTop;
    end;
    end;

    { TWindowRestore }
    procedure TWindowRestore.ExecuteTarget(Target: TObject);
    begin
    inherited;
    // PostMessage(MainForm.Handle,WM_SYSCOMMAND, SC_RESTORE,0);//恢复
    MainForm.WindowState := wsNormal;
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).FBtnRestore.Visible := False;
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).FBtnMax.Visible := True;
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).SetMDIFormActionPos;
    end;

    { TMDIButton }
    procedure TMDIButton.WndProc(var Msg: TMessage);
    begin
    if Msg.msg = wm_SetFocus then exit;
    inherited wndproc(Msg);
    end;
    { TWindowMinimize }
    procedure TWindowMinimize.ExecuteTarget(Target: TObject);
    begin
    inherited;
    PostMessage(MainForm.Handle,WM_SYSCOMMAND, SC_MINIMIZE,0); //最小化
    end;

    { TWindowCloseApp }

    procedure TWindowCloseApp.ExecuteTarget(Target: TObject);
    begin
    inherited;
    PostMessage(MainForm.Handle,WM_SYSCOMMAND, SC_CLOSE,0);//关闭
    end;

    { TWindowMax }

    procedure TWindowMax.ExecuteTarget(Target: TObject);
    begin
    inherited;
    // PostMessage(MainForm.Handle,WM_SYSCOMMAND, SC_MAXIMIZE,0);//最大化
    SetMaxScreen;
    // SetWindowLong(MainForm.Handle, GWL_STYLE, GetWindowLong(MainForm.Handle, GWL_STYLE) or WS_MAXIMIZE);
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).FBtnRestore.Visible := True;
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).FBtnMax.Visible := False;
    TTMEModelInputForm(GetForm(Target).ActiveMDIChild).SetMDIFormActionPos;
    end;

    procedure TTMEModelInputForm.FreeResource;
    begin
    //释放资源
    if assigned(FBtnClose) then
    begin
    FWindowCloseApp.ActionList := nil;
    FWindowCloseApp.free;
    FBtnClose.Free;
    FBtnClose := nil;
    end;
    if assigned(FBtnRestore) then
    begin
    FWindowRestore.ActionList := nil;
    FWindowRestore.free;
    FBtnRestore.Free;
    FBtnRestore := nil;
    end;
    if assigned(FBtnMin) then
    begin
    FWindowMinimize.ActionList := nil;
    FWindowMinimize.free;
    FBtnMin.Free;
    FBtnMin := nil;
    end;

    if assigned(FBtnMax) then
    begin
    FWindowMax.ActionList := nil;
    FWindowMax.free;
    FBtnMax.Free;
    FBtnMax := nil;
    end;
    end;

    procedure SetMaxScreen;
    var
    TrayWnd: HWnd; //任务栏句柄
    Rec: TRect;
    begin
    MainForm.WindowState := wsMaximized;
    TrayWnd := FindWindow('Shell_TrayWnd',nil);//得到任务栏句柄
    GetWindowRect(TrayWnd,Rec); //获取任务栏尺寸
    MainForm.Height :=Screen.Height-(rec.Bottom- rec.Top) + 15 ;
    MainForm.BorderStyle := bsNone;
    end;

    procedure GetComonFunc;
    const
    CCommonFunc: array[0..5] of string = ('TBXItem3', 'TBXItem9', 'TBXItem4', 'TBXItem5',
    'TBXItem34', 'TBXItem7');
    var
    I: Integer;
    begin
    oCommonFunc := TStringList.Create;
    for I := 0 to 5 do
    oCommonFunc.AddObject(CCommonFunc[I], nil);
    end;

    initialization
    GetComonFunc;

    finalization
    oCommonfunc.Free;

    end.

  • 相关阅读:
    jQuery实现“回到顶部”按钮功能
    围绕DOM元素节点的增删改查
    jQuery ajax
    对JSON的理解
    Replacing Accented characters(Diacritic) .NET
    全球主要城市经纬度api
    无标题
    Use Razor for Email Template outside ASP.NET MVC
    .NET and php
    knockoutjs
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/7743782.html
Copyright © 2020-2023  润新知