~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/wxsitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
* You should have received a copy of the GNU General Public License
16
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
17
17
*
18
 
* $Revision: 4850 $
19
 
* $Id: wxsitem.cpp 4850 2008-01-29 21:45:49Z byo $
20
 
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/wxsitem.cpp $
 
18
* $Revision: 6219 $
 
19
* $Id: wxsitem.cpp 6219 2010-05-12 14:12:01Z biplab $
 
20
* $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/contrib/wxSmith/wxwidgets/wxsitem.cpp $
21
21
*/
22
22
 
23
23
#include "wxsitem.h"
232
232
            if ( PropertiesFlags&flColours )
233
233
            {
234
234
                wxString FGCol = m_BaseProperties.m_Fg.BuildCode(GetCoderContext());
 
235
                #if wxCHECK_VERSION(2, 9, 0)
 
236
                if ( !FGCol.empty() ) Codef(_T("%ASetForegroundColour(%s);\n"),FGCol.wx_str());
 
237
                #else
235
238
                if ( !FGCol.empty() ) Codef(_T("%ASetForegroundColour(%s);\n"),FGCol.c_str());
 
239
                #endif
236
240
 
237
241
                wxString BGCol = m_BaseProperties.m_Bg.BuildCode(GetCoderContext());
 
242
                #if wxCHECK_VERSION(2, 9, 0)
 
243
                if ( !BGCol.empty() ) Codef(_T("%ASetBackgroundColour(%s);\n"),BGCol.wx_str());
 
244
                #else
238
245
                if ( !BGCol.empty() ) Codef(_T("%ASetBackgroundColour(%s);\n"),BGCol.c_str());
 
246
                #endif
239
247
            }
240
248
 
241
249
            if ( PropertiesFlags&flFont )
243
251
                wxString FontVal = m_BaseProperties.m_Font.BuildFontCode(GetVarName() + _T("Font"), GetCoderContext());
244
252
                if ( !FontVal.empty() )
245
253
                {
 
254
                    #if wxCHECK_VERSION(2, 9, 0)
 
255
                    Codef(_T("%s%ASetFont(%sFont);\n"),FontVal.wx_str(),GetVarName().wx_str());
 
256
                    #else
246
257
                    Codef(_T("%s%ASetFont(%sFont);\n"),FontVal.c_str(),GetVarName().c_str());
 
258
                    #endif
247
259
                }
248
260
            }
249
261
 
 
262
            #if wxCHECK_VERSION(2, 9, 0)
 
263
            if ( (PropertiesFlags&flToolTip)  && !m_BaseProperties.m_ToolTip.IsEmpty()  )   Codef(_T("%ASetToolTip(%t);\n"),m_BaseProperties.m_ToolTip.wx_str());
 
264
            if ( (PropertiesFlags&flHelpText) && !m_BaseProperties.m_HelpText.IsEmpty() )   Codef(_T("%ASetHelpText(%t);\n"),m_BaseProperties.m_HelpText.wx_str());
 
265
            #else
250
266
            if ( (PropertiesFlags&flToolTip)  && !m_BaseProperties.m_ToolTip.IsEmpty()  )   Codef(_T("%ASetToolTip(%t);\n"),m_BaseProperties.m_ToolTip.c_str());
251
267
            if ( (PropertiesFlags&flHelpText) && !m_BaseProperties.m_HelpText.IsEmpty() )   Codef(_T("%ASetHelpText(%t);\n"),m_BaseProperties.m_HelpText.c_str());
 
268
            #endif
252
269
            if ( (PropertiesFlags&flExtraCode) && !m_BaseProperties.m_ExtraCode.IsEmpty() )
253
270
            {
254
271
                wxString& ExtraCode = m_BaseProperties.m_ExtraCode;
265
282
                wxString ExStyleStr = m_BaseProperties.m_StyleSet->GetString(m_BaseProperties.m_ExStyleBits,true,wxsCPP);
266
283
                if ( ExStyleStr != _T("0") )
267
284
                {
 
285
                    #if wxCHECK_VERSION(2, 9, 0)
 
286
                    Codef(_T("%ASetExtraStyle( %AGetExtraStyle() | %s );\n"),ExStyleStr.wx_str());
 
287
                    #else
268
288
                    Codef(_T("%ASetExtraStyle( %AGetExtraStyle() | %s );\n"),ExStyleStr.c_str());
 
289
                    #endif
269
290
                }
270
291
            }
271
292
 
917
938
 
918
939
                        default:
919
940
                        {
 
941
                            #if wxCHECK_VERSION(2, 9, 0)
 
942
                            Result.Append(*Fmt);
 
943
                            #else
920
944
                            *Result.Append(*Fmt);
 
945
                            #endif
921
946
                        }
922
947
                    }
923
948
                    Fmt++;
1020
1045
    return Code;
1021
1046
}
1022
1047
 
 
1048
wxSize wxsItem::Size(wxWindow* Parent)
 
1049
{
 
1050
    const wxSize minSize = GetBaseProps()->m_MinSize.GetSize(Parent);
 
1051
    if ( minSize != wxDefaultSize )
 
1052
    {
 
1053
        return minSize;
 
1054
    }
 
1055
    else
 
1056
    {
 
1057
        return GetBaseProps()->m_Size.GetSize(Parent);
 
1058
    }
 
1059
}
 
1060
 
1023
1061
bool wxsItem::OnMouseDClick(wxWindow* Preview,int PosX,int PosY)
1024
1062
{
1025
1063
    // Search for first event (skip all categories)