News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

show compiler flags switches in checklistbox text

Started by tiwag, August 04, 2005, 04:35:23 PM

Previous topic - Next topic

tiwag

following the recent discussion in this thread
http://forums.next.codeblocks.org/index.php/topic,662.0.html

i added code to the sdk/compileroptions.cpp in order to show the compiler option switches
in the checklistbox text   - in the format   "  descriptive text of option   [-switch] "

screenshot


patch: "sdk/compileroptions.cpp"

Index: sdk/compileroptions.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/compileroptions.cpp,v
retrieving revision 1.3
diff -u -r1.3 compileroptions.cpp
--- sdk/compileroptions.cpp 19 May 2005 13:16:16 -0000  1.3
+++ sdk/compileroptions.cpp 4 Aug 2005 14:07:25 -0000
@@ -79,7 +79,7 @@
    if (name.IsEmpty() || (option.IsEmpty() && additionalLibs.IsEmpty()))
        return;
    CompOption* coption = new CompOption;
-   coption->name = name;
+   coption->name =  name + "  [" + option + "]";
    coption->option = option;
    coption->additionalLibs = additionalLibs;
    coption->enabled = false;



what are you out there thinking about that ?

kagerato

That was quick :shock: .

Good job; always good to know what options you're really toggling.

David Perfors

OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

takeshimiya

#3
This is a must  :)

What happened to "Strip all symbols from binary (minimizes size) []" ?

BTW, don't forget always to put _() or _T() to make unicode friendly =)

tiwag

Quote from: takeshimiya on August 04, 2005, 07:23:44 PM
What happened to "Strip all symbols from binary (minimizes size) []" ?
This one would need an extra treatment for Linker-options - but i don't know if this is universal for all compilers - so i didn't implement Linker-options for now.

Quote from: takeshimiya on August 04, 2005, 07:23:44 PM
BTW, don't forget always to put _() or _T() to make unicode friendly =)
8)

tiwag

you can use this patch, which shows compileroptions if available - otherwise linkeroptions in the [].

sdk/compileroptions.cpp patch
Index: src/sdk/compileroptions.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/compileroptions.cpp,v
retrieving revision 1.3
diff -u -r1.3 compileroptions.cpp
--- src/sdk/compileroptions.cpp 19 May 2005 13:16:16 -0000  1.3
+++ src/sdk/compileroptions.cpp 4 Aug 2005 18:18:46 -0000
@@ -79,7 +79,15 @@
    if (name.IsEmpty() || (option.IsEmpty() && additionalLibs.IsEmpty()))
        return;
    CompOption* coption = new CompOption;
-   coption->name = name;
+   
+   wxString listboxname = name +wxT("  [");
+   if (option.IsEmpty())
+        listboxname += additionalLibs;
+    else
+        listboxname += option;
+    listboxname += wxT("]");
+
+   coption->name = listboxname;
    coption->option = option;
    coption->additionalLibs = additionalLibs;
    coption->enabled = false;

rickg22

tiwag: How about this: (it may be a little more complicated)

Why not make the list have columns like the compiler messages? The first
column would be the checkbox, the second would be the flag, and the third would
be the description :)

Can you do it?

tiwag

Quote from: rickg22 on August 04, 2005, 08:36:52 PM
tiwag: How about this: (it may be a little more complicated)

Why not make the list have columns like the compiler messages? The first
column would be the checkbox, the second would be the flag, and the third would
be the description :)

Can you do it?

Hi rick ! good suggestion
my first attempt to improve this dialog was also to show   1.) checkbox  2.) switch  3.) descriptive text

but it looks ugly, because some switches are really long, like [-pedantic-error]  or [-Wfatal-errors] and
almost all of the processor spefic switches like [-march=pentium-mmx]
and others are totally short [-s] [-g] and so on

hence i decided, it looks much better to append the [switch] after the descriptive text as it is now.