CnPack Forum


 
Subject: Show configuration
ma1999
新警察
Rank: 1



UID 2123
Digest Posts 0
Credits 19
Posts 8
点点分 19
Reading Access 10
Registered 2006-4-21
Status Offline
Post at 2008-10-20 07:07  Profile | Blog | P.M. 
Show configuration

Request, in C++ I often switch between DEBUG and RELEASE configuration.
However, what configuration I have does not show on screen (I have to go
into menus to see it) and the way to change it is not fast.
Would it be possible to add a combobox to your editor toolbar that lists
the configurations, shows the current one and allows change ??

/\/\artin
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2008-10-24 09:11  Profile | Blog | P.M. 
Seems IDE does not provide this interface to control, or we just not found.

We'll do the research.
Top
hubdog
新警察
Rank: 1



UID 636
Digest Posts 0
Credits 17
Posts 12
点点分 17
Reading Access 10
Registered 2005-1-9
Status Offline
Post at 2008-10-24 16:16  Profile | Blog | P.M. 
Reply #2 Passion's post

Hi, Passion , I think the IOTABuildConfiguration interface in Toolsapi.pas of Delphi 2009 could do the work. Maybe you can try it. Sorry I do not have much leisure time otherwise I will be like do it by myself .
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2008-10-24 17:27  Profile | Blog | P.M. 
Thanks for the hint, I'll check it.
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-1-17 17:10  Profile | Blog | P.M. 
Build configuration related features now has been supported by our CnWizards' Pascal script, you can refer to the PSDemo\BuildConfiguration.pas to write a script and run it to switch active configuration.

This feature will be in our latest nightly build 0.9.8.479 and later. http://www.cnpack.org/downbuilds.php
Top
ma1999
新警察
Rank: 1



UID 2123
Digest Posts 0
Credits 19
Posts 8
点点分 19
Reading Access 10
Registered 2006-4-21
Status Offline
Post at 2009-1-18 10:00  Profile | Blog | P.M. 
Reply #5 Passion's post

Hi, tried it and it works well !

However, how do i place a combobox on screen (in a toolbar?) that I can fill with the current configs ?
And how do I know when the combobox is changed and how do I update the combobox when the configs are changed by the builtin dialog.

Can I do stuff like this with scripts or do I need your help ?
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-1-18 23:34  Profile | Blog | P.M. 
Unfortunately, though we can place an combobox under Toolbar or IDE Mainform using Pascal Script, it's hard or impossible to set combobox's events to our script. They're different running environment. So I think we can only write a script for manual switching, not "visual" style like you described.
Top
ma1999
新警察
Rank: 1



UID 2123
Digest Posts 0
Credits 19
Posts 8
点点分 19
Reading Access 10
Registered 2006-4-21
Status Offline
Post at 2009-1-19 05:24  Profile | Blog | P.M. 
Reply #7 Passion's post

OK, but is it possible to at least show the current config, that is can there be an event that fires when the configuration changes ? Want to place the text somewhere (on the Toolbar would be perfect).

Did this really simple script and it works the first time it runs (runs on ofnActiveProjectChange). Traps the second time....

program BC;
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

var
  BC: IOTAProjectOptionsConfigurations;
  Bar: TStatusBar;
begin
    BC := CnOtaGetActiveProjectOptionsConfigurations(nil);
    if BC <> nil then
    begin
       ShowMessage(BC.GetActiveConfiguration.GetName);
       // Bar := GetStatusBarFromEditor(GetCurrentEditControl);
       // Bar.SimplePanel := True;
       // Bar.SimpleText  := BC.GetActiveConfiguration.GetName;
    end;
end.
Top
 




All times are GMT++8, the time now is 2024-11-22 05:31

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

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