diff options
author | akshay-c | 2019-05-06 15:38:45 +0530 |
---|---|---|
committer | akshay-c | 2019-05-06 15:38:45 +0530 |
commit | 46fbe3ae31bb5687f31b17acac4c449699876f2f (patch) | |
tree | 11165c20484c635632312c8d89b34b2c4ba8d0ed /ldmicro/helpdialog.cpp | |
parent | 183053f2d67a92694cd25a4294af98055e4369e7 (diff) | |
download | LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.gz LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.bz2 LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.zip |
Remove Gtk code entirely, ported freeze library
Diffstat (limited to 'ldmicro/helpdialog.cpp')
-rw-r--r-- | ldmicro/helpdialog.cpp | 126 |
1 files changed, 1 insertions, 125 deletions
diff --git a/ldmicro/helpdialog.cpp b/ldmicro/helpdialog.cpp index 8317e52..baf1389 100644 --- a/ldmicro/helpdialog.cpp +++ b/ldmicro/helpdialog.cpp @@ -100,73 +100,17 @@ static int TitleHeight; HWID PackBoxHelp; HWID TextView; -GtkTextBuffer* TextBuffer; -GtkTextIter* TextIter = new GtkTextIter; #define RICH_EDIT_HEIGHT(h) \ ((((h) - 3 + (FONT_HEIGHT/2)) / FONT_HEIGHT) * FONT_HEIGHT) -static void SizeRichEdit(int a) -{ - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (RichEdit[a]), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_ALWAYS); - gtk_widget_set_hexpand(GTK_WIDGET(RichEdit[a]), TRUE); - gtk_widget_set_vexpand(GTK_WIDGET(RichEdit[a]), TRUE); -} - -// static BOOL Resizing(RECT *r, int wParam) -// { -// BOOL touched = FALSE; -// if(r->right - r->left < 650) { -// int diff = 650 - (r->right - r->left); -// if(wParam == WMSZ_RIGHT || wParam == WMSZ_TOPRIGHT || -// wParam == WMSZ_BOTTOMRIGHT) -// { -// r->right += diff; -// } else { -// r->left -= diff; -// } -// touched = TRUE; -// } - -// if(!(wParam == WMSZ_LEFT || wParam == WMSZ_RIGHT)) { -// int h = r->bottom - r->top - TitleHeight - 5; -// if(RICH_EDIT_HEIGHT(h) != h) { -// int diff = h - RICH_EDIT_HEIGHT(h); -// if(wParam == WMSZ_TOP || wParam == WMSZ_TOPRIGHT || -// wParam == WMSZ_TOPLEFT) -// { -// r->top += diff; -// } else { -// r->bottom -= diff; -// } -// touched = TRUE; -// } -// } - -// return !touched; -// } - static void MakeControls(int a) { - // HMODULE re = LoadLibrary("RichEd20.dll"); - // if(!re) oops(); - RichEdit[a] = new QPlainTextEdit(); RichEdit[a]->setReadOnly(TRUE); QPalette pal = RichEdit[a]->palette(); pal.setColor(QPalette::Base, (*(HBRUSH)GetStockObject(BLACK_BRUSH))); RichEdit[a]->setPalette(pal); - /*TextView = gtk_text_view_new (); - TextBuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (TextView)); - gtk_text_view_set_editable (GTK_TEXT_VIEW (TextView), FALSE);*/ - // SizeRichEdit(a); - // gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (TextView), GTK_WRAP_WORD); - // gtk_text_buffer_get_start_iter (TextBuffer, TextIter); - // COLORREF color; - // gtk_text_buffer_create_tag (TextBuffer, "ForegroundColor1", - // "foreground", "blue"); int i; BOOL nextSubHead = FALSE; @@ -222,20 +166,15 @@ static void MakeControls(int a) copy[j] = ' '; } s += j; - // color = RGB(255, 110, 255); - // gtk_widget_override_color (TextView, GTK_STATE_FLAG_NORMAL, &color); + nextSubHead = !nextSubHead; } else { COLORREF color = RGB(255, 255, 255); cf.setForeground(QBrush(color)); RichEdit[a]->setCurrentCharFormat(cf); - // gtk_widget_override_color (TextView, GTK_STATE_FLAG_NORMAL, &color); } - // gtk_text_buffer_insert_with_tags_by_name (TextBuffer, TextIter, - // s, -1, "ForegroundColor1", NULL); - // gtk_text_buffer_insert (TextBuffer, TextIter, s, -1); RichEdit[a]->appendPlainText(QString::fromStdString((const char*)s)); if(Text[a][i+1]) { @@ -243,75 +182,12 @@ static void MakeControls(int a) // RichEdit[a]->appendPlainText("\n"); } } - /*gtk_widget_override_background_color (TextView, GTK_STATE_FLAG_NORMAL, - ((HBRUSH)GetStockObject(BLACK_BRUSH))); - gtk_container_add (GTK_CONTAINER(RichEdit[a]), TextView);*/ - -} - -//----------------------------------------------------------------------------- -// Window proc for the help dialog. -//----------------------------------------------------------------------------- -// static LRESULT CALLBACK HelpProc(HWND hwnd, UINT msg, WPARAM wParam, -// LPARAM lParam) -// { -// int a = (hwnd == HelpDialog[0] ? 0 : 1); -// switch (msg) { -// case WM_SIZING: { -// RECT *r = (RECT *)lParam; -// return Resizing(r, wParam); -// break; -// } -// case WM_SIZE: -// SizeRichEdit(a); -// break; - -// case WM_ACTIVATE: -// case WM_KEYDOWN: -// SetFocus(RichEdit[a]); -// break; - -// case WM_DESTROY: -// case WM_CLOSE: -// HelpWindowOpen[a] = FALSE; -// // fall through -// default: -// return DefWindowProc(hwnd, msg, wParam, lParam); -// } - -// return 1; -// } - -//----------------------------------------------------------------------------- -// Create the class for the help window. -//----------------------------------------------------------------------------- -static void MakeClass(void) -{ -// WNDCLASSEX wc; -// memset(&wc, 0, sizeof(wc)); -// wc.cbSize = sizeof(wc); - -// wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC | -// CS_DBLCLKS; -// wc.lpfnWndProc = (WNDPROC)HelpProc; -// wc.hInstance = Instance; -// wc.lpszClassName = "LDmicroHelp"; -// wc.lpszMenuName = NULL; -// wc.hCursor = LoadCursor(NULL, IDC_ARROW); -// wc.hIcon = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000), -// IMAGE_ICON, 32, 32, 0); -// wc.hIconSm = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000), -// IMAGE_ICON, 16, 16, 0); - -// RegisterClassEx(&wc); } void ShowHelpDialog(BOOL about) { int a = about ? 1 : 0; - - // MakeClass(); const char *s = about ? "About LDmicro" : "LDmicro Help"; |