本文整理汇总了C++中wxIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ wxIcon函数的具体用法?C++ wxIcon怎么用?C++ wxIcon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxIcon
void wxDropSource::SetIcons(const wxIcon &iconCopy,
const wxIcon &iconMove,
const wxIcon &iconNone)
{
m_iconCopy = iconCopy;
m_iconMove = iconMove;
m_iconNone = iconNone;
if ( !m_iconCopy.Ok() )
m_iconCopy = wxIcon(page_xpm);
if ( !m_iconMove.Ok() )
m_iconMove = m_iconCopy;
if ( !m_iconNone.Ok() )
m_iconNone = m_iconCopy;
}
示例2: wxFrame
// My frame constructor
MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
// Give it an icon
#ifdef __WXMSW__
SetIcon(wxIcon(_T("mondrian")));
#else
SetIcon(wxIcon(mondrian_xpm));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
file_menu->Append(DYNAMIC_ABOUT, _T("&About"));
file_menu->Append(DYNAMIC_TEST, _T("&Test"));
file_menu->Append(DYNAMIC_QUIT, _T("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, _T("&File"));
SetMenuBar(menu_bar);
// Make a panel with a message
wxPanel *panel = new wxPanel(this, wxID_ANY, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
(void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxDefaultSize, 0);
// You used to have to do some casting for param 4, but now there are type-safe handlers
Connect( DYNAMIC_QUIT, wxID_ANY,
wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit) );
Connect( DYNAMIC_TEST, wxID_ANY,
wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnTest) );
Connect( DYNAMIC_ABOUT, wxID_ANY,
wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) );
CreateStatusBar();
m_shadow.AddMethod( wxT("OnTest"), &cb_MyFrame_InitStatusbar );
}
示例3: SetExitOnFrameDelete
bool MyApp::OnInit()
{
// make sure we exit properly on macosx
SetExitOnFrameDelete(true);
wxPoint pos(100, 100);
MyFrame *frame = new MyFrame(NULL, -1, "Motion Sensor Calibration Tool",
pos, wxSize(1120,760), wxDEFAULT_FRAME_STYLE);
#ifdef WINDOWS
frame->SetIcon(wxIcon("MotionCal"));
#endif
frame->Show( true );
return true;
}
示例4: wxPanel
BundlePane::BundlePane(EditorFrame& parent, TmSyntaxHandler& syntaxHandler)
: wxPanel(&parent, wxID_ANY, wxPoint(-100,-100)), m_parentFrame(parent), m_imageList(16,16),
m_syntaxHandler(syntaxHandler), m_plistHandler(m_syntaxHandler.GetPListHandler()) {
// Build Imagelist
m_imageList.Add(wxIcon(tmbundle_xpm));
m_imageList.Add(wxIcon(tmcommand_xpm));
m_imageList.Add(wxIcon(tmsnippet_xpm));
m_imageList.Add(wxIcon(tmdragcmd_xpm));
m_imageList.Add(wxIcon(tmprefs_xpm));
m_imageList.Add(wxIcon(tmlanguage_xpm));
m_imageList.Add(wxIcon(tmsubmenu_xpm));
m_imageList.Add(wxIcon(tmunknown_xpm));
m_imageList.Add(wxIcon(tmseparator_xpm));
// Create the controls
m_bundleTree = new SortTreeCtrl(this, CTRL_BUNDLETREE, wxTR_LINES_AT_ROOT|wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT|wxTR_EDIT_LABELS);
m_bundleTree->SetMinSize(wxSize(50,50)); // ensure resizeability
m_bundlePlus = new wxButton(this, CTRL_NEWBUNDLEITEM, wxT("+"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
m_bundleMinus = new wxButton(this, CTRL_DELBUNDLE, wxT("-"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
wxButton* bundleManage = new wxButton(this, CTRL_MANAGE, wxT("Manage.."));
m_bundleTree->SetImageList(&m_imageList);
// Set tooltips
m_bundlePlus->SetToolTip(_("Add new item"));
m_bundleMinus->SetToolTip(_("Delete item"));
m_bundleMinus->Disable();
// Create the layout
wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(m_bundleTree, 1, wxEXPAND);
wxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
buttonSizer->Add(m_bundlePlus, 0, wxRIGHT, 2);
buttonSizer->Add(m_bundleMinus, 0, wxRIGHT, 2);
buttonSizer->AddStretchSpacer(1);
buttonSizer->Add(bundleManage, 0, wxALIGN_RIGHT);
mainSizer->Add(buttonSizer, 0, wxEXPAND|wxALL, 2);
SetSizer(mainSizer);
// Bundles will be loaded in idle time
}
示例5: wxDELETE
void MerryFrame::ShowTrayIcon(const bool show)
{
if (!show)
{
wxDELETE(m_taskBarIcon);
// if (m_taskBarIcon)
// m_taskBarIcon->RemoveIcon();
return;
}
if (!m_taskBarIcon)
m_taskBarIcon = new MerryTaskBarIcon();
if (m_taskBarIcon->IsIconInstalled())
return;
m_taskBarIcon->SetIcon(wxIcon(MerryIcon_xpm), TASKBARICON_TIP);
}
示例6: wxImageList
void YardEmployee::CreateImageList(wxTreeCtrl * tree)
{
// Make an image list containing small icons
wxImageList *images = new wxImageList(16, 16, true);
wxIcon icons[1];
icons[0] = wxIcon(worker_16x16_xpm);
for ( size_t i = 0; i < WXSIZEOF(icons); i++ )
{
images->Add(wxBitmap(icons[i]));
}
tree->AssignImageList(images);
}
示例7: Create
PlayerFrame::PlayerFrame(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(PlayerFrame)
Create(parent, id, _("xPlayer"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
SetClientSize(wxDefaultSize);
Move(wxDefaultPosition);
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&PlayerFrame::OnClose);
//*)
SetIcon(wxIcon(xlights_xpm));
//
// Create and attach the sizer
//
wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
this->SetSizer(sizer);
this->SetAutoLayout(true);
sizer->AddGrowableRow(0);
sizer->AddGrowableCol(0);
//
// Create and attach the media control
//
MediaCtrl = new wxMediaCtrl();
wxString MediaBackend;
#ifdef __WXMSW__
// this causes Windows to use latest installed Windows Media Player version
// On XP, users were getting WMP 6.4 without this
MediaBackend = wxMEDIABACKEND_WMP10;
#endif
playbackSpeed = 1.0;
// Make sure creation was successful
bool bOK = MediaCtrl->Create(this, wxID_MEDIACTRL, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, MediaBackend);
wxASSERT_MSG(bOK, "Could not create media control!");
wxUnusedVar(bOK);
sizer->Add(MediaCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 0);
PlayAfterLoad=false;
Connect(wxID_MEDIACTRL, wxEVT_MEDIA_LOADED,
wxMediaEventHandler(PlayerFrame::OnMediaLoaded));
}
示例8: SetIcon
VAutoDialog::VAutoDialog ()
{
wxXmlResource::Get()->LoadDialog(this, NULL, "MainDialog");
SetIcon (wxIcon ("res/dslr.ico"));
m_DeviceText = XRCCTRL(*this, "DEVICE_TEXT", wxStaticText);
m_FindObject = XRCCTRL(*this, "ID_FIND_OBJECT", wxBitmapButton);
m_buttonOptions = XRCCTRL(*this, "ID_OPTIONS", wxBitmapButton);
m_buttonOpenPlan = XRCCTRL(*this, "ID_OPENPLAN", wxBitmapButton);
m_buttonDeletePlan = XRCCTRL(*this, "ID_DELETEPLAN", wxBitmapButton);
m_MoveButton = XRCCTRL(*this, "ID_MOVE", wxButton);
m_ShootButton = XRCCTRL(*this, "ID_SHOOT", wxButton);
m_AbortButton = XRCCTRL(*this, "ID_ABORT", wxButton);
m_AutoButton = XRCCTRL(*this, "ID_AUTO", wxButton);
m_SkipButton = XRCCTRL(*this, "ID_SKIP", wxButton);
m_StatusBar = XRCCTRL(*this, "ID_STATUS_BAR", wxStaticText);
m_StatusCoords = XRCCTRL(*this, "ID_STATUS_COORDS", wxStaticText);
m_ObjectName = XRCCTRL(*this, "ID_OBJNAME", wxTextCtrl);
m_DisplayName = XRCCTRL(*this, "ID_NAME", wxStaticText);
m_DisplayRa = XRCCTRL(*this, "ID_RA", wxStaticText);
m_DisplayDecl = XRCCTRL(*this, "ID_DECL", wxStaticText);
m_Duration = XRCCTRL(*this, "ID_DURATION", wxSpinCtrl);
m_FrameCount = XRCCTRL(*this, "ID_FRAMECOUNT", wxSpinCtrl);
m_PlanList = XRCCTRL(*this, "ID_PLAN_LIST", wxListCtrl);
wxSize s = m_PlanList->GetSize();
int sss = (s.GetWidth () - 24) / 2;
m_PlanList->InsertColumn (0, "", wxLIST_FORMAT_LEFT, 24);
m_PlanList->InsertColumn (1, _("Object name"), wxLIST_FORMAT_LEFT, sss);
m_PlanList->InsertColumn (2, _("Coords"), wxLIST_FORMAT_LEFT, sss);
m_PlanFile = XRCCTRL(*this, "ID_PLANFILE", wxStaticText);
wxImageList* imageList = new wxImageList (13, 13);
imageList->Add (wxBitmap (plan_ok_xpm));
imageList->Add (wxBitmap (plan_up_xpm));
imageList->Add (wxBitmap (plan_down_xpm));
imageList->Add (wxBitmap (plan_disabled_xpm));
// imageList->Add (wxBitmap (plan_moon_xpm));
m_PlanList->SetImageList (imageList, wxIMAGE_LIST_SMALL);
}
示例9: Menu
//Construtor da Frame
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
:wxFrame(NULL, wxID_ANY, title, pos, size){
//Criação do Menu
Menu *MenuBar = new Menu();
SetMenuBar(MenuBar);
Centre();
//Setando o ícone
SetIcon(wxIcon(wxString(_T("/../Images/Icones/icone"), wxBITMAP_TYPE_BMP)));
//Criando barra de ferramentas
m_toolbar = CreateToolBar(wxTB_FLAT | wxTB_HORIZONTAL | wxTB_TEXT,wxID_ANY);
m_toolbar->AddTool(ID_NEW, wxString(_("Novo")), wxBitmap(wxT("../../Images/Icones/newfile.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Novo")));
m_toolbar->AddTool(ID_SAVE, wxString(_("Salvar")), wxBitmap(wxT("../../Images/Icones/save.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Salvar")));
m_toolbar->AddTool(ID_OPEN, wxString(_("Abrir")), wxBitmap(wxT("../../Images/Icones/open.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Abrir")));
m_toolbar->AddSeparator();
m_toolbar->AddTool(ID_HELP, wxString(_("Ajuda")), wxBitmap(wxT("../../Images/Icones/help.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Ajuda")));
m_toolbar->AddTool(wxID_EXIT, wxString(_("Sair")), wxBitmap(wxT("../../Images/Icones/close.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Sair")));
//Para atualizar a barra de ferramentas com os ícones bitmap
m_toolbar->Realize();
//Setanto barra de ferramentas
SetToolBar(m_toolbar);
//Barra de Status
CreateStatusBar(3);
SetStatusText("TP2 PAC", 0);
// connectando eventos de menu da frame aos "handlers" da classe menu
Connect(ID_NEW, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnNew));
Connect(ID_OPEN, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnOpen));
Connect(ID_SAVE, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnSave));
Connect(ID_HELP, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnHelp));
Connect(ID_PORTUGUESE, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnPortuguese));
Connect(ID_ENGLISH, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnEnglish));
Connect(ID_SPANISH, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnSpanish));
Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnExit));
Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnAbout));
};
示例10: wxIcon
wxIcon
wxIconManager::GetIconFromMimeType(const String& type, const String& ext)
{
wxIcon icon;
// use the system icons by default
wxMimeTypesManager& mimeManager = mApplication->GetMimeManager();
wxFileType *fileType = mimeManager.GetFileTypeFromMimeType(type);
if ( !fileType && !ext.empty() )
{
fileType = mimeManager.GetFileTypeFromExtension(ext);
}
if ( fileType )
{
#ifdef wxHAS_ICON_LOCATION
wxIconLocation iconLoc;
if ( fileType->GetIcon(&iconLoc) )
{
wxLogNull noLog;
icon = wxIcon(iconLoc);
}
#else // wx 2.4.x or very early 2.5.0
(void)fileType->GetIcon(&icon);
#endif
delete fileType;
}
if ( icon.Ok() )
return icon;
// now try to find it by name
icon = GetIcon(type);
if ( icon.IsSameAs(m_unknownIcon) )
{
// the generic icon for this class of things
String primType = type.BeforeLast(_T('/'));
if ( !primType.empty() )
icon = GetIcon(primType);
}
return icon;
}
示例11: wxFrame
TemplateFrame::TemplateFrame(wxFrame *parent, Project* project_s,
const wxString& title,
const wxPoint& pos,
const wxSize& size, const long style)
: wxFrame(parent, -1, title, pos, size, style),
template_canvas(0), template_legend(0), project(project_s),
frames_manager(project_s->GetFramesManager()),
table_state(project_s->GetTableState()),
time_state(project_s->GetTimeState()),
is_status_bar_visible(false), supports_timeline_changes(false),
depends_on_non_simple_groups(true)
{
SetIcon(wxIcon(GeoDaIcon_16x16_xpm));
frames_manager->registerObserver(this);
table_state->registerObserver(this);
time_state->registerObserver(this);
}
示例12: wxIcon
wxIcon InfoDialog::GetIconResource( const wxString& name )
{
#include "../img/scope2.xpm"
if (name == _T("scope2.png"))
return wxIcon( scope2_xpm);
return wxNullIcon;
// // Icon retrieval
//////@begin InfoDialog icon retrieval
// wxUnusedVar(name);
// if (name == _T("scope2.png"))
// {
// wxIcon icon(_T("scope2.png"), wxBITMAP_TYPE_PNG);
// return icon;
// }
// return wxNullIcon;
//////@end InfoDialog icon retrieval
}
示例13: ExtDialog
CheckoutDialog::CheckoutDialog(wxWindow* parent, const std::string& dir, bool fixed)
: ExtDialog(parent, -1, _("TortoiseCVS - Checkout Module"),
wxDefaultPosition, wxDefaultSize,
wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER |
wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN)
{
SetIcon(wxIcon(wxT("A_TORTOISE"), wxBITMAP_TYPE_ICO_RESOURCE));
// Main notebook
wxBookCtrl *book = new wxNotebook(this, CHECKOUTDLG_ID_BOOK);
myModuleBasicsPage = new ModuleBasicsPage(book, MB_CHECKOUT_MODULE, fixed);
myRevOptions = new RevOptions(book);
myModuleBasicsPage->SetRevOptions(myRevOptions);
myRevOptions->SetDir(dir);
myCheckoutOptionsPage = new CheckoutOptionsPage(book, myModuleBasicsPage);
book->AddPage(myModuleBasicsPage, _("Module"));
book->AddPage(myRevOptions, _("Revision"));
book->AddPage(myCheckoutOptionsPage, _("Options"));
myStatusBar = new wxStatusBar(this, -1);
// OK/Cancel button
wxBoxSizer *sizerConfirm = new wxBoxSizer(wxHORIZONTAL);
wxButton* ok = new wxButton(this, wxID_OK, _("OK"));
ok->SetDefault();
wxButton* cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
sizerConfirm->Add(ok, 0, wxGROW | wxALL, 5);
sizerConfirm->Add(cancel, 0, wxGROW | wxALL, 5);
// Main box with text and button in it
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(book, 1, wxGROW | wxALL, 3);
sizerTop->Add(sizerConfirm, 0, wxALIGN_CENTER | wxALL, 0);
sizerTop->Add(myStatusBar, 0, wxGROW | wxALL, 0);
// Overall dialog layout settings
myModuleBasicsPage->UpdateSensitivity();
SetAutoLayout(TRUE);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
sizerTop->Fit(this);
RestoreTortoiseDialogSize(this, "Checkout", wxDLG_UNIT(this, wxSize(200, 120)));
SetTortoiseDialogPos(this, GetRemoteHandle());
RestoreTortoiseDialogState(this, "Checkout");
}
示例14: MyFrame
// Initialise this in OnInit, not statically
bool MyApp::OnInit(void)
{
if ( !wxApp::OnInit() )
return false;
// Create the main frame window
frame = new MyFrame(NULL, wxID_ANY, wxT("Sash Demo"), wxPoint(0, 0), wxSize(500, 400),
wxDEFAULT_FRAME_STYLE |
wxNO_FULL_REPAINT_ON_RESIZE |
wxHSCROLL | wxVSCROLL);
// Give it an icon (this is ignored in MDI mode: uses resources)
#ifdef __WXMSW__
frame->SetIcon(wxIcon(wxT("sashtest_icn")));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window"));
file_menu->Append(SASHTEST_TOGGLE_WINDOW, wxT("&Toggle window"));
file_menu->Append(SASHTEST_QUIT, wxT("&Exit"));
wxMenu *help_menu = new wxMenu;
help_menu->Append(SASHTEST_ABOUT, wxT("&About"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, wxT("&File"));
menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
frame->CreateStatusBar();
#endif // wxUSE_STATUSBAR
frame->Show(true);
SetTopWindow(frame);
return true;
}
示例15: wxPanel
GroupChatWindow::GroupChatWindow(wxWindow * parent)
: wxPanel(parent)
{
wxString filename(gAppPath);
filename.append("/res/biwooman.bmp");
m_bitmapUI.LoadFile(filename, wxBITMAP_TYPE_BMP);
m_imageListNormal = new wxImageList(32, 32, true);
//m_imageListSmall = new wxImageList(16, 16, true);
m_imageListNormal->Add(wxIcon(wxString::Format("%s/res/icon_man.ico", gAppPath.c_str()), wxBITMAP_TYPE_ICO));
m_listCtrl = new wxListCtrl(this, Ctrl_GroupContacts, wxDefaultPosition, wxDefaultSize, wxLC_ICON|wxSUNKEN_BORDER);
m_listCtrl->AssignImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL);
//m_listCtrl->AssignImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
}