| 264 | }; |
| 265 | |
| 266 | CRMenu * CRSettingsMenu::createFontSizeMenu( CRGUIWindowManager * wm, CRMenu * mainMenu, CRPropRef props ) |
| 267 | { |
| 268 | lString16Collection list; |
| 269 | fontMan->getFaceList( list ); |
| 270 | lString8 fontFace = UnicodeToUtf8(props->getStringDef( PROP_FONT_FACE, UnicodeToUtf8(list[0]).c_str() )); |
| 271 | //LVFontRef menuFont( fontMan->GetFont( MENU_FONT_SIZE, 600, false, css_ff_sans_serif, lString8("Arial")) ); |
| 272 | CRMenuSkinRef skin = wm->getSkin()->getMenuSkin(L"#settings"); |
| 273 | LVFontRef valueFont = skin->getValueSkin()->getFont();//( fontMan->GetFont( VALUE_FONT_SIZE, 400, true, css_ff_sans_serif, lString8("Arial")) ); |
| 274 | CRMenu * fontSizeMenu; |
| 275 | fontSizeMenu = new FontSizeMenu(_wm, mainMenu, valueFont, props ); |
| 276 | for ( unsigned i=0; i<sizeof(cr_font_sizes)/sizeof(int); i++ ) { |
| 277 | //char name[32]; |
| 278 | char defvalue[400]; |
| 279 | //sprintf( name, "VIEWER_DLG_FONT_SIZE_%d", cr_font_sizes[i] ); |
| 280 | sprintf( defvalue, "%d %s", cr_font_sizes[i], _("The quick brown fox jumps over lazy dog") ); |
| 281 | fontSizeMenu->addItem( new OnDemandFontMenuItem( fontSizeMenu, 0, |
| 282 | lString16(defvalue), |
| 283 | LVImageSourceRef(), lString16::itoa(cr_font_sizes[i]).c_str(), |
| 284 | cr_font_sizes[i], 400, false, css_ff_sans_serif, fontFace, UnicodeToUtf8(skin->getItemSkin()->getFontFace())) ); |
| 285 | } |
| 286 | fontSizeMenu->setAccelerators( _wm->getAccTables().get("menu") ); |
| 287 | //fontSizeMenu->setAccelerators( _menuAccelerators ); |
| 288 | fontSizeMenu->setSkinName(lString16(L"#settings")); |
| 289 | //fontSizeMenu->setSkinName(lString16(L"#main")); |
| 290 | fontSizeMenu->reconfigure( 0 ); |
| 291 | return fontSizeMenu; |
| 292 | } |
| 293 | |
| 294 | void CRSettingsMenu::addMenuItems( CRMenu * menu, item_def_t values[] ) |
| 295 | { |
no test coverage detected