MCPcopy Create free account
hub / github.com/buggins/coolreader / CRViewDialog

Method CRViewDialog

cr3gui/src/viewdlg.cpp:103–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101;
102
103CRViewDialog::CRViewDialog(CRGUIWindowManager * wm, lString16 title, lString8 text, lvRect rect, bool showScroll, bool showFrame )
104 : CRDocViewWindow(wm), _text(text), _showScroll( showScroll ), _showFrame( showFrame ), _lastNavigationDirection(0)
105{
106 _passKeysToParent = _passCommandsToParent = false;
107 if ( _showFrame ) {
108 setSkinName( lString16("#dialog") );
109 if ( !_wm->getSkin().isNull() )
110 _skin = _wm->getSkin()->getWindowSkin(getSkinName().c_str());
111 }
112 setAccelerators( _wm->getAccTables().get("browse") );
113 _caption = title;
114 lvRect fsRect = _wm->getScreen()->getRect();
115 _fullscreen = false;
116 if ( rect.isEmpty() ) {
117 rect = fsRect;
118 _fullscreen = false;
119 } else {
120 _fullscreen = (rect == fsRect);
121 }
122 getDocView()->setDrawBufferBits(_wm->getScreen()->getCanvas()->GetBitsPerPixel());
123 getDocView()->setStyleSheet( lString8(def_view_css) );
124 getDocView()->setBackgroundColor(0xFFFFFF);
125 getDocView()->setTextColor(0x000000);
126 getDocView()->setFontSize( 20 );
127 getDocView()->setPageMargins( lvRect(8,8,8,8) );
128 if ( !_skin.isNull() ) {
129 CRRectSkinRef clientSkin = _skin->getClientSkin();
130 if ( !clientSkin.isNull() ) {
131 getDocView()->setBackgroundColor(clientSkin->getBackgroundColor());
132 getDocView()->setTextColor(clientSkin->getTextColor());
133 getDocView()->setFontSize(clientSkin->getFontSize());
134 getDocView()->setDefaultFontFace(UnicodeToUtf8(clientSkin->getFontFace()));
135 getDocView()->setPageMargins( clientSkin->getBorderWidths() );
136 }
137 }
138 getDocView()->setShowCover( false );
139 getDocView()->setPageHeaderInfo( 0 ); // hide title bar
140 if ( !text.empty() ) {
141 _stream = LVCreateStringStream( text );
142 getDocView()->LoadDocument(_stream);
143 }
144 setRect( rect );
145}
146
147bool CRViewDialog::hasDictionaries()
148{

Callers

nothing calls this directly

Calls 15

lString16Class · 0.85
lString8Class · 0.85
lvRectClass · 0.85
UnicodeToUtf8Function · 0.85
LVCreateStringStreamFunction · 0.85
getWindowSkinMethod · 0.80
getScreenMethod · 0.80
setDrawBufferBitsMethod · 0.80
GetBitsPerPixelMethod · 0.80
getCanvasMethod · 0.80
setBackgroundColorMethod · 0.80
setPageMarginsMethod · 0.80

Tested by

no test coverage detected