CnPack Forum


 
Subject: 如何使用脚本专家控制代码编辑器的最大化
kendling (小冬)
高级版主
Rank: 8Rank: 8
MyvNet


Medal No.1  
UID 703
Digest Posts 5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
Post at 2008-7-17 14:32  Profile | Site | Blog | P.M.  | QQ | Yahoo!
如何使用脚本专家控制代码编辑器的最大化

把下面的代码保存成SwitchSourceEditorMaximize.pas,然后在脚本专家里添加进去。
给个热键,我使用的是Ctrl+Alt+-。
把“手动执行脚本时需要确认”去掉,对于这个脚本非常的烦。
最后试试你刚设的热键,爽吧?再也不需要去双击标题了。

代码非常简单,所以就没有写注释了。

{*******************************************************}
{                                                       }
{       Pascal Script Source File                       }
{       Run by RemObjects Pascal Script in CnWizards    }
{                                                       }
{       Generated by CnPack IDE Wizards                 }
{                                                       }
{       Using maximize or restore source editor window  }
{       Writed by Kend                                  }
{                                                       }
{*******************************************************}

program SwitchSourceEditorMaximize;

uses
  CnWizUtils;

var
  srcEditor: IOTASourceEditor;
  editView: IOTAEditView;
  editWindow: TCustomForm;
begin
  srcEditor := CnOtaGetCurrentSourceEditor;
  editView := CnOtaGetTopMostEditView(srcEditor);
  editWindow := editView.GetEditWindow.GetForm;

  if IsIdeEditorForm(editWindow) then
    if editWindow.WindowState <> wsMaximized then
      editWindow.WindowState := wsMaximized
    else
      editWindow.WindowState := wsNormal;
end.





小冬
http://MyvNet.com
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2008-7-18 09:37  Profile | Blog | P.M. 
good
Top
 




All times are GMT++8, the time now is 2024-3-29 08:09

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.006095 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP