Board logo

Subject: Show configuration [Print This Page]

Author: ma1999    Time: 2008-10-20 07:07     Subject: 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
Author: Passion    Time: 2008-10-24 09:11

Seems IDE does not provide this interface to control, or we just not found.

We'll do the research.
Author: hubdog    Time: 2008-10-24 16:16     Subject: 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 .
Author: Passion    Time: 2008-10-24 17:27

Thanks for the hint, I'll check it.
Author: Passion    Time: 2009-1-17 17:10

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
Author: ma1999    Time: 2009-1-18 10:00     Subject: 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 ?
Author: Passion    Time: 2009-1-18 23:34

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




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0