CnPack Forum » CnWizards IDE Wizards » Show configuration


2008-10-20 07:07 ma1999
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

2008-10-24 09:11 Passion
Seems IDE does not provide this interface to control, or we just not found.:L

We'll do the research.

2008-10-24 16:16 hubdog
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:Q .

2008-10-24 17:27 Passion
Thanks for the hint, I'll check it.:handshake

2009-1-17 17:10 Passion
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. [url]http://www.cnpack.org/downbuilds.php[/url]

2009-1-18 10:00 ma1999
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 ?

2009-1-18 23:34 Passion
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.:L

2009-1-19 05:24 ma1999
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.

页: [1]
查看完整版本: Show configuration


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.