From 9be4b067e4e5d8026be07acd417b51b4ee377822 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Mon, 18 Jan 2010 00:06:38 -0800 Subject: [PATCH] worked a bit on the history window --- gtk-interface.xml | 1 + xboard.c | 5 +- xhistory.c | 134 +++-------------------------------------------------- xhistory.h | 1 - 4 files changed, 11 insertions(+), 130 deletions(-) diff --git a/gtk-interface.xml b/gtk-interface.xml index 7a2cf7e..d5ef22a 100644 --- a/gtk-interface.xml +++ b/gtk-interface.xml @@ -31,6 +31,7 @@ True True + GDK_BUTTON_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK MoveHistoryStore False False diff --git a/xboard.c b/xboard.c index 8ed35b2..6750a6f 100644 --- a/xboard.c +++ b/xboard.c @@ -359,7 +359,7 @@ Widget layoutWidget, formWidget, boardWidget, messageWidget, menuBarWidget, editShell, errorShell, analysisShell, ICSInputShell, fileNameShell, askQuestionShell; -Widget historyShell, evalGraphShell, gameListShell; +Widget evalGraphShell, gameListShell; //XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2]; //XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6]; @@ -1187,6 +1187,7 @@ ParseCommPortSettings(char *s) extern Widget engineOutputShell; extern Widget tagsShell, editTagsShell; + void GetActualPlacement(Widget wg, WindowPlacement *wp) { @@ -1216,7 +1217,7 @@ GetWindowCoords() // GetActualPlacement(shellWidget, &wpMain); if(EngineOutputIsUp()) GetActualPlacement(engineOutputShell, &wpEngineOutput); else - if(MoveHistoryIsUp()) GetActualPlacement(historyShell, &wpMoveHistory); +// if(MoveHistoryIsUp()) GetActualPlacement(historyShell, &wpMoveHistory); if(EvalGraphIsUp()) GetActualPlacement(evalGraphShell, &wpEvalGraph); if(GameListIsUp()) GetActualPlacement(gameListShell, &wpGameList); if(commentShell) GetActualPlacement(commentShell, &wpComment); diff --git a/xhistory.c b/xhistory.c index c220e9a..6bf4ad0 100644 --- a/xhistory.c +++ b/xhistory.c @@ -71,6 +71,8 @@ HistoryPopDown(object, user_data) GtkObject *object; gpointer user_data; { + /* hides the history window */ + gtk_widget_hide (GUI_History); return; } @@ -150,7 +152,7 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current) }; } - /* check if ther is a white move left */ + /* check if there is a white move left */ if(movewhite[0]) { i++; @@ -179,123 +181,6 @@ void HistoryCreate() Right: ForwardProc() \n"; return; - /*-------- create the widgets ---------------*/ -//<<<<<<< HEAD -// j = 0; -// XtSetArg(args[j], XtNresizable, True); j++; -// XtSetArg(args[j], XtNallowShellResize, True); j++; -//#if TOPLEVEL -// hist->sh = historyShell = -// XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass, -// shellWidget, args, j); -//#else -// hist->sh = historyShell = -// XtCreatePopupShell(_("Move list"), transientShellWidgetClass, -// shellWidget, args, j); -//#endif -// j = 0; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNdefaultDistance, 0); j++; -// layout = -// XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, -// args, j); -// -// j = 0; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNresizable, True); j++; -// -// form = -// XtCreateManagedWidget("form", formWidgetClass, layout, args, j); -// -// j = 0; -// XtSetArg(args[j], XtNtop, XtChainTop); j++; -// XtSetArg(args[j], XtNbottom, XtChainBottom); j++; -// XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// XtSetArg(args[j], XtNright, XtChainRight); j++; -// -// XtSetArg(args[j], XtNborderWidth, 1); j++; -// XtSetArg(args[j], XtNresizable, False); j++; -// XtSetArg(args[j], XtNallowVert, True); j++; -// XtSetArg(args[j], XtNallowHoriz, True); j++; -// XtSetArg(args[j], XtNforceBars, False); j++; -// XtSetArg(args[j], XtNheight, 280); j++; -// hist->viewport = -// XtCreateManagedWidget("viewport", viewportWidgetClass, -// form, args, j); -// j=0; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; -// hist->vbox = -// XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); -// -// j=0; -// XtSetArg(args[j], XtNtop, XtChainTop); j++; -// XtSetArg(args[j], XtNbottom, XtChainTop); j++; -// XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// XtSetArg(args[j], XtNright, XtChainLeft); j++; -// -// XtSetArg(args[j], XtNdefaultColumns, 1); j++; -// XtSetArg(args[j], XtNforceColumns, True); j++; -// XtSetArg(args[j], XtNverticalList, True); j++; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNresizable,True);j++; -// XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, -// hist->vbox, args, j); -// XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); -// -// j=0; -// XtSetArg(args[j], XtNtop, XtChainTop); j++; -// XtSetArg(args[j], XtNbottom, XtChainTop); j++; -// XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// XtSetArg(args[j], XtNright, XtRubber); j++; -// -// XtSetArg(args[j], XtNdefaultColumns, 1); j++; -// XtSetArg(args[j], XtNforceColumns, True); j++; -// XtSetArg(args[j], XtNverticalList, True); j++; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNresizable,True);j++; -// XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; -// hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, -// hist->vbox, args, j); -// XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); -// -// j=0; -// XtSetArg(args[j], XtNtop, XtChainTop); j++; -// XtSetArg(args[j], XtNbottom, XtChainTop); j++; -// XtSetArg(args[j], XtNleft, XtRubber); j++; -// XtSetArg(args[j], XtNright, XtRubber); j++; -// -// XtSetArg(args[j], XtNdefaultColumns, 1); j++; -// XtSetArg(args[j], XtNforceColumns, True); j++; -// XtSetArg(args[j], XtNverticalList, True); j++; -// XtSetArg(args[j], XtNborderWidth, 0); j++; -// XtSetArg(args[j], XtNresizable,True);j++; -// XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; -// hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, -// hist->vbox, args, j); -// XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); -// -// j=0; -// XtSetArg(args[j], XtNbottom, XtChainBottom); j++; -// XtSetArg(args[j], XtNtop, XtChainBottom); j++; -// XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// XtSetArg(args[j], XtNright, XtChainLeft); j++; -// XtSetArg(args[j], XtNfromVert, hist->viewport); j++; -// b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass, -// form, args, j); -// XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); -// -// XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); -// -// XtRealizeWidget(hist->sh); -// CatchDeleteWindow(hist->sh, "HistoryPopDown"); -// -// for(i=1;iaNr;i++){ -// strcpy(hist->white[i],dots); -// strcpy(hist->black[i],""); -// } -// // if(wpMoveHistory.width > 0) { // gameHistoryW = wpMoveHistory.width; // gameHistoryH = wpMoveHistory.height; @@ -312,19 +197,14 @@ void HistoryCreate() // XtSetArg(args[j], XtNheight, gameHistoryH); j++; // XtSetValues(hist->sh, args, j); // } -// XtRealizeWidget(hist->sh); -// -// return hist->sh; -// } void HistoryPopUp() { - // if(!hist) HistoryCreate(); + /* show history window */ gtk_widget_show (GUI_History); - return; } @@ -344,7 +224,7 @@ HistoryShowProc(object, user_data) Boolean MoveHistoryIsUp() { - // TODO - return 0; - // return hist && hist->Up; + /* return status of history window */ + + return gtk_widget_get_visible (GUI_History); } diff --git a/xhistory.h b/xhistory.h index 109e1bd..94f2af0 100644 --- a/xhistory.h +++ b/xhistory.h @@ -29,6 +29,5 @@ void HistoryPopDown P((GtkObject *object, gpointer user_data)); Boolean MoveHistoryIsUp P((void)); -extern Widget historyShell; #endif /* _XHISTL_H */ -- 1.7.0.4