//--------------------------------------------------------------------------// //--------------------------------------------------------------------------// LRESULT CCtlPanel::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/) { SendDlgItemMessage(IDC_PAGE1, BM_SETCHECK, TRUE); for (int i = 0; i < MAX_COLORS; i++) { SendDlgItemMessage(IDC_COLOR, CB_ADDSTRING, 0, (LPARAM) ""); SendDlgItemMessage(IDC_COLOR, CB_SETITEMDATA, i, PickColor[i]); } SendDlgItemMessage(IDC_COLOR, CB_SETCURSEL, (WPARAM) -1, 0); for (i = 8; i <= 72; i += 2) { char szPtSize[10]; SendDlgItemMessage(IDC_PTSIZE, CB_ADDSTRING, 0, (LPARAM) _itoa(i, szPtSize, 10)); } SendDlgItemMessage(IDC_PTSIZE, CB_SETCURSEL, (WPARAM) -1, 0); HFONT hFont = (HFONT) GetStockObject(SYSTEM_FONT); SendDlgItemMessage(IDC_PTSIZE, WM_SETFONT, (WPARAM) hFont, 0); SetFonts(); SendDlgItemMessage(IDC_FONT, CB_SETCURSEL, (WPARAM) -1, 0); return (1); }
//! PrintableHtmlWindow class PrintableHtmlWindow::PrintableHtmlWindow(wxWindow* parent, wxWindowID id) : wxHtmlWindow(parent, id) { #ifdef __WXGTK20__ // default fonts are just too big on GTK2 int sizes[] = { 7, 8, 10, 12, 16, 22, 30 }; SetFonts(wxEmptyString, wxEmptyString, sizes); #endif }
BOOL InformApp::InitInstance() { InitCommonControls(); CWinApp::InitInstance(); theOS.Init(); theOS.BufferedPaintInit(); if (!AfxOleInit()) return FALSE; if (!Scintilla_RegisterClasses(AfxGetInstanceHandle())) return FALSE; if (GetIEVersion() < 5.0) { CString msg; msg.Format("Internet Explorer version 5 or higher must be installed."); AfxMessageBox(msg,MB_ICONSTOP|MB_OK); exit(0); } CheckMSXML(); SetRegistryKey("David Kinder"); SetFonts(); ReportHtml::SetIEPreferences(REGISTRY_PATH_BROWSER); // Set the HOME environment variable to the My Documents folder, // used by the Natural Inform compiler, and make sure directories // under My Documents exist. SetMyDocuments(); // Discard any log file from a previous run /*::DeleteFile(m_home+LOG_FILE);*/ // Install the protocol for inform: URLs m_protocol.Install(L"inform"); CString dir = GetAppDir(); m_protocol.AddDirectory(dir+"\\Documentation"); m_protocol.AddDirectory(dir+"\\Documentation\\doc_images"); m_protocol.AddDirectory(dir+"\\Documentation\\sections"); m_protocol.AddDirectory(L"//Extensions",m_home+"\\Inform\\Documentation"); m_protocol.AddDirectory(L"//Extensions",dir+"\\Documentation"); // Find and create documentation for extensions FindExtensions(); RunCensus(false); // Show the splash screen SplashScreen splash; splash.ShowSplash(); // Only continue if a project has been opened if (AfxGetMainWnd() == NULL) return FALSE; return TRUE; }
wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWindow) { m_ParentWindow = parentWindow; m_Name = name; m_PrintData = NULL; m_PageSetupData = new wxPageSetupDialogData; m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString; m_PageSetupData->EnableMargins(true); m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25)); m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25)); SetFonts(wxEmptyString, wxEmptyString, NULL); }
LRESULT CToolsCtlPanelText::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { InitToolCtrls(); InitToolTips(); SetFonts(); m_ComboFonts.SetCurSel(-1); long lWidth = m_ComboFonts.GetDroppedWidth(); long lRet = m_ComboFonts.SetDroppedWidth(dtoi(2.0 * lWidth)); bHandled = true; return S_OK; }
//--------------------------------------------------------------------------- GUI_Main_HTML::GUI_Main_HTML(Core* _C, wxWindow* parent) : wxHtmlWindow(parent, -1, wxPoint(1, 1), wxSize(parent->GetClientSize().GetWidth()-1, parent->GetClientSize().GetHeight()-1)), GUI_Main_Common_Core(_C) { int Size[7]={ 7, 8, 10, 12, 16, 22, 30}; SetFonts(wxEmptyString, wxEmptyString, Size); //Drag and Drop #if wxUSE_DRAG_AND_DROP && defined(__WXMAC__) SetDropTarget(new FileDrop(C)); #endif //wxUSE_DRAG_AND_DROP //Update GUI_Refresh(); }
void wxHtmlWinParser::SetStandardFonts(int size, const wxString& normal_face, const wxString& fixed_face) { if (size == -1) size = wxGetDefaultHTMLFontSize(); int f_sizes[7]; wxBuildFontSizes(f_sizes, size); wxString normal = normal_face; if ( normal.empty() ) normal = wxNORMAL_FONT->GetFaceName(); SetFonts(normal, fixed_face, f_sizes); }
wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindowInterface *wndIface) { m_tmpStrBuf = NULL; m_tmpStrBufSize = 0; m_windowInterface = wndIface; m_Container = NULL; m_DC = NULL; m_CharHeight = m_CharWidth = 0; m_UseLink = false; #if !wxUSE_UNICODE m_nbsp = 0; m_EncConv = NULL; m_InputEnc = wxFONTENCODING_ISO8859_1; m_OutputEnc = wxFONTENCODING_DEFAULT; #endif m_whitespaceMode = Whitespace_Normal; m_lastWordCell = NULL; m_posColumn = 0; { int i, j, k, l, m; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) for (k = 0; k < 2; k++) for (l = 0; l < 2; l++) for (m = 0; m < 7; m++) { m_FontsTable[i][j][k][l][m] = NULL; m_FontsFacesTable[i][j][k][l][m] = wxEmptyString; #if !wxUSE_UNICODE m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT; #endif } SetFonts(wxEmptyString, wxEmptyString, NULL); } // fill in wxHtmlParser's tables: wxList::compatibility_iterator node = m_Modules.GetFirst(); while (node) { wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node->GetData(); mod->FillHandlersTable(this); node = node->GetNext(); } }
void InformApp::SendAllFrames(Changed changed, int value) { if (changed == Preferences) { SetFonts(); ClearScaledImages(); ReportHtml::SetIEPreferences(NULL); } CArray<CFrameWnd*> frames; GetWindowFrames(frames); for (int i = 0; i < frames.GetSize(); i++) { CFrameWnd* frame = frames[i]; if (frame->IsKindOf(RUNTIME_CLASS(ProjectFrame))) ((ProjectFrame*)frame)->SendChanged(changed,value); else if (frame->IsKindOf(RUNTIME_CLASS(ExtensionFrame))) ((ExtensionFrame*)frame)->SendChanged(changed,value); } }
SjHtmlWindow::SjHtmlWindow(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style) : wxHtmlWindow(parent, id, pos, size, style) { wxFont guiFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); if( g_accelModule->m_flags&SJ_ACCEL_USE_VIEW_FONT_IN_DLG ) { guiFont = g_mainFrame->m_baseStdFont; } int normalFontSize = guiFont.GetPointSize(); int largeFontSize = (int)((float)normalFontSize*1.5); int sizes[7] = { normalFontSize, normalFontSize, normalFontSize, normalFontSize, normalFontSize, largeFontSize, largeFontSize }; SetFonts(guiFont.GetFaceName(), wxT(""), sizes); SetBorders(SJ_DLG_SPACE*2); }
void CHtmlWinParser::SetStandardFonts(int size, const wxString& normal_face, const wxString& fixed_face) { wxFont defaultFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); int f_sizes[7]; if (size == -1) size = defaultFont.GetPointSize(); f_sizes[0] = int(size * 0.6); f_sizes[1] = int(size * 0.8); f_sizes[2] = size; f_sizes[3] = int(size * 1.2); f_sizes[4] = int(size * 1.4); f_sizes[5] = int(size * 1.6); f_sizes[6] = int(size * 1.8); wxString normal = normal_face.empty() ? defaultFont.GetFaceName() : normal_face; SetFonts(normal, fixed_face, f_sizes); }
//cWindowOutputCtrl::cWindowOutputCtrl(wxWindow *Parent, wxWindowID ID, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : wxRichTextCtrl(Parent,ID,value,pos,size,style,validator,name) { cWindowOutputCtrl::cWindowOutputCtrl(wxWindow *Parent, wxWindowID ID, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxHtmlWindow(Parent,ID,pos,size,style,name) { EnableScrolling(false,true); int FontSizes[7] = {6,8,10,12,14,16,18}; SetFonts(GUI->m_Font->GetFaceName(),GUI->m_Font->GetFaceName(),FontSizes); AppendToPage("<font style='background-color: #333333'>ABC</font>"); }
LRESULT CCtlPanelText::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { bool bTextPanel = (m_nResID == IDD_PANEL_TEXT); if (bTextPanel) { CCtlPanel::InitLabels(); CCtlPanel::InitLineCombos(true); m_ColorComboFill.InitDialog(GetDlgItem(IDC_FILL_COLOR)); m_ColorComboFill2.InitDialog(GetDlgItem(IDC_FILL_COLOR2)); m_ComboFillType.InitDialog(GetDlgItem(IDC_FILL_TYPE)); LPCSTR szFillTypes[] = { "None", "Solid", "Sweep Right", "Sweep Down" }; for (int i = 0; i < sizeof(szFillTypes)/sizeof(LPCSTR); i++) m_ComboFillType.AddString(szFillTypes[i]); m_ComboFillType.SetCurSel(0); m_ComboTextSize.InitDialog(GetDlgItem(IDC_TEXT_SIZE)); m_ComboFonts.InitDialog(GetDlgItem(IDC_FONT)); CString strText; int iIncrement = 1; for (int i = 1; i <= 72; i += iIncrement) { int iTextSize = i; strText.Format("%d", iTextSize); int nItem = m_ComboTextSize.AddString(strText); m_ComboTextSize.SetItemData(nItem, POINTUNITS(iTextSize)); if (i == 12) iIncrement++; } m_ComboTextSize.SetCurSel(-1); m_ButtonBold.InitDialog(GetDlgItem(IDC_BOLD), IDB_BOLD); m_ButtonItalic.InitDialog(GetDlgItem(IDC_ITALIC), IDB_ITALIC); m_ButtonUnderline.InitDialog(GetDlgItem(IDC_UNDERLINE), IDB_UNDERLINE); m_ButtonLeft.InitDialog(GetDlgItem(IDC_LEFT), IDB_LEFT); m_ButtonCenter.InitDialog(GetDlgItem(IDC_CENTER), IDB_CENTER); m_ButtonRight.InitDialog(GetDlgItem(IDC_RIGHT), IDB_RIGHT); m_ButtonTop.InitDialog(GetDlgItem(IDC_TOP), IDB_TOP); m_ButtonMiddle.InitDialog(GetDlgItem(IDC_MIDDLE), IDB_MIDDLE); m_ButtonBottom.InitDialog(GetDlgItem(IDC_BOTTOM), IDB_BOTTOM); m_ButtonPrev.InitDialog(GetDlgItem(IDC_BACK), IDB_BACK); #ifdef NOTUSED { m_ButtonPrev.SubclassWindow(GetDlgItem(IDC_BACK)); CImage Image(_AtlBaseModule.GetResourceInstance(), IDB_BACK, "GIF"); HBITMAP hBitmap = Image.GetBitmapHandle(); BITMAP bm; ::GetObject(hBitmap, sizeof(bm), &bm); int dx = bm.bmWidth/3; int dy = bm.bmHeight; m_ImageList.Create(dx, dy, ILC_COLOR24, 1, 1); m_ImageList.Add(hBitmap); m_ButtonPrev.SetImageList(m_ImageList.m_hImageList); m_ButtonPrev.SetImages(0, 1, 0, 0); m_ButtonPrev.SizeToImage(); m_ButtonPrev.SetBitmapButtonExtendedStyle(BMPBTN_AUTO3D_DOUBLE); } #endif NOTUSED SetFonts(); m_ComboFonts.SetCurSel(-1); long lWidth = m_ComboFonts.GetDroppedWidth(); long lRet = m_ComboFonts.SetDroppedWidth(dtoi(2.0 * lWidth)); ::ShowWindow(GetDlgItem(IDC_BACK), SW_HIDE); } bHandled = true; return S_OK; }