From 91d1d3ffdf20f8e6abaddd6932c8083a88b3cb0d Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Wed, 5 Oct 2005 01:40:16 +0000 Subject: [PATCH] menunextarea config file token --- cfgs/config/advanced.cfg | 4 ++++ cfgs/config/advanced.rus | 3 +++ docs/notework.txt | 5 ++++- golded3/gccfgg.cpp | 1 + golded3/gccfgg.h | 1 + golded3/gccfgg0.cpp | 1 + golded3/gccfgg5.cpp | 10 ++++++++++ golded3/gcprot.h | 1 + golded3/gecfgg.h | 1 + golded3/gemnus.cpp | 13 +++++++------ goldlib/gall/gkbdgetm.cpp | 1 + goldlib/gall/gmnubase.h | 1 + goldlib/gall/gwinall.h | 1 + goldlib/gall/gwinmenu.cpp | 17 ++++++++++++++--- goldlib/gall/gwinmnub.cpp | 2 ++ 15 files changed, 52 insertions(+), 10 deletions(-) diff --git a/cfgs/config/advanced.cfg b/cfgs/config/advanced.cfg index 8b09e9c..303fd3e 100644 --- a/cfgs/config/advanced.cfg +++ b/cfgs/config/advanced.cfg @@ -1152,6 +1152,10 @@ MENUDROPMSG YES // Choices are: MARKED, CURRENT, PREVIOUS or DEFAULT. ;MENUMARKED DEFAULT +// Set default for cursor on "Goto Next Area?" menu. (Yes) +// Choices are: No, Yes, Unread. +;MenuNextArea No + ---------------------------------------------------------------------- -- SCREEN AND COLORS diff --git a/cfgs/config/advanced.rus b/cfgs/config/advanced.rus index f04378b..a8eface 100644 --- a/cfgs/config/advanced.rus +++ b/cfgs/config/advanced.rus @@ -1316,6 +1316,9 @@ AskDelOrig Yes // Возможные варианты: Marked, Current, Previous или Default. ;MenuMarked Default +// Установка позиции курсора для меню "Goto Next Area?". (Yes) +// Возможные варианты: No, Yes, Unread. +;MenuNextArea No ---------------------------------------------------------------------- -- НАСТРОЙКА ПАРАМЕТРОВ ЭКРАНА diff --git a/docs/notework.txt b/docs/notework.txt index 2fe1ab3..69cc9ff 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,7 +10,10 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ -+ Added EditSoftCrxLat (yes/no) config file token that enable/disable ++ Added MenuNextArea (yes/no/unread) config file token that set default + for cursor on "Goto Next Area?" menu. + ++ Added EditSoftCrxLat (yes/no) config file token that enable/disable usage of EditSoftCrxLat. May be used in random system groups. + Added DISPPMFIRST (yes/no) config file token that enable/disable diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index 500939d..becf00a 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -740,6 +740,7 @@ CfgGed::CfgGed() { keybmode = KEYB_POLL; logformat = 0; menumarked = MODE_DONT; + menunextarea = YES; msglistdate = MSGLISTDATE_WRITTEN; msglistfast = true; msglistfirst = false; diff --git a/golded3/gccfgg.h b/golded3/gccfgg.h index d458e3e..5c5df9c 100644 --- a/golded3/gccfgg.h +++ b/golded3/gccfgg.h @@ -253,6 +253,7 @@ const word CRC_MAPPATH = 0x74E6; const word CRC_MEMBER = 0xF703; const word CRC_MENUDROPMSG = 0x9645; const word CRC_MENUMARKED = 0x7198; +const word CRC_MENUNEXTAREA = 0x82B4; const word CRC_MOUSE = 0x1B1B; const word CRC_MSGLISTDATE = 0xBFF5; const word CRC_MSGLISTFAST = 0xDE86; diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index deb9b78..a2eacd0 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -425,6 +425,7 @@ SwitchM: case CRC_MAPPATH : CfgMappath (); break; case CRC_MEMBER : CfgMember (); break; case CRC_MENUMARKED : CfgMenumarked (); break; + case CRC_MENUNEXTAREA : CfgMenunextarea (); break; case CRC_MSGLISTDATE : CfgMsglistdate (); break; case CRC_MSGLISTFAST : CfgMsglistfast (); break; case CRC_MSGLISTFIRST : CfgMsglistfirst (); break; diff --git a/golded3/gccfgg5.cpp b/golded3/gccfgg5.cpp index 529b34a..56e1f52 100644 --- a/golded3/gccfgg5.cpp +++ b/golded3/gccfgg5.cpp @@ -426,6 +426,16 @@ void CfgMenumarked() { // ------------------------------------------------------------------ +void CfgMenunextarea() +{ + if (strieql(val, "Unread")) + CFG->menunextarea = ALWAYS; + else + CFG->menunextarea = GetYesno(val); +} + +// ------------------------------------------------------------------ + void CfgMsglistdate() { int flag; diff --git a/golded3/gcprot.h b/golded3/gcprot.h index 70ba6f3..2528502 100644 --- a/golded3/gcprot.h +++ b/golded3/gcprot.h @@ -242,6 +242,7 @@ void CfgMappath (); void CfgMember (); void CfgMenudropmsg (); void CfgMenumarked (); +void CfgMenunextarea (); void CfgMouse (); void CfgMsglistdate (); void CfgMsglistfast (); diff --git a/golded3/gecfgg.h b/golded3/gecfgg.h index c6f18a3..ba9a7d5 100644 --- a/golded3/gecfgg.h +++ b/golded3/gecfgg.h @@ -261,6 +261,7 @@ public: std::vector mailinglist; std::vector< std::pair > mappath; int menumarked; + int menunextarea; int msglistdate; bool msglistfast; bool msglistfirst; diff --git a/golded3/gemnus.cpp b/golded3/gemnus.cpp index d47a4e4..532d9ea 100644 --- a/golded3/gemnus.cpp +++ b/golded3/gemnus.cpp @@ -216,7 +216,7 @@ static void PressY() { if(gkbd.kbuf == NULL) kbput(*LNG->GotoNextYes); } static void PressN() { if(gkbd.kbuf == NULL) kbput(*LNG->GotoNextNo); } int GMenuNewarea::Run() { - + enum { TAG_NO=100, TAG_YES, TAG_JUMP }; HandleGEvent(EVTT_ENDOFMSGS); @@ -229,8 +229,8 @@ int GMenuNewarea::Run() { _temp = AA->Mark.Find(AA->Msgn.CvtReln(AA->lastread())); if(_temp <= 1) { - _yeskey = Key_Rgt; - _nokey = Key_Lft; + _yeskey = Key_Lft; + _nokey = Key_Rgt; } AskInit(6, 0, LNG->GotoNext, H_AskNextArea); @@ -239,8 +239,7 @@ int GMenuNewarea::Run() { Item(TAG_YES, LNG->GotoNextYes, M_CLOSE, PressY, _yeskey); Item(TAG_NO, LNG->GotoNextNo, M_CLOSE, PressN, _nokey); Item(TAG_JUMP, LNG->GotoNextNew); - SetTag(TAG_YES); - // Dirk: YES must be default for backward comp. Make it configurable. + SetTag(CFG->menunextarea + TAG_NO); End(); Start(); @@ -249,8 +248,10 @@ int GMenuNewarea::Run() { if(finaltag != -1 and finaltag != TAG_JUMP) getxch(); - if(finaltag == -1) + if (finaltag == -1) finaltag = TAG_NO; + else if ((finaltag != overtag) && (finaltag == TAG_YES)) + finaltag = overtag; return (int) (finaltag - TAG_NO); } diff --git a/goldlib/gall/gkbdgetm.cpp b/goldlib/gall/gkbdgetm.cpp index 75ddd80..274e49d 100644 --- a/goldlib/gall/gkbdgetm.cpp +++ b/goldlib/gall/gkbdgetm.cpp @@ -304,6 +304,7 @@ gkey getxch(int __tick) { if(gwin.menu) { _item_t* item = find_hotkey(gwin.menu,k); if(item) { + gwin.menu->hotkey = true; kbd_call_func(item->select); #ifdef GOLD_MOUSE if(gkbd.inmenu and gmou.FreeCursor()) diff --git a/goldlib/gall/gmnubase.h b/goldlib/gall/gmnubase.h index dc1b42c..65e5a98 100644 --- a/goldlib/gall/gmnubase.h +++ b/goldlib/gall/gmnubase.h @@ -75,6 +75,7 @@ protected: int itemmask; int escape; + int overtag; int finaltag; int status; diff --git a/goldlib/gall/gwinall.h b/goldlib/gall/gwinall.h index aad33c0..e5d62da 100644 --- a/goldlib/gall/gwinall.h +++ b/goldlib/gall/gwinall.h @@ -157,6 +157,7 @@ struct _menu_t { int titleattr; // attribute of menu title int shadattr; // shadow attribute or -1 if no shadow int items; // number of items in menu + bool hotkey; }; diff --git a/goldlib/gall/gwinmenu.cpp b/goldlib/gall/gwinmenu.cpp index 87c060a..c3cf39f 100644 --- a/goldlib/gall/gwinmenu.cpp +++ b/goldlib/gall/gwinmenu.cpp @@ -44,6 +44,7 @@ // ------------------------------------------------------------------ +int _overtagid; int _finaltagid; int gmnudropthrough = NO; @@ -873,8 +874,11 @@ int wmenuget() { char ch; static int _depth = 0; - if(_depth == 0) + if (_depth == 0) + { + _overtagid = -1; _finaltagid = -1; + } // make sure we have a defined menu if(gwin.cmenu==NULL) { @@ -958,6 +962,7 @@ int wmenuget() { gwin.help=citem->help; // read mouse/keyboard for keypress, then test the keypress + gwin.menu->hotkey = false; gkbd.inmenu=true; xch = read_mouse(citem); citem=gwin.cmenu->citem; @@ -965,6 +970,9 @@ int wmenuget() { xch = getxch(); } gkbd.inmenu=false; + + _overtagid = citem->tagid; + switch(xch) { case Key_Esc: @@ -1208,8 +1216,11 @@ int wmenuget() { item=citem->next; for(;;) { while(item!=NULL) { - if((toupper(ch)==toupper(item->schar)) and not (item->fmask&M_NOSEL)) - goto FARBREAK; + if ((toupper(ch)==toupper(item->schar)) && !(item->fmask & M_NOSEL)) + { + if (!gwin.menu->hotkey) _overtagid = item->tagid; + goto FARBREAK; + } if(citem==item) { valid=NO; goto FARBREAK; diff --git a/goldlib/gall/gwinmnub.cpp b/goldlib/gall/gwinmnub.cpp index 20b44b8..e806e75 100644 --- a/goldlib/gall/gwinmnub.cpp +++ b/goldlib/gall/gwinmnub.cpp @@ -203,6 +203,7 @@ void GMnu::End() { // ------------------------------------------------------------------ +extern int _overtagid; extern int _finaltagid; void GMnu::Start() { @@ -210,6 +211,7 @@ void GMnu::Start() { int _prev_escape = wsetesc(escape); wmenuget(); finaltag = _finaltagid; + overtag = _overtagid; wsetesc(_prev_escape); }