summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatsuDrag92018-06-27 15:02:27 +0530
committerGitHub2018-06-27 15:02:27 +0530
commit43466700bab102a289e1c8e45a42269b0aa68715 (patch)
tree07c2bde56dcee76f594a6a530f7ff301064faf62
parent82ccdd0dc39a2f8d26d88b6c502b8a179e4fa73b (diff)
parenta488648a67bbddc8b9eb0f9417a920f454d1170f (diff)
downloadLDMicroGtk-43466700bab102a289e1c8e45a42269b0aa68715.tar.gz
LDMicroGtk-43466700bab102a289e1c8e45a42269b0aa68715.tar.bz2
LDMicroGtk-43466700bab102a289e1c8e45a42269b0aa68715.zip
Merge pull request #29 from NatsuDrag9/GUI_port
Gui port
-rw-r--r--ldmicro/commentdialog.cpp46
1 files changed, 7 insertions, 39 deletions
diff --git a/ldmicro/commentdialog.cpp b/ldmicro/commentdialog.cpp
index c691a44..e6743b4 100644
--- a/ldmicro/commentdialog.cpp
+++ b/ldmicro/commentdialog.cpp
@@ -38,21 +38,17 @@ static HWID CancelButton;
static void MakeControls(void)
{
- // CommentTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- // WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE |
- // ES_MULTILINE | ES_WANTRETURN,
- // 7, 10, 600, 38, CommentDialog, NULL, Instance, NULL);
- // FixedFont(CommentTextbox);
-
CommentTextbox = gtk_entry_new();
gtk_entry_set_max_length (GTK_ENTRY (CommentTextbox), 0);
+ gtk_widget_set_hexpand (CommentTextbox, TRUE);
+ gtk_widget_set_vexpand (CommentTextbox, TRUE);
OkButton = gtk_button_new_with_label ("OK");
CancelButton = gtk_button_new_with_label ("Cancel");
- gtk_grid_attach (GTK_GRID (CommentGrid), CommentTextbox, 1, 1, 4, 1);
- gtk_grid_attach (GTK_GRID (CommentGrid), OkButton, 5, 1, 1, 1);
- gtk_grid_attach (GTK_GRID (CommentGrid), CancelButton, 5, 2, 1, 1);
+ gtk_grid_attach (GTK_GRID (CommentGrid), CommentTextbox, 1, 2, 1, 1);
+ gtk_grid_attach (GTK_GRID (CommentGrid), OkButton, 5, 2, 1, 1);
+ gtk_grid_attach (GTK_GRID (CommentGrid), CancelButton, 5, 3, 1, 1);
gtk_grid_set_column_spacing (GTK_GRID (CommentGrid), 1);
gtk_box_pack_start(GTK_BOX(CommentPackingBox), CommentGrid, TRUE, TRUE, 0);
@@ -94,15 +90,14 @@ void ShowCommentDialog(char *comment)
CommentDialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(CommentDialog), "Comment");
- gtk_window_set_default_size(GTK_WINDOW(CommentDialog), 100, 50);
+ gtk_window_set_default_size(GTK_WINDOW(CommentDialog), 700, 50);
gtk_window_set_resizable (GTK_WINDOW (CommentDialog), FALSE);
- gtk_container_add(GTK_CONTAINER(CommentDialog), CommentPackingBox);
gtk_widget_add_events (CommentDialog, GDK_KEY_PRESS_MASK);
gtk_widget_add_events (CommentDialog, GDK_BUTTON_PRESS_MASK);
MakeControls();
gtk_entry_set_text (GTK_ENTRY (CommentTextbox), comment);
-
+ gtk_container_add(GTK_CONTAINER(CommentDialog), CommentPackingBox);
gtk_widget_set_sensitive (MainWindow, FALSE);
gtk_widget_show_all (CommentDialog);
gtk_widget_grab_focus (CommentTextbox);
@@ -114,32 +109,5 @@ void ShowCommentDialog(char *comment)
g_signal_connect (G_OBJECT (CancelButton), "clicked",
G_CALLBACK(CommentCallDestroyWindow), NULL);
- // MSG msg;
- // DWORD ret;
- // DialogDone = FALSE;
- // DialogCancel = FALSE;
- // while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- // if(msg.message == WM_KEYDOWN) {
- // if(msg.wParam == VK_TAB && GetFocus() == CommentTextbox) {
- // SetFocus(OkButton);
- // continue;
- // } else if(msg.wParam == VK_ESCAPE) {
- // DialogDone = TRUE;
- // DialogCancel = TRUE;
- // break;
- // }
- // }
-
- // if(IsDialogMessage(CommentDialog, &msg)) continue;
- // TranslateMessage(&msg);
- // DispatchMessage(&msg);
- // }
-
- // if(!DialogCancel) {
-
- // }
-
- // EnableWindow(MainWindow, TRUE);
- // DestroyWindow(CommentDialog);
return;
}