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 ??


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 and later. [url][/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;
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

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

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

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