void CPanelWnd::PaintCaption(CDC& dc) { CString strCaption; CRect rc, rcWnd; BITMAP info = { 0, 0, CAPTION_HEIGHT }; if ( Images.m_bmPanelMark.m_hObject) Images.m_bmPanelMark.GetBitmap( &info ); GetWindowRect( &rcWnd ); rc.SetRect( 0, 0, rcWnd.Width(), info.bmHeight ); GetWindowText( strCaption ); CSize size = rc.Size(); CDC* pBuffer = CoolInterface.GetBuffer( dc, size ); if ( ! CoolInterface.DrawWatermark( pBuffer, &rc, &Images.m_bmPanelMark ) ) pBuffer->FillSolidRect( &rc, Colors.m_crPanelBack ); const int nIconY = rc.Height() / 2 - 8; DrawIconEx( pBuffer->GetSafeHdc(), 4, nIconY, GetIcon( FALSE ), 16, 16, 0, NULL, DI_NORMAL ); CFont* pOldFont = (CFont*)pBuffer->SelectObject( &CoolInterface.m_fntCaption ); CSize szCaption = pBuffer->GetTextExtent( strCaption ); const int nTextY = rc.Height() / 2 - szCaption.cy / 2 - 1; pBuffer->SetBkMode( TRANSPARENT ); if ( Colors.m_crPanelBorder != CLR_NONE ) { pBuffer->SetTextColor( Colors.m_crPanelBorder ); pBuffer->ExtTextOut( 8 + 16 - 1, nTextY, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16 + 1, nTextY, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16, nTextY - 1, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16, nTextY + 1, ETO_CLIPPED, &rc, strCaption, NULL ); } pBuffer->SetTextColor( Colors.m_crPanelText ); pBuffer->ExtTextOut( 8 + 16, nTextY, ETO_CLIPPED, &rc, strCaption, NULL ); if ( m_bPanelClose ) { pBuffer->SelectObject( &theApp.m_gdiFont ); CString strText = _T("Close"); CSize szText = pBuffer->GetTextExtent( strText ); m_rcClose.SetRect( rc.right - szText.cx - 8, rc.top, rc.right, rc.bottom ); pBuffer->ExtTextOut( m_rcClose.left + 2, ( m_rcClose.top + m_rcClose.bottom ) / 2 - szText.cy / 2 - 1, ETO_CLIPPED, &m_rcClose, strText, NULL ); m_rcClose.OffsetRect( rcWnd.left, rcWnd.top ); } pBuffer->SelectObject( pOldFont ); dc.BitBlt( rc.left, rc.top, rc.Width(), rc.Height(), pBuffer, 0, 0, SRCCOPY ); dc.SelectStockObject( SYSTEM_FONT ); // GDI font leak fix dc.SelectStockObject( NULL_BRUSH ); // GDI brush leak fix }
void JXCurrentPathMenu::SetPath ( const JCharacter* path ) { RemoveAllItems(); JString p = path; JCleanPath(&p); JString p1, n; while (!JIsRootDirectory(p)) { JStripTrailingDirSeparator(&p); JSplitPathAndName(p, &p1, &n); PrependItem(n); SetItemImage(1, GetIcon(p), kJFalse); p = p1; } PrependItem(p); SetItemImage(1, GetIcon(p), kJFalse); const JXImage* image = NULL; GetItemImage(GetItemCount(), &image); SetTitle(GetItemText(GetItemCount()), const_cast<JXImage*>(image), kJFalse); SetUpdateAction(kDisableNone); }
void CMLuaOptions::OnInitDialog() { CDlgBase::OnInitDialog(); m_scripts.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP); HIMAGELIST hImageList = m_scripts.CreateImageList(LVSIL_SMALL); ImageList_AddIcon(hImageList, GetIcon(IDI_LOADED)); ImageList_AddIcon(hImageList, GetIcon(IDI_FAILED)); ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN)); ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD)); TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100]; FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT)); PathToRelativeT(scriptDir, relativeScriptDir, NULL); mir_sntprintf(header, _T("%s (%s)"), TranslateT("Common scripts"), relativeScriptDir); m_scripts.AddColumn(0, _T("Script"), 380); m_scripts.AddColumn(1, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL)); m_scripts.AddColumn(2, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL)); LoadScripts(); isScriptListInit = true; }
QIcon Core::GetIconForLPI (const ListPackageInfo& packageInfo) { const auto mgr = Proxy_->GetIconThemeManager (); QIcon result; switch (packageInfo.Type_) { case PackageInfo::TPlugin: result = mgr->GetIcon ("preferences-plugin"); break; case PackageInfo::TIconset: result = mgr->GetIcon ("preferences-desktop-icons"); break; case PackageInfo::TTranslation: result = mgr->GetIcon ("preferences-desktop-locale"); break; case PackageInfo::TData: case PackageInfo::TQuark: result = mgr->GetIcon ("package-x-generic"); break; case PackageInfo::TTheme: result = mgr->GetIcon ("preferences-desktop-theme"); break; } return result; }
BBitmap* EntryMenuItem::LoadIcon() { BBitmap* icon = NULL; BNode node(&fEntry); BNodeInfo info(&node); char type[B_MIME_TYPE_LENGTH+1]; // Note: BNodeInfo::GetTrackerIcon does not work as expected! // try to get the icon stored in file attribute icon = new BBitmap(BRect(0, 0, kIconSize-1, kIconSize-1), B_CMAP8); if (info.GetIcon(icon, B_MINI_ICON) == B_OK) { return icon; } delete icon; icon = NULL; // get the icon from type if (info.GetType(type) == B_OK) { BMimeType mimeType(type); BMimeType superType; if (mimeType.InitCheck() == B_OK) { icon = GetIcon(&mimeType); // or super type if (icon == NULL && mimeType.GetSupertype(&superType) == B_OK) { icon = GetIcon(&superType); } } } return icon; }
void TermTab::handleTermContextMenu (const QPoint& point) { QMenu menu; AddUrlActions (menu, point); const auto& selected = Term_->selectedText (); AddLocalFileActions (menu, selected); const auto itm = CoreProxy_->GetIconThemeManager (); const auto copyAct = menu.addAction (itm->GetIcon ("edit-copy"), tr ("Copy selected text"), Term_, SLOT (copyClipboard ())); copyAct->setEnabled (!Term_->selectedText ().isEmpty ()); const auto pasteAct = menu.addAction (itm->GetIcon ("edit-paste"), tr ("Paste from clipboard"), Term_, SLOT (pasteClipboard ())); pasteAct->setEnabled (!QApplication::clipboard ()->text (QClipboard::Clipboard).isEmpty ()); new Util::StdDataFilterMenuCreator { selected, CoreProxy_->GetEntityManager (), &menu }; menu.exec (Term_->mapToGlobal (point)); }
CUIDragItem* CUIWeaponCellItem::CreateDragItem() { CUIDragItem* i = inherited::CreateDragItem(); CUIStatic* s = NULL; if(GetIcon(eSilencer)) { s = new CUIStatic(); s->SetAutoDelete(true); s->SetShader (InventoryUtilities::GetEquipmentIconsShader()); InitAddon (s, *object()->GetSilencerName(), m_addon_offset[eSilencer], false); s->SetColor (i->wnd()->GetColor()); i->wnd ()->AttachChild (s); } if(GetIcon(eScope)) { s = new CUIStatic(); s->SetAutoDelete(true); s->SetShader (InventoryUtilities::GetEquipmentIconsShader()); InitAddon (s, *object()->GetScopeName(), m_addon_offset[eScope], false); s->SetColor (i->wnd()->GetColor()); i->wnd ()->AttachChild (s); } if(GetIcon(eLauncher)) { s = new CUIStatic(); s->SetAutoDelete(true); s->SetShader (InventoryUtilities::GetEquipmentIconsShader()); InitAddon (s, *object()->GetGrenadeLauncherName(),m_addon_offset[eLauncher], false); s->SetColor (i->wnd()->GetColor()); i->wnd ()->AttachChild (s); } return i; }
void RadioWidget::on_StationsView__customContextMenuRequested (const QPoint& point) { const auto& idx = Ui_.StationsView_->indexAt (point); if (!idx.isValid ()) return; const auto type = idx.data (Media::RadioItemRole::ItemType).toInt (); const auto parentType = idx.parent ().data (Media::RadioItemRole::ItemType).toInt (); const auto iconsMgr = Core::Instance ().GetProxy ()->GetIconThemeManager (); QMenu menu; menu.addAction (iconsMgr->GetIcon ("view-refresh"), tr ("Refresh"), this, SLOT (handleRefresh ())); switch (type) { case Media::RadioType::CustomAddableStreams: { menu.addAction (iconsMgr->GetIcon ("list-add"), tr ("Add an URL..."), this, SLOT (handleAddUrl ())); const auto& url = Player_->GetSourceObject ()->GetCurrentSource ().ToUrl (); if (url.isValid () && !url.isLocalFile ()) menu.addAction (tr ("Add current stream..."), this, SLOT (handleAddCurrentUrl ())); break; } case Media::RadioType::TracksList: case Media::RadioType::TracksRoot: case Media::RadioType::SingleTrack: { menu.addAction (iconsMgr->GetIcon ("download"), tr ("Download tracks..."), this, SLOT (handleDownloadTracks ())); break; } default: break; } if (parentType == Media::RadioType::CustomAddableStreams) { menu.addAction (iconsMgr->GetIcon ("list-remove"), tr ("Remove this URL"), this, SLOT (handleRemoveUrl ())); } menu.exec (Ui_.StationsView_->viewport ()->mapToGlobal (point)); }
void OutputWindow::modelModelCodeFiles(const QStringList &sl) { QTreeWidget * tree = ui->treeProject; QTreeWidgetItem* root = tree->topLevelItem(0); //Remove and return children list root->takeChildren(); for(int i=0; i<sl.size(); ++i) { // QString flabspath = sl.at(i); // QString xlpath = flabspath.left(flabspath.lastIndexOf("/")).replace(modelFolder, tr("")); // QString xlfile = flabspath.right(flabspath.length() -1 - flabspath.lastIndexOf("/") ); QFileInfo info(sl.at(i)); QString xlpath = info.absolutePath().replace(modelFolder, tr("")); QString xlfile = info.fileName(); QString flabspath = info.absoluteFilePath(); if(xlpath.compare("")!=0) { bool inserted = false; for(int j = 0; j<root->childCount(); ++j) { if(root->child(j)->text(0).compare(xlpath, Qt::CaseInsensitive) == 0) { QTreeWidgetItem* item = new QTreeWidgetItem( root->child(j), QStringList(xlfile)); item->setIcon(0, GetIcon(xlfile) ); item->setData(0, Qt::UserRole, flabspath); // item->setIcon(0, style()->standardIcon(QStyle::SP_FileIcon) ); inserted= true; break;//for-j } } if(!inserted) { QTreeWidgetItem* path = new QTreeWidgetItem( root, QStringList(xlpath) ); path->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon)); //path->setIcon(0, QIcon(px.copy(4*px_width,4*px_height, px_width,px_height))); QTreeWidgetItem* item = new QTreeWidgetItem( path, QStringList(xlfile)); // item->setIcon(0, style()->standardIcon(QStyle::SP_FileIcon) ); item->setIcon(0, GetIcon(xlfile) ); item->setData(0, Qt::UserRole, flabspath ); // root->addChild(path); } } else { //path is empty QTreeWidgetItem* item = new QTreeWidgetItem( root, QStringList(xlfile)); item->setIcon(0, GetIcon(xlfile) ); item->setData(0, Qt::UserRole, flabspath ); } } tree->expandAll(); }
void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTV_ITEM lptvitem) { lptvitem -> iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON) ; lptvitem -> iSelectedImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON) ; }
TipDialog::TipDialog (ICoreProxy_ptr proxy, QWidget *parent) : QDialog (parent) , Proxy_ (proxy) { Util::ResourceLoader rl ("knowhow/tips/"); rl.AddGlobalPrefix (); rl.AddLocalPrefix (); const QString& pre = "tips_"; QStringList vars; vars << (pre + Util::GetLocaleName () + ".xml") << (pre + Util::GetLocaleName ().left (2) + ".xml") << (pre + "en.xml"); const QString& path = rl.GetPath (vars); if (path.isEmpty ()) { qWarning () << Q_FUNC_INFO << "unable to load tips for" << vars; deleteLater (); return; } QFile file (path); if (!file.open (QIODevice::ReadOnly)) { qWarning () << Q_FUNC_INFO << "unable to open file" << file.fileName () << file.errorString (); deleteLater (); return; } Doc_.reset (new QDomDocument); Doc_->setContent (&file); const int idx = XmlSettingsManager::Instance () .Property ("StdTipIndex", -1).toInt () + 1; Ui_.setupUi (this); const auto mgr = Proxy_->GetIconThemeManager (); Ui_.Forward_->setIcon (mgr->GetIcon ("go-next")); Ui_.Backward_->setIcon (mgr->GetIcon ("go-previous")); ShowForIdx (idx); setAttribute (Qt::WA_DeleteOnClose, true); show (); }
INT_PTR CDialogInstall::OnInitDialog(WPARAM wParam, LPARAM lParam) { static const ControlTemplate::Control s_Controls[] = { CT_ICON(Id_HeaderIcon, 0, 10, 10, 24, 24, WS_VISIBLE, 0), CT_LABEL(Id_HeaderTitleLabel, 2, 40, 6, 250, 14, WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), CT_LABEL(-1, 3, 40, 20, 250, 9, WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), CT_BUTTON(Id_InstallButton, 1, 199, 191, 70, 14, WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON, 0), CT_BUTTON(Id_CancelButton, 13, 274, 191, 70, 14, WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON, 0), CT_TAB(Id_Tab, 0, -2, 36, 400, 150, WS_VISIBLE | WS_TABSTOP | TCS_FIXEDWIDTH, 0) // Last for correct tab order. }; CreateControls(s_Controls, _countof(s_Controls), m_Font, GetString); m_TabContents.Create(m_Window); m_TabContents.Activate(); SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)GetIcon(IDI_APPICON, false)); HWND item = GetControl(Id_HeaderIcon); Static_SetIcon(item, GetIcon(IDI_APPICON, true)); item = GetControl(Id_HeaderTitleLabel); SendMessage(item, WM_SETFONT, (WPARAM)m_FontBold, 0); item = GetControl(Id_InstallButton); SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE); if (Platform::IsAtLeastWinVista() && !Util::IsProcessUserAdmin()) { Button_SetElevationRequiredState(item, TRUE); } return TRUE; }
int GetIcons() { if (ServiceExists(MS_SKIN2_GETICON)) { //FreeIcons(); // hiDlgIcon = Get("Dlg"); hiCheckMenu = GetIcon("MenuCheck"); hiListMenu = GetIcon("MenuList"); hiAddBirthdayContact = GetIcon("AddBirthday"); hiRefreshUserDetails = GetIcon("RefreshUserDetails"); hiImportBirthdays = GetIcon("ImportBirthdays"); hiExportBirthdays = GetIcon("ExportBirthdays"); int i; char buffer[1024]; for (i = 0; i < cDTB; i++) { sprintf(buffer, "DTB%d", i); hiDTB[i] = GetIcon(buffer); } hiDTBMore = GetIcon("DTBMore"); } return 0; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- CHudTexture *CHud::AddUnsearchableHudIconToList(CHudTexture& texture) { // These names are composed based on the texture file name char composedName[512]; if (texture.bRenderUsingFont) { Q_snprintf(composedName, sizeof(composedName), "%s_c%i", texture.szTextureFile, texture.cCharacterInFont); } else { Q_snprintf(composedName, sizeof(composedName), "%s_%i_%i_%i_%i", texture.szTextureFile, texture.rc.left, texture.rc.top, texture.rc.right, texture.rc.bottom); } CHudTexture *icon = GetIcon(composedName); if (icon) { return icon; } CHudTexture *newTexture = (CHudTexture *) g_HudTextureMemoryPool.Alloc(); *newTexture = texture; SetupNewHudTexture(newTexture); int idx = m_Icons.Insert(composedName, newTexture); return m_Icons[idx]; }
FolderItem::FolderItem(Menu* pSubMenu, const TCHAR* pszTitle, const TCHAR* pszIcon) : MenuItem(pszTitle) { m_nSortPriority = M_SORT_FOLDER; m_ItemID = MENUITEM_ID_FOLDER; LinkSubmenu(pSubMenu); m_phIcon = GetIcon(pszIcon); }
//This is called everytime a window that has a button closes void pawsControlWindow::WindowClose(pawsWidget* wnd) { pawsButton* btn = FindButtonFromWindow(wnd->GetName()); Icon* icon = GetIcon(btn->GetName()); icon->IsActive = false; btn->SetBackground(icon->orgRes.GetData()); }
void CChildWnd::PaintCaption(CDC& dc) { CString strCaption; CRect rc, rcWnd; GetWindowRect( &rcWnd ); rc.SetRect( 0, 0, rcWnd.Width(), CAPTION_HEIGHT ); GetWindowText( strCaption ); CDC* pBuffer = CoolInterface.GetBuffer( dc, rc.Size() ); if ( ! CoolInterface.DrawWatermark( pBuffer, &rc, &m_bmPanelMark, 0, 0 ) ) { pBuffer->FillSolidRect( &rc, m_crPanelBack ); } int nIconY = rc.Height() / 2 - 8; DrawIconEx( pBuffer->GetSafeHdc(), 4, nIconY, GetIcon( FALSE ), 16, 16, 0, NULL, DI_NORMAL ); //CFont* pOldFont = (CFont*)pBuffer->SelectObject( &theApp.m_gdiFont ); CFont* pOldFont = (CFont*)pBuffer->SelectObject( &CoolInterface.m_fntCaption ); CSize szCaption = pBuffer->GetTextExtent( strCaption ); pBuffer->SetBkMode( TRANSPARENT ); if ( m_crPanelBorder != CLR_NONE ) { pBuffer->SetTextColor( m_crPanelBorder ); pBuffer->ExtTextOut( 8 + 16 - 1, rc.Height() / 2 - szCaption.cy / 2 - 1, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16 + 1, rc.Height() / 2 - szCaption.cy / 2 - 1, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16, rc.Height() / 2 - szCaption.cy / 2 - 1 - 1, ETO_CLIPPED, &rc, strCaption, NULL ); pBuffer->ExtTextOut( 8 + 16, rc.Height() / 2 - szCaption.cy / 2 - 1 + 1, ETO_CLIPPED, &rc, strCaption, NULL ); } pBuffer->SetTextColor( m_crPanelText ); pBuffer->ExtTextOut( 8 + 16, rc.Height() / 2 - szCaption.cy / 2 - 1, ETO_CLIPPED, &rc, strCaption, NULL ); if ( m_bPanelClose ) { pBuffer->SelectObject( &CoolInterface.m_fntUnder ); CString strText = _T("¹Ø±Õ"); CSize szText = pBuffer->GetTextExtent( strText ); m_rcClose.SetRect( rc.right - szText.cx - 8, rc.top, rc.right, rc.bottom ); pBuffer->ExtTextOut( m_rcClose.left + 2, ( m_rcClose.top + m_rcClose.bottom ) / 2 - szText.cy / 2 - 1, ETO_CLIPPED, &m_rcClose, strText, NULL ); m_rcClose.OffsetRect( rcWnd.left, rcWnd.top ); } pBuffer->SelectObject( pOldFont ); dc.BitBlt( rc.left, rc.top, rc.Width(), rc.Height(), pBuffer, 0, 0, SRCCOPY ); }
bool CSlotBuyPrivateStore::IsSelected() { assert( GetIcon() ); if( s_pSelectedSlot == this ) return true; return false; }
//------------------------------------------------------------------------ void CGameRulesKingOfTheHillObjective::UpdateIcon(SHoldEntityDetails * pDetails) { SKotHEntity *pKotHEntity = static_cast<SKotHEntity *>(pDetails->m_pAdditionalData); CRY_ASSERT(pKotHEntity); const char *pName = NULL; const char *pColour = NULL; EGameRulesMissionObjectives requestedIcon = GetIcon(pDetails, &pName, &pColour); if (requestedIcon != EGRMO_Unknown) { CCCPOINT(KingOfTheHillObjective_SetNewIcon); SHUDEventWrapper::OnNewObjective(pDetails->m_id, requestedIcon, 0.f, 0, pName, pColour); pKotHEntity->m_needsIconUpdate = false; if(!pKotHEntity->m_isOnRadar) { SHUDEvent hudevent(eHUDEvent_AddEntity); hudevent.AddData(SHUDEventData((int)pDetails->m_id)); CHUDEventDispatcher::CallEvent(hudevent); pKotHEntity->m_isOnRadar = true; } } else if (pKotHEntity->m_currentIcon != EGRMO_Unknown) { CCCPOINT(KingOfTheHillObjective_RemoveIcon); SHUDEventWrapper::OnRemoveObjective(pDetails->m_id, 0); } pKotHEntity->m_currentIcon = requestedIcon; }
/*********************************************************************************** ** GetItemData ** ** ***********************************************************************************/ OP_STATUS SearchTemplate::GetItemData(ItemData* item_data) { if (item_data->query_type == COLUMN_QUERY) { switch(item_data->column_query_data.column) { case 0: { if (item_data->flags & FLAG_NO_PAINT) break; item_data->column_bitmap = GetIcon(); if (item_data->column_bitmap.IsEmpty()) { item_data->column_query_data.column_image = "Search Web"; } break; } case 1: { RETURN_IF_ERROR(GetEngineName(*item_data->column_query_data.column_text)); break; } case 2: { RETURN_IF_ERROR(item_data->column_query_data.column_text->Set(m_key)); break; } } } return OpStatus::OK; }
void DialogAbout::TabVersion::Initialize() { HWND item = GetControl(Id_AppIcon); HICON icon = GetIcon(IDI_RAINMETER, true); Static_SetIcon(item, icon); item = GetControl(Id_VersionLabel); WCHAR tmpSz[64]; _snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE); SetWindowText(item, tmpSz); item = GetControl(Id_WinVerLabel); SetWindowText(item, Platform::GetPlatformFriendlyName().c_str()); item = GetControl(Id_PathLabel); std::wstring text = L"Path: " + GetRainmeter().GetPath(); SetWindowText(item, text.c_str()); item = GetControl(Id_IniFileLabel); text = L"IniFile: " + GetRainmeter().GetIniFile(); SetWindowText(item, text.c_str()); item = GetControl(Id_SkinPathLabel); text = L"SkinPath: " + GetRainmeter().GetSkinPath(); SetWindowText(item, text.c_str()); m_Initialized = true; }
std::list<wxBitmap> HeeksObj::GetIcons() { std::list<wxBitmap> icons; const wxBitmap icon = GetIcon(); icons.push_back(icon); return(icons); }
RemoteDirectorySelectDialog::RemoteDirectorySelectDialog (const QByteArray& accId, AccountsManager *am, QWidget *parent) : QDialog (parent) , AccountId_ (accId) , Model_ (new QStandardItemModel (this)) , ProxyModel_ (new FilesProxyModel (this)) , AM_ (am) { Ui_.setupUi (this); const auto iconMgr = AM_->GetProxy ()->GetIconThemeManager (); auto createDir = new QPushButton (iconMgr->GetIcon ("folder-new"), tr ("New directory...")); Ui_.ButtonBox_->addButton (createDir, QDialogButtonBox::ActionRole); connect (createDir, SIGNAL (clicked ()), this, SLOT (createNewDir ())); Model_->setHorizontalHeaderLabels ({ tr ("Directory") }); ProxyModel_->setSourceModel (Model_); Ui_.DirectoriesView_->setModel (ProxyModel_); if (auto account = am->GetAccountFromUniqueID (accId)) if (auto isfl = qobject_cast<ISupportFileListings*> (account->GetQObject ())) Util::Sequence (this, isfl->RefreshListing ()) .MultipleResults ([this] (const ISupportFileListings::RefreshResult_t& result) { HandleGotListing (result); }); }
void CEzShortcutDlg::OnDrawIcon() { CString strShortcutName; m_staticShortcutNameContent.GetWindowText(strShortcutName); SHORTCUT_INFO* ShortcutInfo = GetShortCutInfo(strShortcutName.GetBuffer()); if( ShortcutInfo == NULL) { return; } CClientDC dc(this); light::Icon icon(ShortcutInfo->m_strProgramPath); if( icon.Large()) { dc.DrawIcon(ICON_X, ICON_Y, icon.Large()); } else { if( _tcsncmp(_T("http"), ShortcutInfo->m_strProgramPath.c_str(), 4) == 0) dc.DrawIcon(ICON_X, ICON_Y, AfxGetApp()->LoadIcon(IDI_WEB_ICON)); else if( true == light::FileUtil::is_exist(ShortcutInfo->m_strProgramPath)) dc.DrawIcon(ICON_X, ICON_Y, GetIcon(TRUE)); else dc.DrawIcon(ICON_X, ICON_Y, AfxGetApp()->LoadIcon(IDI_FOLDER_ICON)); } }
/* ** Called when tab is displayed. ** */ void CDialogAbout::CTabVersion::Initialize() { m_Initialized = true; HWND item = GetDlgItem(m_Window, IDC_ABOUTVERSION_RAINMETER_ICON); HICON icon = GetIcon(IDI_RAINMETER, true); Static_SetIcon(item, icon); item = GetDlgItem(m_Window, IDC_ABOUTVERSION_VERSION_TEXT); WCHAR tmpSz[64]; _snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE); SetWindowText(item, tmpSz); item = GetDlgItem(m_Window, IDC_ABOUTVERSION_PATH_TEXT); std::wstring text = L"Path: " + Rainmeter->GetPath(); SetWindowText(item, text.c_str()); item = GetDlgItem(m_Window, IDC_ABOUTVERSION_INIFILE_TEXT); text = L"IniFile: " + Rainmeter->GetIniFile(); SetWindowText(item, text.c_str()); item = GetDlgItem(m_Window, IDC_ABOUTVERSION_SKINPATH_TEXT); text = L"SkinPath: " + Rainmeter->GetSkinPath(); SetWindowText(item, text.c_str()); }
static int icolib_AddIcon(lua_State *L) { const char *name = luaL_checkstring(L, 1); ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2))); ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE))); ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4))); if (filePath == NULL) { filePath = (TCHAR*)mir_calloc(MAX_PATH + 1); GetModuleFileName(g_hInstance, filePath, MAX_PATH); } SKINICONDESC si = { 0 }; si.flags = SIDF_ALL_TCHAR; si.pszName = mir_utf8decodeA(name); si.description.t = description; si.section.t = section; si.defaultFile.t = filePath; si.hDefaultIcon = GetIcon(IDI_SCRIPT); HANDLE res = IcoLib_AddIcon(&si, g_mLua->GetHLangpack()); lua_pushlightuserdata(L, res); return 1; }
wxObject * MaxDialogXmlHandler::DoCreateResource() { XRC_MAKE_INSTANCE(dlg, MaxDialog); dlg->Create(m_parentAsWindow, GetID(), GetText(wxT("title")), wxDefaultPosition, wxDefaultSize, GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE), GetName()); dlg->MaxBind(_wx_wxdialog_wxDialog__xrcNew(dlg)); if (HasParam(wxT("size"))) dlg->SetClientSize(GetSize(wxT("size"), dlg)); if (HasParam(wxT("pos"))) dlg->Move(GetPosition()); if (HasParam(wxT("icon"))) dlg->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); SetupWindow(dlg); CreateChildren(dlg); if (GetBool(wxT("centered"), false)) dlg->Centre(); return dlg; }
void Plugin::RecoverTabs (const QList<TabRecoverInfo>& infos) { Q_FOREACH (const TabRecoverInfo& recInfo, infos) { QDataStream str (recInfo.Data_); qint8 version; str >> version; if (version == 1) { auto tab = Core::Instance ().CreateBlogiqueWidget (); Entry e; str >> e.Subject_ >> e.Content_ >> e.Date_ >> e.Tags_ >> e.Target_ >> e.PostOptions_ >> e.CustomData_; QByteArray accId; str >> accId; tab->FillWidget (e, accId); emit addNewTab ("Blogique", tab); emit changeTabIcon (tab, GetIcon ()); emit raiseTab (tab); emit changeTabName (tab, e.Subject_); }
bool SeqNavMenu::AddEntry(BEntry& entry, bool useLeafForLabel) { BPath path; if( entry.GetPath( &path ) != B_OK ) { printf("\tquery returned an entry but couldn't get the path\n"); return false; } const char* label = (useLeafForLabel) ? path.Leaf(): path.Path(); if( !label ) return false; _AmIconMenuItem* item = 0; uint32 tmpEntry; if( entry.IsDirectory() ) { tmpEntry = DIR_ENTRY; SeqNavMenu* nm = new SeqNavMenu( label, mTarget ); if( nm && (item = new _AmIconMenuItem( nm )) ) { nm->SetPath( path.Path() ); } } else { tmpEntry = OTHER_ENTRY; BMessage* msg = new BMessage( B_REFS_RECEIVED ); entry_ref ref; if( msg && (entry.GetRef( &ref ) == B_OK) ) { msg->AddRef( "refs", &ref ); item = new _AmIconMenuItem( label, msg ); } } if( item ) { mItems.push_back( item ); item->SetIcon( GetIcon( entry ) ); if( mFirstEntry == NO_ENTRY ) mFirstEntry = tmpEntry; } return true; }
void TermTab::AddUrlActions (QMenu& menu, const QPoint& point) { const auto hotspot = Term_->getHotSpotAt (point); if (!hotspot) return; if (hotspot->type () != Filter::HotSpot::Link) return; const auto urlHotSpot = dynamic_cast<const Konsole::UrlFilter::HotSpot*> (hotspot); if (!urlHotSpot) return; const auto& cap = urlHotSpot->capturedTexts ().value (0); if (cap.isEmpty ()) return; const auto itm = CoreProxy_->GetIconThemeManager (); const auto openAct = menu.addAction (itm->GetIcon ("document-open-remote"), tr ("Open URL"), this, SLOT (openUrl ())); openAct->setProperty ("ER/Url", cap); const auto copyAct = menu.addAction (tr ("Copy URL"), this, SLOT (copyUrl ())); copyAct->setProperty ("ER/Url", cap); menu.addSeparator (); }