Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: tiwag on August 04, 2005, 04:35:23 pm

Title: show compiler flags switches in checklistbox text
Post by: tiwag on August 04, 2005, 04:35:23 pm
following the recent discussion in this thread
http://forums.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
(http://tiwag.front.ru/codeblocks/compiler_options/options_shown.png)

patch: "sdk/compileroptions.cpp"
Code
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 ?
Title: Re: show compiler flags switches in checklistbox text
Post by: kagerato on August 04, 2005, 05:39:34 pm
That was quick :shock: .

Good job; always good to know what options you're really toggling.
Title: Re: show compiler flags switches in checklistbox text
Post by: David Perfors on August 04, 2005, 05:59:29 pm
I think it is a good thing to add.
Title: Re: show compiler flags switches in checklistbox text
Post by: takeshi miya on August 04, 2005, 07:23:44 pm
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 =)
Title: Re: show compiler flags switches in checklistbox text
Post by: tiwag on August 04, 2005, 07:51:41 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.

BTW, don't forget always to put _() or _T() to make unicode friendly =)
8)
Title: Re: show compiler flags switches in checklistbox text
Post by: tiwag on August 04, 2005, 08:27:27 pm
you can use this patch, which shows compileroptions if available - otherwise linkeroptions in the [].

sdk/compileroptions.cpp patch
Code
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;
Title: Re: show compiler flags switches in checklistbox text
Post by: 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?
Title: Re: show compiler flags switches in checklistbox text
Post by: tiwag on August 04, 2005, 08:45:50 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.