当前位置: 首页>>代码示例>>C++>>正文


C++ wxColour函数代码示例

本文整理汇总了C++中wxColour函数的典型用法代码示例。如果您正苦于以下问题:C++ wxColour函数的具体用法?C++ wxColour怎么用?C++ wxColour使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wxColour函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: top

void CamArtProvider::Draw(wxDC& dc, const wxRect & rect, ResourceID Resource, CamArtFlags Flags, const wxString &text)
{
	dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
	dc.SetPen(*wxTRANSPARENT_PEN);
//	dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
	
//	dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
	dc.SetBrush(*wxTRANSPARENT_BRUSH); // Needed in case we need to paint 3D furniture, but not the button top (ALWAYS3D)

	wxRect brect = rect;

	UINT32 bitmapoffsetX=0;
	UINT32 bitmapoffsetY=0;

	if ((Flags & CAF_PUSHBUTTON) && !rect.IsEmpty())
	{
		// 3Dness
		brect.width-=1;
		brect.height-=1;
		
		if (Flags & CAF_SELECTED)
		{
			// It's pushed in
			brect.x++;
			brect.y++;
		}

		UINT32 InternalBorderX = (Flags & CAF_NOINTERNALBORDER)?0:2;
		UINT32 InternalBorderY = (Flags & CAF_NOINTERNALBORDER)?0:1;

		bitmapoffsetX=1+((InternalBorderX+1)>>1); // this is a completely independent offset to the brect stuff, which gives the bitmap a border
		bitmapoffsetY=1+((InternalBorderY+1)>>1); // this is a completely independent offset to the brect stuff, which gives the bitmap a border

//		BOOL FaceSelected = ( (Flags & CAF_SELECTED) || (Flags & CAF_BUTTONHOVER) );
//		BOOL Border3D = ( (Flags & CAF_SELECTED) || (Flags & CAF_ALWAYS3D));

		BOOL FaceSelected = ( (Flags & CAF_SELECTED) || ((Flags & CAF_ALWAYS3D) && (Flags & CAF_BUTTONHOVER)) ); // highlight face on hover if always3D
		BOOL Border3D = ( (Flags & CAF_SELECTED) || (Flags & CAF_ALWAYS3D) || (Flags & CAF_BUTTONHOVER));

		// Change the brush if the face is selected
		if (FaceSelected)
		{
			if (Flags & CAF_TOOLBACKGROUND)
				dc.SetBrush(wxColour(255,255,192)); // A light yellow - we should load this from somewhere else
			else
			{	
				if (Flags & CAF_BUTTONHOVER)
					dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT));
				else	
					dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
			}
		}

		if (Border3D)
		{
			// draw the light highlights
			dc.SetPen(wxSystemSettings::GetColour((Flags & CAF_SELECTED)?wxSYS_COLOUR_3DHIGHLIGHT:wxSYS_COLOUR_3DDKSHADOW));
			// draw the background behind the button undisplaced
			dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
			// now draw the left & top bits
			dc.SetPen(wxSystemSettings::GetColour((Flags & CAF_SELECTED)?wxSYS_COLOUR_3DDKSHADOW:wxSYS_COLOUR_3DHIGHLIGHT));
			dc.DrawLine(rect.x, rect.y, rect.x+rect.width-1, rect.y);
			dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height-1);
		}
		else if (FaceSelected) // if not FaceSelected, we've already drawn it
		{
			// draw the background behind the button displaced
			dc.DrawRectangle(brect.x, brect.y, brect.width, brect.height);
		}
	}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:70,代码来源:cartprov.cpp

示例2: wxColour

//--------------------------------------------------------------------------
//  void wxPLDevDC::SetColor1( PLStream *pls )
//
//  Set color from colormap 1.
//--------------------------------------------------------------------------
void wxPLDevDC::SetColor1( PLStream *pls )
{
    m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a * 255 ),
                         pls->width > 0 ? pls->width : 1, wxSOLID ) ) );
    m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a * 255 ) ) );
}
开发者ID:FreeScienceCommunity,项目名称:PLPlot,代码行数:11,代码来源:deprecated_wxwidgets_dc.cpp

示例3: Create

wxsImageTreeEditorDlg::wxsImageTreeEditorDlg(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
{
    //(*Initialize(wxsImageTreeEditorDlg)
    wxGridSizer* GridSizer1;
    wxBoxSizer* BoxSizer3;
    wxBoxSizer* BoxSizer10;
    wxBoxSizer* BoxSizer7;
    wxBoxSizer* BoxSizer11;
    wxBoxSizer* BoxSizer13;
    wxBoxSizer* BoxSizer2;
    wxBoxSizer* BoxSizer9;
    wxBoxSizer* BoxSizer4;
    wxBoxSizer* BoxSizer8;
    wxBoxSizer* BoxSizer1;
    wxBoxSizer* BoxSizer12;
    wxBoxSizer* BoxSizer6;
    wxBoxSizer* BoxSizer5;

    Create(parent, wxID_ANY, _("Tree Item Editor"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
    wxFont thisFont(8,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT);
    SetFont(thisFont);
    BoxSizer1 = new wxBoxSizer(wxVERTICAL);
    BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
    StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Edit Tree Items"), wxPoint(0,0), wxSize(400,20), wxST_NO_AUTORESIZE|wxALIGN_CENTRE, _T("ID_STATICTEXT1"));
    wxFont StaticText1Font(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
    StaticText1->SetFont(StaticText1Font);
    BoxSizer2->Add(StaticText1, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
    BoxSizer1->Add(BoxSizer2, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
    BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
    BoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
    StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("tree-name"));
    Tree1 = new wxTreeCtrl(this, ID_TREECTRL1, wxPoint(2,36), wxSize(246,359), wxTR_EDIT_LABELS|wxTR_DEFAULT_STYLE, wxDefaultValidator, _T("ID_TREECTRL1"));
    StaticBoxSizer1->Add(Tree1, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer5->Add(StaticBoxSizer1, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer3->Add(BoxSizer5, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 0);
    BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
    StaticBoxSizer2 = new wxStaticBoxSizer(wxVERTICAL, this, _("Attributes"));
    BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    bAddItem = new wxBitmapButton(this, ID_IMAGEBUTTON1, wxNullBitmap, wxPoint(256,36), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_IMAGEBUTTON1"));
    bAddItem->SetToolTip(_("Add A New Item"));
    BoxSizer7->Add(bAddItem, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText2 = new wxStaticText(this, wxID_ANY, _("Add Item"), wxPoint(290,40), wxDefaultSize, 0, _T("wxID_ANY"));
    BoxSizer7->Add(StaticText2, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer7, 0, wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 0);
    BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
    bAddSubItem = new wxBitmapButton(this, ID_IMAGEBUTTON2, wxNullBitmap, wxPoint(256,66), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_IMAGEBUTTON2"));
    bAddSubItem->SetToolTip(_("Add A New Child"));
    BoxSizer8->Add(bAddSubItem, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Add Sub-Item"), wxPoint(290,70), wxDefaultSize, 0, _T("ID_STATICTEXT3"));
    BoxSizer8->Add(StaticText3, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer8, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
    bDelItem = new wxBitmapButton(this, ID_IMAGEBUTTON3, wxNullBitmap, wxPoint(256,96), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_IMAGEBUTTON3"));
    bDelItem->SetToolTip(_("Delete Current Item"));
    BoxSizer9->Add(bDelItem, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Delete Current Item"), wxPoint(290,100), wxDefaultSize, 0, _T("ID_STATICTEXT4"));
    BoxSizer9->Add(StaticText4, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer9, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
    bDelAllItems = new wxBitmapButton(this, ID_IMAGEBUTTON4, wxNullBitmap, wxPoint(256,126), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_IMAGEBUTTON4"));
    bDelAllItems->SetToolTip(_("Delete All Items"));
    BoxSizer10->Add(bDelAllItems, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Delete All Items"), wxPoint(290,130), wxDefaultSize, 0, _T("ID_STATICTEXT5"));
    BoxSizer10->Add(StaticText5, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer10, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
    bItemColor = new wxButton(this, ID_BUTTON3, _("C"), wxPoint(256,156), wxSize(24,24), 0, wxDefaultValidator, _T("ID_BUTTON3"));
    wxFont bItemColorFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,_T("Arial Black"),wxFONTENCODING_DEFAULT);
    bItemColor->SetFont(bItemColorFont);
    bItemColor->SetToolTip(_("Set Item Text Color"));
    BoxSizer11->Add(bItemColor, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText6 = new wxStaticText(this, ID_STATICTEXT6, _("Set Item Text Color"), wxPoint(290,160), wxDefaultSize, 0, _T("ID_STATICTEXT6"));
    BoxSizer11->Add(StaticText6, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer11, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
    cxItemBold = new wxCheckBox(this, ID_CHECKBOX1, _(" Set Item Text Bold"), wxPoint(262,192), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
    cxItemBold->SetValue(false);
    cxItemBold->SetToolTip(_("Set Item Text Bold"));
    BoxSizer12->Add(cxItemBold, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer12, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    BoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
    bEditItem = new wxBitmapButton(this, ID_IMAGEBUTTON5, wxNullBitmap, wxPoint(256,216), wxSize(24,23), wxBU_AUTODRAW, wxDefaultValidator, _T("ID_IMAGEBUTTON5"));
    bEditItem->SetToolTip(_("Start Editor On Current Item"));
    BoxSizer13->Add(bEditItem, 0, wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    StaticText11 = new wxStaticText(this, ID_STATICTEXT11, _("Edit Current Item"), wxPoint(290,220), wxDefaultSize, 0, _T("ID_STATICTEXT11"));
    BoxSizer13->Add(StaticText11, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(BoxSizer13, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
    GridSizer1 = new wxGridSizer(5, 2, 0, 0);
    StaticText12 = new wxStaticText(this, ID_STATICTEXT12, _("Image-List"), wxPoint(256,272), wxDefaultSize, 0, _T("ID_STATICTEXT12"));
    GridSizer1->Add(StaticText12, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    StaticText13 = new wxStaticText(this, ID_STATICTEXT13, _("Label"), wxPoint(310,272), wxSize(82,14), wxST_NO_AUTORESIZE, _T("ID_STATICTEXT13"));
    StaticText13->SetForegroundColour(wxColour(0,0,255));
    GridSizer1->Add(StaticText13, 0, wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
    cbNormal = new wxBitmapComboBox(this, ID_COMBOBOX1, wxEmptyString, wxPoint(256,296), wxSize(48,22), 0, NULL, wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX1"));
    GridSizer1->Add(cbNormal, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 3);
    StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("Normal Image"), wxPoint(310,300), wxDefaultSize, 0, _T("ID_STATICTEXT7"));
    GridSizer1->Add(StaticText7, 0, wxTOP|wxLEFT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 3);
    cbSelected = new wxBitmapComboBox(this, ID_COMBOBOX2, wxEmptyString, wxPoint(256,326), wxSize(48,22), 0, NULL, wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX2"));
    GridSizer1->Add(cbSelected, 0, wxTOP|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 3);
    StaticText8 = new wxStaticText(this, ID_STATICTEXT8, _("Selected Image"), wxPoint(310,330), wxDefaultSize, 0, _T("ID_STATICTEXT8"));
//.........这里部分代码省略.........
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:101,代码来源:wxsimagetreeeditordlg.cpp

示例4: wxColour

Theme& Theme::loadWalls(unsigned long colour){
	_walls = wxColour(colour);
	return *this;
}
开发者ID:GSource2015,项目名称:Twisted-Mind,代码行数:4,代码来源:Theme.cpp

示例5: g_fontStatus

#include "nwx/nwxBatch.h"
#include "nwx/nwxGrid.h"
#include "Platform.h"

#if USE_WINGDINGS
wxFont CGridAnalysis::g_fontStatus(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("wingdings"));
#else
// X11 if ever implemented
wxFont CGridAnalysis::g_fontStatus;
#endif

const wxString CGridAnalysis::g_sSampleLevelNeedsAttention(_T("*"));
const wxString CGridAnalysis::g_sStatusNeedsAttention(_T(CHAR_ATTN));
const wxString CGridAnalysis::g_sStatusOK(_T(CHAR_OK));

wxPen CGridAnalysis::g_LIGHT_GREY(wxColour(216,216,216),1,wxSOLID);

IMPLEMENT_ABSTRACT_CLASS(CGridAnalysis,wxGrid)

CGridAnalysis::~CGridAnalysis()
{;}

CGridAnalysis::CGridAnalysis(wxWindow *pParent) :
  wxGrid(pParent,IDgrid),
  m_bgBold(255,255,160),
  m_bgNormal(255,255,255),
  m_bgRowHasAlert(255,255,218),
  m_fgBold(192,0,0),
  m_fgNormal(0,0,0),
  m_pDC(NULL),
  m_nLabelSize(0),
开发者ID:ForensicBioinformatics,项目名称:osiris,代码行数:31,代码来源:CGridAnalysis.cpp

示例6: wxImage

// Code below taken from the internet after nasty troubles with the cursor
// initialization in GTK
//http://cvs.sourceforge.net/viewcvs.py/audacity/audacity-src/src/TrackPanel.cpp?rev=1.218
wxCursor* tui::MakeCursor( const char * pXpm[36],  int HotX, int HotY ) {
   wxCursor * pCursor;
   const int HotAdjust =0;

   wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());   
   Image.SetMaskColour(255,0,0);
   Image.SetMask();// Enable mask.

#ifdef __WXGTK__
   //
   // Kludge: the wxCursor Image constructor is broken in wxGTK.
   // This code, based loosely on the broken code from the wxGTK source,
   // works around the problem by constructing a 1-bit bitmap and
   // calling the other custom cursor constructor.
   //
   // -DMM
   //

   unsigned char *rgbBits = Image.GetData();
   int w = Image.GetWidth() ;
   int h = Image.GetHeight();
   int imagebitcount = (w*h)/8;
   
   unsigned char *bits = DEBUG_NEW unsigned char [imagebitcount];
   unsigned char *maskBits = DEBUG_NEW unsigned char [imagebitcount];

   int i, j, i8;
   unsigned char cMask;
   for (i=0; i<imagebitcount; i++) {
      bits[i] = 0;
      i8 = i * 8;

      cMask = 1;
      for (j=0; j<8; j++) {
         if (rgbBits[(i8+j)*3+2] < 127)
            bits[i] = bits[i] | cMask;
         cMask = cMask * 2;
      }
   }

   for (i=0; i<imagebitcount; i++) {
      maskBits[i] = 0x0;
      i8 = i * 8;

      cMask = 1;
      for (j=0; j<8; j++) {
         if (rgbBits[(i8+j)*3] < 127 || rgbBits[(i8+j)*3+1] > 127)
            maskBits[i] = maskBits[i] | cMask;
         cMask = cMask * 2;
      }
   }

   wxColour* col_black = DEBUG_NEW wxColour(  0,   0,   0);
   wxColour* col_white = DEBUG_NEW wxColour(255, 255, 255);

   pCursor = DEBUG_NEW wxCursor((const char *)bits, w, h,
                          HotX-HotAdjust, HotY-HotAdjust,
                          (const char *)maskBits,
                          col_black,
                          col_white);

   delete [] bits;
   delete [] maskBits;
   delete col_black;
   delete col_white;
#else 
   Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
   Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
   pCursor = DEBUG_NEW wxCursor( Image );
#endif

   return pCursor;
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:76,代码来源:layoutcanvas.cpp

示例7: GetBackgroundColour

void about::Update()
{

    wxColor bg = GetBackgroundColour();
    wxColor fg = wxColour(0,0,0); //FontMgr::Get().GetFontColor( _("Dialog") );

    wxString aboutText;
    aboutText.Printf( _T("<html><body bgcolor=#%02x%02x%02x><font color=#%02x%02x%02x>"),
                   bg.Red(), bg.Blue(), bg.Green(), fg.Red(), fg.Blue(), fg.Green() );
    
    wxFont *dFont = FontMgr::Get().GetFont( _("Dialog") );
    wxString face = dFont->GetFaceName();
    
    #ifdef __WXOSX__
    int points = dFont->GetPointSize();
    #else
    int points = dFont->GetPointSize() + 1;
    #endif
    
    int sizes[7];
    for ( int i=-2; i<5; i++ ) {
        sizes[i+2] = points + i + (i>0?i:0);
    }
    pAboutHTMLCtl->SetFonts(face, face, sizes);
    
    if(wxFONTSTYLE_ITALIC == dFont->GetStyle())
        aboutText += _T("<i>");
    
    wxString *pAboutString = new wxString( AboutText, wxConvUTF8 );
    pAboutString->Append( OpenCPNVersion );
    pAboutString->Append( wxString( OpenCPNInfo, wxConvUTF8 ) );
    
    // Show the user where the log file is going to be
    wxString log = _T("    Logfile location: ");
    log.Append( g_Platform->GetLogFileName() );
    pAboutString->Append(log);
    
    // Show the user where the config file is going to be
    wxString conf = _T("<br><br>    Config file location: ");
    conf.Append( g_Platform->GetConfigFileName() );
    pAboutString->Append(conf);
    
    aboutText << *pAboutString;
    delete pAboutString;
    
    aboutText << _T("</font>");
    if(wxFONTSTYLE_ITALIC == dFont->GetStyle())
        aboutText << _T("</i>");
    
    aboutText << _T("</body></html>");
    
    pAboutHTMLCtl->SetPage( aboutText );

    
    pAuthorTextCtl->Clear();
    wxString *pAuthorsString = new wxString( AuthorText, wxConvUTF8 );
    pAuthorTextCtl->WriteText( *pAuthorsString );
    pAuthorTextCtl->SetInsertionPoint( 0 );
    
    delete pAuthorsString;

    pLicenseTextCtl->Clear();
    wxString license_loc(m_DataLocn );
    license_loc.Append( _T("license.txt") );

    wxTextFile license_file( license_loc );

    if( license_file.Open() ) {
        wxString str;
        str = license_file.GetFirstLine();
        pLicenseTextCtl->WriteText( str );

        while( !license_file.Eof() ) {
            str = license_file.GetNextLine();
            str.Append( _T("\n") );
            pLicenseTextCtl->AppendText( str );
        }
        license_file.Close();
    } else {
        wxString msg( _T("Could not open License file: ") );
        msg.Append( license_loc );
        wxLogMessage( msg );
    }
    pLicenseTextCtl->SetInsertionPoint( 0 );

    SetColorScheme();
}
开发者ID:ekorel,项目名称:OpenCPN,代码行数:87,代码来源:about.cpp

示例8: defined

APalette::APalette(wxWindow * parent, wxWindowID id,
                       const wxPoint & pos,
                       const wxSize & size):wxWindow(parent, id, pos, size)
{
#if defined(__WXMAC__)          // && defined(TARGET_CARBON)
   int off = 1;
#else
   int off = 0;
#endif

   mTool[0] =
       new AButton(this, ID_IBEAM, wxPoint(off, off), wxSize(27, 27),
                   (char **) IBeamUp, (char **) IBeamOver,
                   (char **) IBeamDown, (char **) IBeamUp);
   mTool[1] =
       new AButton(this, ID_SELECT, wxPoint(28, off), wxSize(27, 27),
                   (char **) SelectUp, (char **) SelectOver,
                   (char **) SelectDown, (char **) SelectUp);
   mTool[2] =
       new AButton(this, ID_MOVE, wxPoint(off, 28), wxSize(27, 27),
                   (char **) MoveUp, (char **) MoveOver,
                   (char **) MoveDown, (char **) MoveUp);
   mTool[3] =
       new AButton(this, ID_ZOOM, wxPoint(28, 28), wxSize(27, 27),
                   (char **) ZoomUp, (char **) ZoomOver,
                   (char **) ZoomDown, (char **) ZoomUp);

   mPlay =
       new AButton(this, ID_PLAY_BUTTON, wxPoint(64, 4), wxSize(48, 48),
                   (char **) PlayUp, (char **) PlayOver,
                   (char **) PlayDown, (char **) PlayDisabled);
   mStop =
       new AButton(this, ID_STOP_BUTTON, wxPoint(114, 4), wxSize(48, 48),
                   (char **) StopUp, (char **) StopOver,
                   (char **) StopDown, (char **) StopDisabled);

   mRecord =
       new AButton(this, ID_RECORD_BUTTON, wxPoint(164, 4), wxSize(48, 48),
                   (char **) RecordUp, (char **) RecordOver,
                   (char **) RecordDown, (char **) RecordDisabled);

#if defined(__WXMAC__)          // && defined(TARGET_CARBON)
   int sliderX = 262;
#else
   int sliderX = 222;
#endif

   mVolume =
       new ASlider(this, 0, wxPoint(sliderX, 14), wxSize(100, 28),
                   (char **) Slider, (char **) SliderThumb, 100);

   mVolume->Set(80);

   mCurrentTool = 0;
   mTool[0]->PushDown();

   mBackgroundBrush.SetColour(wxColour(204, 204, 204));
   mBackgroundPen.SetColour(wxColour(204, 204, 204));

   mBackgroundBitmap = NULL;
   mBackgroundHeight = 0;
   mBackgroundWidth = 0;

#if defined(__WXMAC__)          // && defined(TARGET_CARBON)
   mDivBitmap = new wxBitmap((const char **) Div);
   mMuteBitmap = new wxBitmap((const char **) Mute);
   mLoudBitmap = new wxBitmap((const char **) Loud);
#endif
}
开发者ID:andreipaga,项目名称:audacity,代码行数:69,代码来源:APalette.cpp

示例9: WXUNUSED

void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
    CMainDocument* pDoc = wxGetApp().GetDocument();
    wxString diskspace;
	static double project_total=0.0;
	unsigned int i;

    wxASSERT(pDoc);
    wxASSERT(wxDynamicCast(pDoc, CMainDocument));

	//get data for BOINC projects disk usage
    pDoc->CachedDiskUsageUpdate();
    pDoc->CachedStateUpdate();
	bool refreshBOINC=false;
	if (pDoc->disk_usage.projects.size()>0) {
		m_BOINCwasEmpty=false;
		//check for changes worth a refresh
		if(pDoc->disk_usage.projects.size() != m_pieCtrlBOINC->m_Series.size()) {
			refreshBOINC=true;
		} else {
			for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
				wxString oldValue;
				wxString newValue;
				FormatDiskSpace(pDoc->DiskUsageProject(i)->disk_usage, newValue);
				FormatDiskSpace(m_pieCtrlBOINC->m_Series.Item(i).GetValue(), oldValue);
				if(newValue.Cmp(oldValue)!=0) {
					refreshBOINC=true;
					break;
				}
			}
		}
		//only refresh when worthy changes
		if(refreshBOINC) {
			m_pieCtrlBOINC->m_Series.Clear();
            project_total = 0;
			for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
				//update data for boinc projects pie chart
				PROJECT* project = pDoc->DiskUsageProject(i);
				wxString projectname;
				FormatProjectName(project, projectname);
				FormatDiskSpace(project->disk_usage, diskspace);
				double usage = project->disk_usage;
				project_total += usage;
				wxPiePart part;
                part.SetLabel(projectname + wxT(": ") + diskspace);
				part.SetValue(usage);
                unsigned char r=128+(rand()&127);
                unsigned char g=128+(rand()&127);
                unsigned char b=128+(rand()&127);
                part.SetColour(wxColour(r, g, b));
				m_pieCtrlBOINC->m_Series.Add(part);
			}
			m_pieCtrlBOINC->Refresh();
		}
	} else {
		if(!m_BOINCwasEmpty) {
            //paint an empty black pie
			m_pieCtrlBOINC->m_Series.Clear();
			wxPiePart part;
            part.SetLabel(_("no projects: 0 bytes used"));
			part.SetValue(1);
			part.SetColour(wxColour(0,0,0));
			m_pieCtrlBOINC->m_Series.Add(part);
			m_pieCtrlBOINC->Refresh();
			m_BOINCwasEmpty=true;
			refreshBOINC=true;
        }
	}

    //pDoc->disk_usage.d_allowed = 0;
	//data for pie chart 2 (total disk usage)
	//
	// good source of color palettes:
	// http://www.siteprocentral.com/cgi-bin/feed/feed.cgi
	//
	bool refreshTotal=false;
	double free = pDoc->disk_usage.d_free;
	double total = pDoc->disk_usage.d_total;
	if(m_pieCtrlTotal->m_Series.size()>0) {
		wxString oldFree;
		wxString newFree;
		FormatDiskSpace(free, newFree);
		FormatDiskSpace(m_pieCtrlTotal->m_Series.Item(0).GetValue(), oldFree);
		if(oldFree.Cmp(newFree)!=0) {
			refreshTotal=true;
		}
	} else {
		refreshTotal=true;
	}
	if(refreshBOINC || refreshTotal) {
		m_pieCtrlTotal->m_Series.Clear();
		wxPiePart part;

		// used by BOINC
        double boinc_total = project_total + pDoc->disk_usage.d_boinc;
        FormatDiskSpace(boinc_total, diskspace);
        part.SetLabel(_("used by BOINC: ") + diskspace);
		part.SetValue(boinc_total);
		part.SetColour(wxColour(0,0,0));
		m_pieCtrlTotal->m_Series.Add(part);

//.........这里部分代码省略.........
开发者ID:keyz182,项目名称:BOINC-7.0,代码行数:101,代码来源:ViewResources.cpp

示例10: CBOINCBaseView

CViewResources::CViewResources(wxNotebook* pNotebook) :
	CBOINCBaseView(pNotebook)
{
	m_BOINCwasEmpty=false;

    wxPanel* pPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
	wxASSERT(pPanel);

	wxGridSizer* itemGridSizer = new wxGridSizer(2, 0, 3);
    wxASSERT(itemGridSizer);

	// create pie chart ctrl for total disk usage
	m_pieCtrlTotal = new wxPieCtrl(pPanel, ID_PIECTRL_RESOURCEUTILIZATIONVIEWTOTAL, wxDefaultPosition, wxDefaultSize);
	wxASSERT(m_pieCtrlTotal);

    // setup the legend
    m_pieCtrlTotal->SetTransparent(true);
    m_pieCtrlTotal->SetHorLegendBorder(10);
    m_pieCtrlTotal->SetLabelFont(*wxSWISS_FONT);
    m_pieCtrlTotal->SetLabelColour(wxColour(0,0,0));
    m_pieCtrlTotal->SetLabel(_("Total disk usage"));

    // initialize pie control
	m_pieCtrlTotal->m_Series.Clear();
	wxPiePart CtrlTotalPart;
    CtrlTotalPart.SetLabel(wxEmptyString);
	CtrlTotalPart.SetValue(1);
	CtrlTotalPart.SetColour(wxColour(255,255,255));
	m_pieCtrlTotal->m_Series.Add(CtrlTotalPart);
	m_pieCtrlTotal->Refresh();

    
    // create pie chart ctrl for BOINC disk usage
	m_pieCtrlBOINC = new wxPieCtrl(pPanel, ID_PIECTRL_RESOURCEUTILIZATIONVIEW, wxDefaultPosition, wxDefaultSize);
	wxASSERT(m_pieCtrlBOINC);

    //setup the legend
    m_pieCtrlBOINC->SetTransparent(true);
    m_pieCtrlBOINC->SetHorLegendBorder(10);
    m_pieCtrlBOINC->SetLabelFont(*wxSWISS_FONT);
    m_pieCtrlBOINC->SetLabelColour(wxColour(0,0,0));
    m_pieCtrlBOINC->SetLabel(_("Disk usage by BOINC projects"));

    // initialize pie control
	m_pieCtrlBOINC->m_Series.Clear();
	wxPiePart CtrlBOINCPart;
    CtrlBOINCPart.SetLabel(wxEmptyString);
	CtrlBOINCPart.SetValue(1);
	CtrlBOINCPart.SetColour(wxColour(255,255,255));
	m_pieCtrlBOINC->m_Series.Add(CtrlBOINCPart);
	m_pieCtrlBOINC->Refresh();

    //init the flexGrid
    itemGridSizer->Add(m_pieCtrlTotal, 1, wxGROW|wxALL,1);
    itemGridSizer->Add(m_pieCtrlBOINC, 1, wxGROW|wxALL,1);

    pPanel->SetSizer(itemGridSizer);
    pPanel->Layout();

    Initialize(pPanel);

    UpdateSelection();
}
开发者ID:keyz182,项目名称:BOINC-7.0,代码行数:63,代码来源:ViewResources.cpp

示例11: Create

ApplicationFiles::ApplicationFiles(wxWizard* parent, wxWizardPageSimple* prev)
{
  //(*Initialize(ApplicationFiles)
  wxBoxSizer* BoxSizer4;
  wxBoxSizer* BoxSizer6;
  wxBoxSizer* BoxSizer19;
  wxBoxSizer* BoxSizer5;
  wxBoxSizer* BoxSizer10;
  wxBoxSizer* BoxSizer7;
  wxBoxSizer* BoxSizer8;
  wxStaticText* StaticText2;
  wxStaticBitmap* StaticBitmap1;
  wxStaticText* StaticText8;
  wxStaticText* StaticText1;
  wxBoxSizer* BoxSizer2;
  wxBoxSizer* BoxSizer11;
  wxBoxSizer* BoxSizer12;
  wxStaticText* StaticText7;
  wxBoxSizer* BoxSizer1;
  wxBoxSizer* BoxSizer9;
  wxBoxSizer* BoxSizer3;
  wxStaticText* StaticText4;

  Create(parent, prev);
  BoxSizer1 = new wxBoxSizer(wxVERTICAL);
  Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
  Panel1->SetBackgroundColour( wxColour( 255, 255, 255));
  BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer5 = new wxBoxSizer(wxVERTICAL);
  BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer6->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText2 = new wxStaticText(Panel1, ID_STATICTEXT2, _("Application Files"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
  wxFont StaticText2Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
  StaticText2->SetFont(StaticText2Font);
  BoxSizer6->Add(StaticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer5->Add(BoxSizer6, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer7->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _("    Please specify the files that are part of your application."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
  BoxSizer7->Add(StaticText1, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer5->Add(BoxSizer7, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer4->Add(BoxSizer5, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer4->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticBitmap1 = new wxStaticBitmap(Panel1, wxID_ANY, wxBitmap(LinksOben_xpm), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
  BoxSizer4->Add(StaticBitmap1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  Panel1->SetSizer(BoxSizer4);
  BoxSizer4->Fit(Panel1);
  BoxSizer4->SetSizeHints(Panel1);
  BoxSizer1->Add(Panel1, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
  BoxSizer1->Add(StaticLine1, 0, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer2->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  text1 = new wxStaticText(this, ID_STATICTEXT3, _("Application main executable file:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
  wxFont text1Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
  text1->SetFont(text1Font);
  BoxSizer2->Add(text1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer2, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer3->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  txtMainExe = new wxTextCtrl(this, ID_TEXTCTRL1, _("C:\\Program Files (x86)\\Inno setup 5\\Examples\\MyProg.exe"), wxDefaultPosition, wxSize(308,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
  BoxSizer3->Add(txtMainExe, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  btnMainExe = new wxButton(this, ID_BUTTON1, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
  BoxSizer3->Add(btnMainExe, 0, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer3->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer3, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer8->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  cbAllowStartAfterInstall = new wxCheckBox(this, ID_CHECKBOX1, _("Allow user to start the application after Setup has finished"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
  cbAllowStartAfterInstall->SetValue(true);
  BoxSizer8->Add(cbAllowStartAfterInstall, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer8->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer8, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer9->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  cbDoesntHaveMain = new wxCheckBox(this, ID_CHECKBOX2, _("The application doesn\'t have a main executable file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
  cbDoesntHaveMain->SetValue(false);
  BoxSizer9->Add(cbDoesntHaveMain, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer9->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer9, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer10->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Other application files:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
  BoxSizer10->Add(StaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer10->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer10, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer11->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  lbFiles = new wxListBox(this, ID_LISTBOX1, wxDefaultPosition, wxSize(309,124), 0, 0, wxLB_HSCROLL, wxDefaultValidator, _T("ID_LISTBOX1"));
  BoxSizer11->Add(lbFiles, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer12 = new wxBoxSizer(wxVERTICAL);
  btnFiles = new wxButton(this, ID_BUTTON2, _("Add file(s) ..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
  BoxSizer12->Add(btnFiles, 0, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  btnFolder = new wxButton(this, ID_BUTTON3, _("Add folder ..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
  BoxSizer12->Add(btnFolder, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  btnEdit = new wxButton(this, ID_BUTTON4, _("Edit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
  btnEdit->Disable();
  BoxSizer12->Add(btnEdit, 0, wxTOP|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  btnRemove = new wxButton(this, ID_BUTTON5, _("Remove"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON5"));
//.........这里部分代码省略.........
开发者ID:stahta01,项目名称:cbInno,代码行数:101,代码来源:ApplicationFiles.cpp

示例12: for_each

void PreviewWindow::DrawPath(wxDC& dc)
{
	wxColour cw = cCWColour;
	wxColour ccw = cCCWColour;
	for_each(toDraw.begin(), toDraw.end(), [&](PathPartSimple p)
	{
		switch(p.type)
		{
			case LINE_NORMAL:
				{
					dc.SetPen(wxPen(normalColour, lineWidth, wxSOLID));
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					dc.DrawLine(p.start.x, p.start.y, p.end.x, p.end.y);
				}
				break;
			case LINE_RAPID:
				{
					dc.SetPen(wxPen(rapidColour, lineWidth, wxLONG_DASH));
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					dc.DrawLine(p.start.x, p.start.y, p.end.x, p.end.y);
				}
				break;
			case CIRCLE_CW:
				{
					
					cw.Set(255-cw.Red(), cw.Green(), cw.Blue());//Differes two circles
					dc.SetPen(wxPen(cw, lineWidth, wxSOLID));
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					p.center = TransformPoint(p.center);
					dc.SetBrush(wxBrush(wxColour(), wxTRANSPARENT));
					Vector2D distance(p.start, p.end);
					if(distance.Length() < 2)
						break;
					distance = Vector2D(p.center, p.start);
					if(distance.Length() < 2)
						break;
					dc.DrawArc(p.start.x, p.start.y, p.end.x, p.end.y, p.center.x, p.center.y);
				}
				break;
			case CIRCLE_CCW:
				{
					ccw.Set(255-ccw.Red(), ccw.Green(), ccw.Blue());//Differes two circles
					dc.SetPen(wxPen(ccw, lineWidth, wxSOLID));
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					p.center = TransformPoint(p.center);
					dc.SetBrush(wxBrush(wxColour(), wxTRANSPARENT));
					Vector2D distance(p.start, p.end);
					if(distance.Length() < 2)
						break;
					distance = Vector2D(p.center, p.start);
					if(distance.Length() < 2)
						break;
					dc.DrawArc(p.end.x, p.end.y, p.start.x, p.start.y, p.center.x, p.center.y);
				}
				break;
		}
	});

	for_each(offsetToDraw.begin(), offsetToDraw.end(), [&](PathPartSimple p)
	{
		dc.SetPen(wxPen(wxColor(255, 255, 255), lineWidth, wxSOLID));
		switch(p.type)
		{
			case LINE_NORMAL:
				{
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					dc.DrawLine(p.start.x, p.start.y, p.end.x, p.end.y);
				}
				break;
			case LINE_RAPID:
				{
					dc.SetPen(wxPen(wxColor(255, 255, 255), lineWidth, wxDOT_DASH));
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					dc.DrawLine(p.start.x, p.start.y, p.end.x, p.end.y);
				}
				break;
			case CIRCLE_CW:
			case OFFSET_CIRCLE_CW:
				{
					static wxColour c = cCWColour;
					c.Set(255-c.Red(), c.Green(), c.Blue());
					p.start = TransformPoint(p.start);
					p.end = TransformPoint(p.end);
					p.center = TransformPoint(p.center);
					dc.SetBrush(wxBrush(wxColour(), wxTRANSPARENT));
					Vector2D distance(p.start, p.end);
					if(distance.Length() < 2)
						break;
					distance = Vector2D(p.center, p.start);
					if(distance.Length() < 2)
						break;
					dc.DrawArc(p.start.x, p.start.y, p.end.x, p.end.y, p.center.x, p.center.y);
				}
				break;
//.........这里部分代码省略.........
开发者ID:yaqwsx,项目名称:SOC---Design-of-a-CNC-Control-System,代码行数:101,代码来源:PreviewWindow.cpp

示例13: WXUNUSED_IN_GTK3

// static
wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
                                             bool WXUNUSED_IN_GTK3(useBase),
                                             int state)
{
    wxVisualAttributes attr;
#ifdef __WXGTK3__
    GtkStateFlags stateFlag = GTK_STATE_FLAG_NORMAL;
    if (state)
    {
        wxASSERT(state == GTK_STATE_ACTIVE);
        stateFlag = GTK_STATE_FLAG_ACTIVE;
    }
    GtkStyleContext* sc = gtk_widget_get_style_context(widget);
    GdkRGBA c;
    gtk_style_context_get_color(sc, stateFlag, &c);
    attr.colFg = wxColour(c);
    gtk_style_context_get_background_color(sc, stateFlag, &c);
    attr.colBg = wxColour(c);
    wxNativeFontInfo info;
    info.description = const_cast<PangoFontDescription*>(gtk_style_context_get_font(sc, stateFlag));
    attr.font = wxFont(info);
    info.description = NULL;
#else
    GtkStyle* style;

    style = gtk_rc_get_style(widget);
    if (!style)
        style = gtk_widget_get_default_style();

    if (!style)
    {
        return wxWindow::GetClassDefaultAttributes(wxWINDOW_VARIANT_NORMAL);
    }

    // get the style's colours
    attr.colFg = wxColour(style->fg[state]);
    if (useBase)
        attr.colBg = wxColour(style->base[state]);
    else
        attr.colBg = wxColour(style->bg[state]);

    // get the style's font
    if ( !style->font_desc )
        style = gtk_widget_get_default_style();
    if ( style && style->font_desc )
    {
        wxNativeFontInfo info;
        info.description = style->font_desc;
        attr.font = wxFont(info);
        info.description = NULL;
    }
#endif
    if (!attr.font.IsOk())
    {
        GtkSettings *settings = gtk_settings_get_default();
        gchar *font_name = NULL;
        g_object_get ( settings,
                       "gtk-font-name",
                       &font_name,
                       NULL);
        if (!font_name)
            attr.font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
        else
            attr.font = wxFont(wxString::FromAscii(font_name));
        g_free (font_name);
    }

    return attr;
}
开发者ID:krossell,项目名称:wxWidgets,代码行数:71,代码来源:control.cpp

示例14: StyleClearAll

bool Edit::InitializePrefs (const wxString &name) {

    // initialize styles
    StyleClearAll();
    LanguageInfo const* curInfo = NULL;

    // determine language
    bool found = false;
    int languageNr;
    for (languageNr = 0; languageNr < g_LanguagePrefsSize; languageNr++) {
        curInfo = &g_LanguagePrefs [languageNr];
        if (curInfo->name == name) {
            found = true;
            break;
        }
    }
    if (!found) return false;

    // set lexer and language
    SetLexer (curInfo->lexer);
    m_language = curInfo;

    // set margin for line numbers
    SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER);
    StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (_T("DARK GREY")));
    StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
    SetMarginWidth (m_LineNrID, 0); // start out not visible

    // default fonts for all styles!
    int Nr;
    for (Nr = 0; Nr < wxSTC_STYLE_LASTPREDEFINED; Nr++) {
        wxFont font (10, wxMODERN, wxNORMAL, wxNORMAL);
        StyleSetFont (Nr, font);
    }

    // set common styles
    StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (_T("DARK GREY")));
    StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (_T("DARK GREY")));

    // initialize settings
    if (g_CommonPrefs.syntaxEnable) {
        int keywordnr = 0;
        for (Nr = 0; Nr < STYLE_TYPES_COUNT; Nr++) {
            if (curInfo->styles[Nr].type == -1) continue;
            const StyleInfo &curType = g_StylePrefs [curInfo->styles[Nr].type];
            wxFont font (curType.fontsize, wxMODERN, wxNORMAL, wxNORMAL, false,
                         curType.fontname);
            StyleSetFont (Nr, font);
            if (curType.foreground) {
                StyleSetForeground (Nr, wxColour (curType.foreground));
            }
            if (curType.background) {
                StyleSetBackground (Nr, wxColour (curType.background));
            }
            StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0);
            StyleSetItalic (Nr, (curType.fontstyle & mySTC_STYLE_ITALIC) > 0);
            StyleSetUnderline (Nr, (curType.fontstyle & mySTC_STYLE_UNDERL) > 0);
            StyleSetVisible (Nr, (curType.fontstyle & mySTC_STYLE_HIDDEN) == 0);
            StyleSetCase (Nr, curType.lettercase);
            const wxChar *pwords = curInfo->styles[Nr].words;
            if (pwords) {
                SetKeyWords (keywordnr, pwords);
                keywordnr += 1;
            }
        }
    }

    // set margin as unused
    SetMarginType (m_DividerID, wxSTC_MARGIN_SYMBOL);
    SetMarginWidth (m_DividerID, 0);
    SetMarginSensitive (m_DividerID, false);

    // folding
    SetMarginType (m_FoldingID, wxSTC_MARGIN_SYMBOL);
    SetMarginMask (m_FoldingID, wxSTC_MASK_FOLDERS);
    StyleSetBackground (m_FoldingID, *wxWHITE);
    SetMarginWidth (m_FoldingID, 0);
    SetMarginSensitive (m_FoldingID, false);
    if (g_CommonPrefs.foldEnable) {
        SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0);
        SetMarginSensitive (m_FoldingID, curInfo->folds != 0);
        SetProperty (_T("fold"), curInfo->folds != 0? _T("1"): _T("0"));
        SetProperty (_T("fold.comment"),
                     (curInfo->folds & mySTC_FOLD_COMMENT) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.compact"),
                     (curInfo->folds & mySTC_FOLD_COMPACT) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.preprocessor"),
                     (curInfo->folds & mySTC_FOLD_PREPROC) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.html"),
                     (curInfo->folds & mySTC_FOLD_HTML) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.html.preprocessor"),
                     (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.comment.python"),
                     (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? _T("1"): _T("0"));
        SetProperty (_T("fold.quotes.python"),
                     (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? _T("1"): _T("0"));
    }
    SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
                  wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);

//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:101,代码来源:edit.cpp

示例15: get_y_position

	double y = get_y_position(value, di);

	double ret = h - y * h  + m_screen_margins.topmargin;

	if (ret < m_screen_margins.topmargin)
		ret = m_screen_margins.topmargin;

	if (ret > h + m_screen_margins.topmargin) 
		ret = h + m_screen_margins.topmargin;
		
	return ret;
}


const wxColour GCDCGraphs::back1_col = wxColour(128, 128, 128);
const wxColour GCDCGraphs::back2_col = wxColour(0, 0, 0);

void GCDCGraphs::DrawBackground(wxGraphicsContext &dc) {
	int w, h;
	GetClientSize(&w, &h);

	PeriodType pt = m_draws_wdg->GetSelectedDraw()->GetPeriod();
	size_t pc = m_draws_wdg->GetSelectedDraw()->GetValuesTable().size();

	dc.SetBrush(wxBrush(back2_col, wxSOLID));
	dc.DrawRectangle(0, 0, w, h);

	size_t i = 0;
	int c = 1;
	double x = m_screen_margins.leftmargin + 1;
开发者ID:marta09,项目名称:szarp,代码行数:30,代码来源:gcdcgraphs.cpp


注:本文中的wxColour函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。