diff --git a/docs/notework.txt b/docs/notework.txt index 7ea41ab..891962e 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,61 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, March xx 2001 ______________________________________________________________________ +! Message lister redesigned. Should be quicker if you roll up and down + but consumes more memory. + ++ Added tonn of configuration keywords to goldkeys.cfg: + + Keyword Default Assignment + + AddressbookPack Alt-P + AddressbookDelete Del + AddressbookSelect Enter + AddressbookAdd Ins + AddressbookQuit Esc + HeaderToggleScanned Alt-4 + HeaderToggleGroupmsg Alt-2 + HeaderToggleZonegate Alt-G + HeaderToggleHubhost Alt-V + HeaderToggleRetrecreq Alt-M + HeaderToggleCrash Alt-C + HeaderToggleLocked Alt-L + HeaderToggleReceived Alt-R + HeaderToggleLocal Alt-W + HeaderToggleRetrec Alt-N + HeaderToggleFreq Alt-F + HeaderLookup Shift-F10 + HeaderToggleImm Alt-I + HeaderToggleAttrWin Alt-F1 + HeaderAddressbook F10 + HeaderToggleArcsent Alt-B + HeaderToggleHold Alt-H + HeaderToggleAudit Alt-Q + HeaderToggleXmail Alt-X + HeaderToggleTrunc Alt-T + HeaderToggleUpdreq Alt-U + HeaderClearAttrib Alt-Z + HeaderToggleKill Alt-K + HeaderToggleTransit Alt-J + HeaderToggleCfmrecreq Alt-Y + HeaderToggleOrphan Alt-O + HeaderToggleFile Alt-A + HeaderToggleDelsent Alt-E + HeaderToggleDirect Alt-D + HeaderToggleReserved Alt-1 + HeaderTogglePvt Alt-P + HeaderToggleSent Alt-S + +! READuserbase renamed to READaddressbook. + +! Changed default values for the following keywords: + + Keyword New Default Old Default + + ASKDELORIG NO YES + STYLECODES YES HIDE + QUOTEWRAPHARD NO YES + - Fixed leading space macroses in date/time format strings. - Fixed double recoding of header during forward, quote-reply, and diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index 74876f7..5c5e989 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -708,7 +708,7 @@ CfgGed::CfgGed() { gedhandshake = true; goldbaseuserno = 0; happybirthday = 0; - hidestylies = true; + hidestylies = false; hudsonsizewarn = 16000000L; hudsonuserno = 0; ignorecharset = false; @@ -731,7 +731,7 @@ CfgGed::CfgGed() { quotebufmode = QBUF_ASK; quotectrl = CI_TEAR|CI_ORIG; quotemargin = 70; - quotewraphard = true; + quotewraphard = false; ra2usersbbs = 0; replylink = 0; replylinklist = 0; @@ -783,7 +783,7 @@ CfgGed::CfgGed() { switches.set(areakeeplast, true); switches.set(arealistgroupid, true); switches.set(arealistpagebar, true); - switches.set(askdelorig, true); + switches.set(askdelorig, false); switches.set(beepcomment, true); switches.set(beepnoises, true); switches.set(dispautonext, true); diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index 0462168..52484bb 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -52,7 +52,7 @@ CmdKey DefaultKeyset[] = { { Key_Ent , KK_AreaSelect , KT_A }, { Key_Rgt , KK_AreaSelect , KT_A }, { Key_A_R , KK_AreaSelectMarks , KT_A }, - { Key_A_F8 , KK_AreaShowDel , KT_R }, + { Key_A_F8 , KK_AreaShowDel , KT_A }, { Key_A_T , KK_AreaToggle , KT_A }, { Key_Ins , KK_AreaToggle , KT_A }, { Key_C_Z , KK_AreaTouchNetscan , KT_A }, @@ -167,13 +167,15 @@ CmdKey DefaultKeyset[] = { { Key_BS , KK_ListGotoBookMark , KT_M }, { Key_S , KK_ListMarkingOptions , KT_M }, { Key_A_S , KK_ListMarkingOptions , KT_M }, - { Key_A_F9 , KK_ListMarkingOptions , KT_R }, + { Key_A_F9 , KK_ListMarkingOptions , KT_M }, { Key_C_Q , KK_ListQuitNow , KT_M }, { Key_Ent , KK_ListSelect , KT_M }, { Key_Tab , KK_ListToggleBookMark , KT_M }, { Key_C_D , KK_ListToggleDate , KT_M }, { Key_Space , KK_ListToggleMark , KT_M }, { Key_C_B , KK_ListToggleWideSubj , KT_M }, + { Key_C_PgUp , KK_ListGotoNext , KT_M }, + { Key_C_PgDn , KK_ListGotoNext , KT_M }, { Key_Esc , KK_NodeAbort , KT_N }, { Key_A_X , KK_NodeAskExit , KT_N }, @@ -304,16 +306,55 @@ CmdKey DefaultKeyset[] = { { Key_T , KK_ReadToggleTwits , KT_R }, { Key_A_T , KK_ReadToggleTwits , KT_R }, { Key_C_Z , KK_ReadTouchNetscan , KT_R }, - { Key_A_F10 , KK_ReadUserbase , KT_R }, + { Key_A_F10 , KK_ReadAddressbook , KT_R }, { Key_C_X , KK_ReadUUDecode , KT_R }, { Key_W , KK_ReadWriteMsg , KT_R }, { Key_A_W , KK_ReadWriteMsg , KT_R }, { Key_F7 , KK_ReadWriteMsg , KT_R }, - { 0xFFFF , 0xFFFF , 0xFF } + { Key_Esc , KK_AddressbookQuit , KT_B }, + { Key_Ins , KK_AddressbookAdd , KT_B }, + { Key_Ent , KK_AddressbookSelect , KT_B }, + { Key_Del , KK_AddressbookDelete , KT_B }, + { Key_A_P , KK_AddressbookPack , KT_B }, + + { Key_A_4 , KK_HeaderToggleScanned , KT_H }, + { Key_A_2 , KK_HeaderToggleGroupmsg , KT_H }, + { Key_A_G , KK_HeaderToggleZonegate , KT_H }, + { Key_A_V , KK_HeaderToggleHubhost , KT_H }, + { Key_A_M , KK_HeaderToggleRetrecreq, KT_H }, + { Key_A_C , KK_HeaderToggleCrash , KT_H }, + { Key_A_L , KK_HeaderToggleLocked , KT_H }, + { Key_A_R , KK_HeaderToggleReceived , KT_H }, + { Key_A_W , KK_HeaderToggleLocal , KT_H }, + { Key_A_N , KK_HeaderToggleRetrec , KT_H }, + { Key_A_F , KK_HeaderToggleFreq , KT_H }, + { Key_S_F10 , KK_HeaderLookup , KT_H }, + { Key_A_I , KK_HeaderToggleImm , KT_H }, + { Key_A_F1 , KK_HeaderToggleAttrWin , KT_H }, + { Key_F10 , KK_HeaderAddressbook , KT_H }, + { Key_A_B , KK_HeaderToggleArcsent , KT_H }, + { Key_A_H , KK_HeaderToggleHold , KT_H }, + { Key_A_Q , KK_HeaderToggleAudit , KT_H }, + { Key_A_X , KK_HeaderToggleXmail , KT_H }, + { Key_A_T , KK_HeaderToggleTrunc , KT_H }, + { Key_A_U , KK_HeaderToggleUpdreq , KT_H }, + { Key_A_Z , KK_HeaderClearAttrib , KT_H }, + { Key_A_K , KK_HeaderToggleKill , KT_H }, + { Key_A_J , KK_HeaderToggleTransit , KT_H }, + { Key_A_Y , KK_HeaderToggleCfmrecreq, KT_H }, + { Key_A_O , KK_HeaderToggleOrphan , KT_H }, + { Key_A_A , KK_HeaderToggleFile , KT_H }, + { Key_A_E , KK_HeaderToggleDelsent , KT_H }, + { Key_A_D , KK_HeaderToggleDirect , KT_H }, + { Key_A_1 , KK_HeaderToggleReserved , KT_H }, + { Key_A_P , KK_HeaderTogglePvt , KT_H }, + { Key_A_S , KK_HeaderToggleSent , KT_H }, + + { 0xFFFF , 0xFFFF , 0xFF } }; - + // ------------------------------------------------------------------ // must be sorted by crc_token @@ -322,6 +363,7 @@ tglobalkey globalkeys[] = { { CRC_READADDRESSBOOKADD , KK_ReadAddressbookAdd , KT_R }, // 0x00FA { CRC_LISTDOSSHELL , KK_ListDosShell , KT_M }, // 0x0130 { CRC_EDITGOLEFT , KK_EditGoLeft , KT_E }, // 0x043B + { CRC_HEADERTOGGLESCANNED , KK_HeaderToggleScanned , KT_H }, // 0x0459 { CRC_READTOGGLEHIDDEN , KK_ReadToggleHidden , KT_R }, // 0x04CE { CRC_EDITIMPORTTEXT , KK_EditImportText , KT_E }, // 0x0586 #if not defined(__UNIX__) or defined(__USE_NCURSES__) @@ -334,6 +376,7 @@ tglobalkey globalkeys[] = { { CRC_AREASELECTMARKS , KK_AreaSelectMarks , KT_A }, // 0x0AC3 { CRC_K_ALEFT , Key_A_Lft , 0 }, // 0x0B39 { CRC_READCHANGECHARSIN , KK_ReadChangeCharsIn , KT_R }, // 0x0B87 + { CRC_HEADERTOGGLEGROUPMSG , KK_HeaderToggleGroupmsg , KT_H }, // 0x0C51 { CRC_K_AF4 , Key_A_F4 , 0 }, // 0x0EF0 { CRC_K_AF5 , Key_A_F5 , 0 }, // 0x0EF1 { CRC_K_AF6 , Key_A_F6 , 0 }, // 0x0EF2 @@ -349,6 +392,7 @@ tglobalkey globalkeys[] = { { CRC_FILEUNMARKALL , KK_FileUnMarkAll , KT_F }, // 0x121A { CRC_K_SPACE , Key_Space , 0 }, // 0x1281 { CRC_EDITREFLOW , KK_EditReflow , KT_E }, // 0x13F9 + { CRC_HEADERTOGGLEZONEGATE , KK_HeaderToggleZonegate , KT_H }, // 0x140B { CRC_K_AF12 , Key_A_F12 , 0 }, // 0x14FC { CRC_K_AF10 , Key_A_F10 , 0 }, // 0x14FE { CRC_K_AF11 , Key_A_F11 , 0 }, // 0x14FF @@ -379,12 +423,18 @@ tglobalkey globalkeys[] = { { CRC_K_CRIGHT , Key_C_Rgt , 0 }, // 0x20EC { CRC_EDITBLOCKRIGHT , KK_EditBlockRight , KT_E }, // 0x20F9 { CRC_AREAJUMP , KK_AreaJump , KT_A }, // 0x2342 + { CRC_HEADERTOGGLEHUBHOST , KK_HeaderToggleHubhost , KT_H }, // 0x2505 { CRC_K_CPGUP , Key_C_PgUp , 0 }, // 0x2603 { CRC_READGOTOPREVUNREAD , KK_ReadGotoPrevUnread , KT_R }, // 0x27EA { CRC_READTOGGLEREALMSGNO , KK_ReadToggleRealMsgno , KT_R }, // 0x2A3B + { CRC_ADDRESSBOOKADD , KK_AddressbookAdd , KT_B }, // 0x2C5C + { CRC_HEADERTOGGLERETRECREQ , KK_HeaderToggleRetrecreq, KT_H }, // 0x2CF1 + { CRC_HEADERTOGGLECRASH , KK_HeaderToggleCrash , KT_H }, // 0x2CF9 + { CRC_ADDRESSBOOKDELETE , KK_AddressbookDelete , KT_B }, // 0x2D4A { CRC_AREADOSSHELL , KK_AreaDosShell , KT_A }, // 0x2DED { CRC_K_DOWN , Key_Dwn , 0 }, // 0x2F6D { CRC_READNEWMSG , KK_ReadNewMsg , KT_R }, // 0x30CA + { CRC_HEADERTOGGLELOCKED , KK_HeaderToggleLocked , KT_H }, // 0x312D { CRC_NODEGOTOFIRST , KK_NodeGotoFirst , KT_N }, // 0x321B { CRC_READUNDEFINE , KK_ReadUndefine , KT_R }, // 0x329D { CRC_K_ADOWN , Key_A_Dwn , 0 }, // 0x32C0 @@ -392,6 +442,7 @@ tglobalkey globalkeys[] = { { CRC_K_CF10 , Key_C_F10 , 0 }, // 0x3482 { CRC_K_CF11 , Key_C_F11 , 0 }, // 0x3483 { CRC_K_CHOME , Key_C_Home , 0 }, // 0x35C4 + { CRC_HEADERTOGGLERECEIVED , KK_HeaderToggleReceived , KT_H }, // 0x36B9 { CRC_K_CPGDN , Key_C_PgDn , 0 }, // 0x371D { CRC_EDITCOPYABOVECHAR , KK_EditCopyAboveChar , KT_E }, // 0x380C { CRC_LISTSELECT , KK_ListSelect , KT_M }, // 0x3829 @@ -457,6 +508,8 @@ tglobalkey globalkeys[] = { { CRC_K_F8 , Key_F8 , 0 }, // 0x4638 { CRC_K_F9 , Key_F9 , 0 }, // 0x4639 { CRC_READTOGGLEKLUDGE , KK_ReadToggleKludge , KT_R }, // 0x46AB + { CRC_HEADERTOGGLELOCAL , KK_HeaderToggleLocal , KT_H }, // 0x47A1 + { CRC_ADDRESSBOOKQUIT , KK_AddressbookQuit , KT_B }, // 0x47C7 { CRC_READCHANGEATTRS , KK_ReadChangeAttrs , KT_R }, // 0x47F8 { CRC_READSEARCH , KK_ReadSearch , KT_R }, // 0x48EF { CRC_READMSGPGDN , KK_ReadMsgPgDn , KT_R }, // 0x4908 @@ -490,6 +543,7 @@ tglobalkey globalkeys[] = { { CRC_K_CLEFT , Key_C_Lft , 0 }, // 0x535B { CRC_K_UP , Key_Up , 0 }, // 0x5550 { CRC_K_END , Key_End , 0 }, // 0x5625 + { CRC_HEADERTOGGLERETREC , KK_HeaderToggleRetrec , KT_H }, // 0x56EA { CRC_K_ATAB , Key_A_Tab , 0 }, // 0x56FF { CRC_READMSGPGUP , KK_ReadMsgPgUp , KT_R }, // 0x5816 { CRC_AREATOUCHNETSCAN , KK_AreaTouchNetscan , KT_A }, // 0x58C1 @@ -541,8 +595,10 @@ tglobalkey globalkeys[] = { { CRC_KK_AUTO , Key_Auto , 0 }, // 0x60E2 { CRC_READFINDHEADER , KK_ReadFindHeader , KT_R }, // 0x6343 { CRC_K_PGUP , Key_PgUp , 0 }, // 0x63CC + { CRC_HEADERTOGGLEFREQ , KK_HeaderToggleFreq , KT_H }, // 0x63D9 { CRC_EDITABORT , KK_EditAbort , KT_E }, // 0x6468 { CRC_EDITSAVEFILE , KK_EditSaveFile , KT_E }, // 0x64A4 + { CRC_HEADERLOOKUP , KK_HeaderLookup , KT_H }, // 0x64F2 { CRC_AREAGOTOPREV , KK_AreaGotoPrev , KT_A }, // 0x6534 { CRC_EDITDELLEFT , KK_EditDelLeft , KT_E }, // 0x6552 { CRC_EDITSAVEMSG , KK_EditSaveMsg , KT_E }, // 0x660C @@ -556,9 +612,12 @@ tglobalkey globalkeys[] = { { CRC_FILEUNMARK , KK_FileUnMark , KT_F }, // 0x6D1B { CRC_EDITTOLOWER , KK_EditToLower , KT_E }, // 0x6D85 { CRC_K_AHOME , Key_A_Home , 0 }, // 0x6DA6 + { CRC_HEADERTOGGLEIMM , KK_HeaderToggleImm , KT_H }, // 0x6E15 { CRC_LISTTOGGLEDATE , KK_ListToggleDate , KT_M }, // 0x6F1F { CRC_K_APGDN , Key_A_PgDn , 0 }, // 0x6F7F + { CRC_HEADERTOGGLEATTRWIN , KK_HeaderToggleAttrWin , KT_H }, // 0x6F95 { CRC_K_HOME , Key_Home , 0 }, // 0x700B + { CRC_ADDRESSBOOKSELECT , KK_AddressbookSelect , KT_B }, // 0x70D1 { CRC_EDITGOPGUP , KK_EditGoPgUp , KT_E }, // 0x7163 { CRC_READMSGLINEUP , KK_ReadMsgLineUp , KT_R }, // 0x7238 { CRC_EDITHEADER , KK_EditHeader , KT_E }, // 0x726F @@ -567,6 +626,7 @@ tglobalkey globalkeys[] = { { CRC_READGOTOMSGNO , KK_ReadGotoMsgno , KT_R }, // 0x73F7 { CRC_READCHANGEUSERNAME , KK_ReadChangeUsername , KT_R }, // 0x7438 { CRC_READSTEALTAGLINE , KK_ReadStealTagline , KT_R }, // 0x7480 + { CRC_HEADERADDRESSBOOK , KK_HeaderAddressbook , KT_H }, // 0x76FC { CRC_EDITUNDEFINE , KK_EditUndefine , KT_E }, // 0x7873 { CRC_LISTGOTOFIRST , KK_ListGotoFirst , KT_M }, // 0x7925 { CRC_K_CEND , Key_C_End , 0 }, // 0x7B95 @@ -583,13 +643,16 @@ tglobalkey globalkeys[] = { { CRC_EDITMACRO , KK_EditMacro , KT_E }, // 0x85CD { CRC_K_ENTER , Key_Ent , 0 }, // 0x87BD { CRC_EDITGOTOPLINE , KK_EditGoTopLine , KT_E }, // 0x87C2 + { CRC_HEADERTOGGLEARCSENT , KK_HeaderToggleArcsent , KT_H }, // 0x88A7 { CRC_EDITBLOCKPGDN , KK_EditBlockPgDn , KT_E }, // 0x895B { CRC_EDITASKEXIT , KK_EditAskExit , KT_E }, // 0x89AF + { CRC_HEADERTOGGLEHOLD , KK_HeaderToggleHold , KT_H }, // 0x8A5F { CRC_EDITBLOCKHOME , KK_EditBlockHome , KT_E }, // 0x8B82 { CRC_READDELETEMSG , KK_ReadDeleteMsg , KT_R }, // 0x8BCE { CRC_EDITTAB , KK_EditTab , KT_E }, // 0x8C26 { CRC_K_KEY5 , Key_5 , 0 }, // 0x9062 { CRC_EDITPASTE , KK_EditPaste , KT_E }, // 0x90C4 + { CRC_HEADERTOGGLEAUDIT , KK_HeaderToggleAudit , KT_H }, // 0x91B7 { CRC_EDITGOBOTLINE , KK_EditGoBotLine , KT_E }, // 0x92DD { CRC_EXTERNUTIL18 , KK_ExternUtil18 , KT_R }, // 0x94B0 { CRC_EXTERNUTIL19 , KK_ExternUtil19 , KT_R }, // 0x94B1 @@ -611,6 +674,7 @@ tglobalkey globalkeys[] = { { CRC_EXTERNUTIL05 , KK_ExternUtil05 , KT_R }, // 0x95BD { CRC_EXTERNUTIL06 , KK_ExternUtil06 , KT_R }, // 0x95BE { CRC_EXTERNUTIL07 , KK_ExternUtil07 , KT_R }, // 0x95BF + { CRC_HEADERTOGGLEXMAIL , KK_HeaderToggleXmail , KT_H }, // 0x9622 { CRC_AREABOARDNOS , KK_AreaBoardnos , KT_A }, // 0x96EA { CRC_EXTERNUTIL20 , KK_ExternUtil20 , KT_R }, // 0x97B8 { CRC_EXTERNUTIL21 , KK_ExternUtil21 , KT_R }, // 0x97B9 @@ -636,12 +700,14 @@ tglobalkey globalkeys[] = { { CRC_FILEMENU , KK_FileMenu , KT_F }, // 0xA4B2 { CRC_READASKEXIT , KK_ReadAskExit , KT_R }, // 0xA500 { CRC_AREAJUMPNEXTMATCH , KK_AreaJumpNextMatch , KT_A }, // 0xA556 + { CRC_HEADERTOGGLETRUNC , KK_HeaderToggleTrunc , KT_H }, // 0xA5B4 { CRC_READTOGGLEBOOKMARK , KK_ReadToggleBookMark , KT_R }, // 0xA7E2 { CRC_EDITSOUNDKILL , KK_EditSoundkill , KT_E }, // 0xA9A7 { CRC_AREAQUITNOW , KK_AreaQuitNow , KT_A }, // 0xAAC4 { CRC_READNEWAREA , KK_ReadNewArea , KT_R }, // 0xAB5E { CRC_AREAMENU , KK_AreaMenu , KT_A }, // 0xABE1 { CRC_READQUITNOW , KK_ReadQuitNow , KT_R }, // 0xAC15 + { CRC_HEADERTOGGLEUPDREQ , KK_HeaderToggleUpdreq , KT_H }, // 0xAC35 { CRC_EDITDELLINE , KK_EditDelLine , KT_E }, // 0xACCF #if not defined(__UNIX__) or defined(__USE_NCURSES__) { CRC_K_SPGDN , Key_S_PgDn , 0 }, // 0xAD44 @@ -661,13 +727,18 @@ tglobalkey globalkeys[] = { { CRC_AREADROPMSGMARKS , KK_AreaDropMsgMarks , KT_A }, // 0xB90C { CRC_K_CINS , Key_C_Ins , 0 }, // 0xBA0E { CRC_READGOTONEXTUNREAD , KK_ReadGotoNextUnread , KT_R }, // 0xBA34 + { CRC_READADDRESSBOOK , KK_ReadAddressbook , KT_R }, // 0xBAC1 #if not defined(__UNIX__) or defined(__USE_NCURSES__) { CRC_K_SPGUP , Key_S_PgUp , 0 }, // 0xBC5A #endif { CRC_FILEABORT , KK_FileAbort , KT_F }, // 0xBCED { CRC_READCHANGETAGLINE , KK_ReadChangeTagline , KT_R }, // 0xBDD2 { CRC_READQUOTEMSG , KK_ReadQuoteMsg , KT_R }, // 0xBE00 + { CRC_HEADERCLEARATTRIB , KK_HeaderClearAttrib , KT_H }, // 0xBED5 { CRC_READCOPYMOVEFORWARD , KK_ReadCopyMoveForward , KT_R }, // 0xBFAF + { CRC_HEADERTOGGLEKILL , KK_HeaderToggleKill , KT_H }, // 0xBFC2 + { CRC_HEADERTOGGLETRANSIT , KK_HeaderToggleTransit , KT_H }, // 0xC112 + { CRC_HEADERTOGGLECFMRECREQ , KK_HeaderToggleCfmrecreq, KT_H }, // 0xC12D { CRC_READTOGGLEROT13 , KK_ReadToggleROT13 , KT_R }, // 0xC157 { CRC_EDITTOGGLECASE , KK_EditToggleCase , KT_E }, // 0xC282 { CRC_FILEGOTOLAST , KK_FileGotoLast , KT_F }, // 0xC40A @@ -680,12 +751,16 @@ tglobalkey globalkeys[] = { #if not defined(__UNIX__) or defined(__USE_NCURSES__) { CRC_K_SLEFT , Key_S_Lft , 0 }, // 0xC902 #endif + { CRC_HEADERTOGGLEORPHAN , KK_HeaderToggleOrphan , KT_H }, // 0xC98A + { CRC_HEADERTOGGLEFILE , KK_HeaderToggleFile , KT_H }, // 0xC997 { CRC_NODEGOTOLAST , KK_NodeGotoLast , KT_N }, // 0xCA13 { CRC_FILEGOTOFIRST , KK_FileGotoFirst , KT_F }, // 0xCAD5 + { CRC_HEADERTOGGLEDELSENT , KK_HeaderToggleDelsent , KT_H }, // 0xCD4B { CRC_LISTTOGGLEBOOKMARK , KK_ListToggleBookMark , KT_M }, // 0xCFA0 { CRC_READTOGGLEMARKREAD , KK_ReadToggleMarkRead , KT_R }, // 0xCFAE { CRC_LISTQUITNOW , KK_ListQuitNow , KT_M }, // 0xD037 { CRC_FILEMARKALL , KK_FileMarkAll , KT_F }, // 0xD115 + { CRC_HEADERTOGGLEDIRECT , KK_HeaderToggleDirect , KT_H }, // 0xD1D2 { CRC_AREAWRITEGOLDLAST , KK_AreaWriteGoldlast , KT_A }, // 0xD353 { CRC_LISTTOGGLEMARK , KK_ListToggleMark , KT_M }, // 0xD389 { CRC_EDITTOUPPER , KK_EditToUpper , KT_E }, // 0xD3DD @@ -734,10 +809,12 @@ tglobalkey globalkeys[] = { { CRC_K_SDOWN , Key_S_Dwn , 0 }, // 0xF0FB #endif { CRC_READCHANGEXLATIMPORT , KK_ReadChangeXlatImport , KT_R }, // 0xF169 + { CRC_HEADERTOGGLERESERVED , KK_HeaderToggleReserved , KT_H }, // 0xF297 { CRC_READTOGGLESTYLES , KK_ReadToggleStyles , KT_R }, // 0xF47E { CRC_EDITBLOCKEND , KK_EditBlockEnd , KT_E }, // 0xF55B { CRC_EDITTABREVERSE , KK_EditTabReverse , KT_E }, // 0xF5B6 - { CRC_READUSERBASE , KK_ReadUserbase , KT_R }, // 0xF736 + { CRC_HEADERTOGGLEPVT , KK_HeaderTogglePvt , KT_H }, // 0xF614 + { CRC_HEADERTOGGLESENT , KK_HeaderToggleSent , KT_H }, // 0xF68C { CRC_K_RIGHT , Key_Rgt , 0 }, // 0xF78D { CRC_EDITIMPORTQUOTEBUF , KK_EditImportQuotebuf , KT_E }, // 0xF797 { CRC_READMACRO , KK_ReadMacro , KT_R }, // 0xF7D8 @@ -759,6 +836,7 @@ tglobalkey globalkeys[] = { { CRC_READCHANGEORIGIN , KK_ReadChangeOrigin , KT_R }, // 0xFD2C { CRC_FILEDOSSHELL , KK_FileDosShell , KT_F }, // 0xFE9D { CRC_EDITLOOKUPDEST , KK_EditLookupDest , KT_E }, // 0xFEC4 + { CRC_ADDRESSBOOKPACK , KK_AddressbookPack , KT_B }, // 0xFF55 { CRC_AREAMACRO , KK_AreaMacro , KT_A }, // 0xFFA7 }; @@ -1032,6 +1110,8 @@ int ReadKeysCfg(int force) { case KT_M: ListKeys++; if(ListKeys == 1) ListKey = ck; break; case KT_N: NodeKeys++; if(NodeKeys == 1) NodeKey = ck; break; case KT_R: ReadKeys++; if(ReadKeys == 1) ReadKey = ck; break; + case KT_B: AddressbookKeys++; if(AddressbookKeys == 1) AddressbookKey = ck; break; + case KT_H: HeaderKeys++; if(HeaderKeys == 1) HeaderKey = ck; break; } ck++; } diff --git a/golded3/gckeys.h b/golded3/gckeys.h index ac68669..fb15bfd 100644 --- a/golded3/gckeys.h +++ b/golded3/gckeys.h @@ -204,6 +204,7 @@ const word CRC_NODEQUITNOW = 0xE780; const word CRC_NODESELECT = 0x6A64; const word CRC_NODEUNDEFINE = 0x5E32; +const word CRC_READADDRESSBOOK = 0xBAC1; const word CRC_READADDRESSBOOKADD = 0x00FA; const word CRC_READASKEXIT = 0xA500; const word CRC_READCHANGEAKA = 0x2015; @@ -287,10 +288,48 @@ const word CRC_READTOGGLETWITS = 0x5FD1; const word CRC_READTOUCHNETSCAN = 0x4BF3; const word CRC_READTOUCHSEMAPHORE = 0x6B1D; const word CRC_READUNDEFINE = 0x329D; -const word CRC_READUSERBASE = 0xF736; const word CRC_READUUDECODE = 0x4F0B; const word CRC_READWRITEMSG = 0x73AC; +const word CRC_ADDRESSBOOKQUIT = 0x47C7; +const word CRC_ADDRESSBOOKADD = 0x2C5C; +const word CRC_ADDRESSBOOKSELECT = 0x70D1; +const word CRC_ADDRESSBOOKDELETE = 0x2D4A; +const word CRC_ADDRESSBOOKPACK = 0xFF55; + +const word CRC_HEADERADDRESSBOOK = 0x76FC; +const word CRC_HEADERLOOKUP = 0x64F2; +const word CRC_HEADERTOGGLEATTRWIN = 0x6F95; +const word CRC_HEADERTOGGLERESERVED = 0xF297; +const word CRC_HEADERTOGGLEGROUPMSG = 0x0C51; +const word CRC_HEADERTOGGLESCANNED = 0x0459; +const word CRC_HEADERTOGGLEFILE = 0xC997; +const word CRC_HEADERTOGGLEARCSENT = 0x88A7; +const word CRC_HEADERTOGGLECRASH = 0x2CF9; +const word CRC_HEADERTOGGLEDIRECT = 0xD1D2; +const word CRC_HEADERTOGGLEDELSENT = 0xCD4B; +const word CRC_HEADERTOGGLEFREQ = 0x63D9; +const word CRC_HEADERTOGGLEZONEGATE = 0x140B; +const word CRC_HEADERTOGGLEHOLD = 0x8A5F; +const word CRC_HEADERTOGGLEIMM = 0x6E15; +const word CRC_HEADERTOGGLETRANSIT = 0xC112; +const word CRC_HEADERTOGGLEKILL = 0xBFC2; +const word CRC_HEADERTOGGLELOCKED = 0x312D; +const word CRC_HEADERTOGGLERETRECREQ= 0x2CF1; +const word CRC_HEADERTOGGLERETREC = 0x56EA; +const word CRC_HEADERTOGGLEORPHAN = 0xC98A; +const word CRC_HEADERTOGGLEPVT = 0xF614; +const word CRC_HEADERTOGGLEAUDIT = 0x91B7; +const word CRC_HEADERTOGGLERECEIVED = 0x36B9; +const word CRC_HEADERTOGGLESENT = 0xF68C; +const word CRC_HEADERTOGGLETRUNC = 0xA5B4; +const word CRC_HEADERTOGGLEUPDREQ = 0xAC35; +const word CRC_HEADERTOGGLEHUBHOST = 0x2505; +const word CRC_HEADERTOGGLELOCAL = 0x47A1; +const word CRC_HEADERTOGGLEXMAIL = 0x9622; +const word CRC_HEADERTOGGLECFMRECREQ= 0xC12D; +const word CRC_HEADERCLEARATTRIB = 0xBED5; + const word CRC_K_F1 = 0x4631; const word CRC_K_F2 = 0x4632; const word CRC_K_F3 = 0x4633; diff --git a/golded3/geall.h b/golded3/geall.h index 366f1c2..fa23be6 100644 --- a/golded3/geall.h +++ b/golded3/geall.h @@ -551,6 +551,7 @@ struct MLst { time_t arrived; time_t received; char goldmark; + bool initialized; }; diff --git a/golded3/geedit.cpp b/golded3/geedit.cpp index 7c0da8d..03a2984 100644 --- a/golded3/geedit.cpp +++ b/golded3/geedit.cpp @@ -836,8 +836,10 @@ Line* IEclass::wrapit(Line** __currline, uint* __curr_col, uint* __curr_row, boo displine(_thisline, _thisrow); } + _thislen = _thisline->txt.length(); + // If we are on the cursor line, check if the cursor char was wrapped - if(_thisrow == _cursrow and _thisline->txt.length() <= _curscol) { + if((_thisrow == _cursrow) and (_thislen <= _curscol) and not ((_thislen == _curscol) and (_thisline->txt[_curscol] != ' '))) { _curscol = _quotelen + ((_curscol > _wrappos) ? _curscol-_wrappos : 0); _cursrow++; UndoItem* i = Undo->last_item; @@ -1018,14 +1020,9 @@ void IEclass::DelChar() { GetQuotestr(_nextline->txt.c_str(), _dummybuf, &_quotelen); } - // Copy the next line's text to this line - // Skip past the next line's quote string and blanks, if any - const char* _nextptr = _nextline->txt.c_str()+_quotelen; - if(not ((_nextline->type & GLINE_QUOT) and (col == 0))) { - while(*_nextptr == ' ') - _nextptr++; - } - _thisline->txt += _nextptr; + // Copy the next line's text to this line without quote string + const char *_nexttext = _nextline->txt.c_str()+_quotelen; + _thisline->txt += _nexttext + strspn(_nexttext, " "); Undo->PushItem(EDIT_UNDO_CUT_TEXT|batch_mode, _thisline, col); @@ -1054,10 +1051,12 @@ void IEclass::DelChar() { // Make sure the line type still is correct setlinetype(_thisline); + uint _thisrow = row; + // Rewrap this line wrapdel(&currline, &col, &row, false); - refresh(currline, row); + refresh(_thisline, _thisrow); GFTRK(NULL); } @@ -1453,7 +1452,7 @@ void IEclass::DeleteEOL() { GFTRK("EditDeleteEOL"); - bool _has_linefeed = currline->txt.find('\n') != currline->txt.npos ? true : false; + bool _has_linefeed = (currline->txt.find('\n') != currline->txt.npos) ? true : false; Undo->PushItem(EDIT_UNDO_DEL_TEXT, currline); diff --git a/golded3/gefile.cpp b/golded3/gefile.cpp index 9f023a2..b72792e 100644 --- a/golded3/gefile.cpp +++ b/golded3/gefile.cpp @@ -345,7 +345,6 @@ void FileSelect(GMsg* msg, char* title, FileSpec* fspec) { if((strpbrk(fbuf, "*?")) or done) { winop = true; - ChgAttrs(NO, msg); vcurhide(); wopen_(6,0, MAX_POS+3, MAXCOL, W_BMENU, C_MENUB, C_MENUW, C_MENUPB); @@ -419,7 +418,6 @@ void FileSelect(GMsg* msg, char* title, FileSpec* fspec) { if(winop) { wclose(); - ChgAttrs(YES, msg); vcurshow(); } diff --git a/golded3/geglob.cpp b/golded3/geglob.cpp index 611cae1..9a106d0 100644 --- a/golded3/geglob.cpp +++ b/golded3/geglob.cpp @@ -56,7 +56,9 @@ int ListKeys = 0; int NodeKeys = 0; int EditKeys = 0; int FileKeys = 0; -list::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey; +int AddressbookKeys = 0; +int HeaderKeys = 0; +list::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey; int inforow = 18; diff --git a/golded3/geglob.h b/golded3/geglob.h index ed71c3a..a812774 100644 --- a/golded3/geglob.h +++ b/golded3/geglob.h @@ -100,8 +100,8 @@ extern char m_title[]; extern int m_titlepos; extern int m_titleattr; -extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys; -extern list::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey; +extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys, AddressbookKeys, HeaderKeys; +extern list::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey; extern int inforow; diff --git a/golded3/gehdre.cpp b/golded3/gehdre.cpp index 8110fe7..631693e 100644 --- a/golded3/gehdre.cpp +++ b/golded3/gehdre.cpp @@ -58,18 +58,29 @@ public: bool GMsgHeaderEdit::handle_other_keys(gkey& key) { + gkey kk; + + if(key < KK_Commands) { + key = key_tolower(key); + kk = SearchKey(key, HeaderKey, HeaderKeys); + if(kk) + key = kk; + } + + if(ProcessAttrs(key) == true) + return true; + switch(key) { - case Key_F10: + case KK_HeaderAddressbook: vcurhide(); - ChgAttrs(NO, msg); lookup_addressbook(msg, get_field(id_to_name)->buf, get_field(id_to_addr)->buf, true); - ChgAttrs(YES, msg); get_field(id_to_name)->draw(); get_field(id_to_addr)->draw(); current->update(); vcurshow(); - break; - case Key_S_F10: + return true; + + case KK_HeaderLookup: { Addr addr,addr2; INam buf; @@ -110,6 +121,7 @@ bool GMsgHeaderEdit::handle_other_keys(gkey& key) { } } return true; + default: if(PlayMacro(key, 0)) return true; @@ -414,7 +426,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) { break; } - ChgAttrs(true, msg); + ChgAttrs(YES, msg); whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL); vcurshow(); @@ -430,7 +442,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) { hedit.run(H_Header); vcurhide(); - ChgAttrs(false, msg); + ChgAttrs(NO, msg); if(not hedit.dropped and not gkbd.quitall) { diff --git a/golded3/gekeys.h b/golded3/gekeys.h index 3fd1d0b..570d522 100644 --- a/golded3/gekeys.h +++ b/golded3/gekeys.h @@ -304,19 +304,58 @@ const gkey KK_ReadToggleStyles = 0xFF9B; const gkey KK_ReadToggleTwits = 0xFF9C; const gkey KK_ReadTouchNetscan = 0xFF9D; const gkey KK_ReadTouchSemaphore = 0xFF9E; -const gkey KK_ReadUserbase = 0xFF9F; +const gkey KK_ReadAddressbook = 0xFF9F; const gkey KK_ReadUUDecode = 0xFFA0; const gkey KK_ReadWriteMsg = 0xFFA1; const gkey KK_ReadDirQuoteMsg = 0xFFA2; const gkey KK_ReadMoveDirQuoteMsg = 0xFFA3; -const gkey KK_AreaUndefine = 0xFFB0; -const gkey KK_EditUndefine = 0xFFB1; -const gkey KK_FileUndefine = 0xFFB2; -const gkey KK_ListUndefine = 0xFFB3; -const gkey KK_NodeUndefine = 0xFFB4; -const gkey KK_ReadUndefine = 0xFFB5; -const gkey KK_ZzzzLast = 0xFFB6; +const gkey KK_AddressbookQuit = 0xFFB0; +const gkey KK_AddressbookAdd = 0xFFB1; +const gkey KK_AddressbookSelect = 0xFFB2; +const gkey KK_AddressbookDelete = 0xFFB3; +const gkey KK_AddressbookPack = 0xFFB4; + +const gkey KK_HeaderAddressbook = 0xFFC0; +const gkey KK_HeaderLookup = 0xFFC1; +const gkey KK_HeaderToggleAttrWin = 0xFFC2; +const gkey KK_HeaderClearAttrib = 0xFFC3; +const gkey KK_HeaderToggleReserved = 0xFFC4; +const gkey KK_HeaderToggleGroupmsg = 0xFFC5; +const gkey KK_HeaderToggleScanned = 0xFFC6; +const gkey KK_HeaderToggleFile = 0xFFC7; +const gkey KK_HeaderToggleArcsent = 0xFFC8; +const gkey KK_HeaderToggleCrash = 0xFFC9; +const gkey KK_HeaderToggleDirect = 0xFFCA; +const gkey KK_HeaderToggleDelsent = 0xFFCB; +const gkey KK_HeaderToggleFreq = 0xFFCC; +const gkey KK_HeaderToggleZonegate = 0xFFCD; +const gkey KK_HeaderToggleHold = 0xFFCE; +const gkey KK_HeaderToggleImm = 0xFFCF; +const gkey KK_HeaderToggleTransit = 0xFFD0; +const gkey KK_HeaderToggleKill = 0xFFD1; +const gkey KK_HeaderToggleLocked = 0xFFD2; +const gkey KK_HeaderToggleRetrecreq= 0xFFD3; +const gkey KK_HeaderToggleRetrec = 0xFFD4; +const gkey KK_HeaderToggleOrphan = 0xFFD5; +const gkey KK_HeaderTogglePvt = 0xFFD6; +const gkey KK_HeaderToggleAudit = 0xFFD7; +const gkey KK_HeaderToggleReceived = 0xFFD8; +const gkey KK_HeaderToggleSent = 0xFFD9; +const gkey KK_HeaderToggleTrunc = 0xFFDA; +const gkey KK_HeaderToggleUpdreq = 0xFFDB; +const gkey KK_HeaderToggleHubhost = 0xFFDC; +const gkey KK_HeaderToggleLocal = 0xFFDD; +const gkey KK_HeaderToggleXmail = 0xFFDE; +const gkey KK_HeaderToggleCfmrecreq= 0xFFDF; + +const gkey KK_AreaUndefine = 0xFFE0; +const gkey KK_EditUndefine = 0xFFE1; +const gkey KK_FileUndefine = 0xFFE2; +const gkey KK_ListUndefine = 0xFFE3; +const gkey KK_NodeUndefine = 0xFFE4; +const gkey KK_ReadUndefine = 0xFFE5; +const gkey KK_ZzzzLast = 0xFFE6; // ------------------------------------------------------------------ @@ -329,6 +368,8 @@ const int KT_M = 8; // Msg lister const int KT_N = 16; // Node browser const int KT_R = 32; // Reader (+ external utils) const int KT_F = 64; // File browser +const int KT_B = 128; // Addressbook browser +const int KT_H = 256; // Header editor // ------------------------------------------------------------------ diff --git a/golded3/gemenu.cpp b/golded3/gemenu.cpp index aec5acd..89892d4 100644 --- a/golded3/gemenu.cpp +++ b/golded3/gemenu.cpp @@ -433,51 +433,145 @@ static void toggle_dispattrwindow() { // ------------------------------------------------------------------ -void ChgAttrs(int mode, GMsg* __msg) { +bool ProcessAttrs(gkey &key) { - static KBnd* k1; + switch(key) { + case KK_HeaderToggleScanned: + toggle_scanned(); + return true; + + case KK_HeaderToggleGroupmsg: + toggle_groupmsg(); + return true; + + case KK_HeaderToggleZonegate: + toggle_zonegate(); + return true; + + case KK_HeaderToggleHubhost: + toggle_hubhost(); + return true; + + case KK_HeaderToggleRetrecreq: + toggle_retrecreq(); + return true; + + case KK_HeaderToggleCrash: + toggle_crash(); + return true; + + case KK_HeaderToggleLocked: + toggle_locked(); + return true; + + case KK_HeaderToggleReceived: + toggle_received(); + return true; + + case KK_HeaderToggleLocal: + toggle_local(); + return true; + + case KK_HeaderToggleRetrec: + toggle_retrec(); + return true; + + case KK_HeaderToggleFreq: + toggle_freq(); + return true; + + case KK_HeaderToggleImm: + toggle_imm(); + return true; + + case KK_HeaderToggleAttrWin: + toggle_dispattrwindow(); + return true; + + case KK_HeaderToggleArcsent: + toggle_arcsent(); + return true; + + case KK_HeaderToggleHold: + toggle_hold(); + return true; + + case KK_HeaderToggleAudit: + toggle_audit(); + return true; + + case KK_HeaderToggleXmail: + toggle_xmail(); + return true; + + case KK_HeaderToggleTrunc: + toggle_trunc(); + return true; + + case KK_HeaderToggleUpdreq: + toggle_updreq(); + return true; + + case KK_HeaderClearAttrib: + clear_attrib(); + return true; + + case KK_HeaderToggleKill: + toggle_kill(); + return true; + + case KK_HeaderToggleTransit: + toggle_transit(); + return true; + + case KK_HeaderToggleCfmrecreq: + toggle_cfmrecreq(); + return true; + + case KK_HeaderToggleOrphan: + toggle_orphan(); + return true; + + case KK_HeaderToggleFile: + toggle_file(); + return true; + + case KK_HeaderToggleDelsent: + toggle_delsent(); + return true; + + case KK_HeaderToggleDirect: + toggle_direct(); + return true; + + case KK_HeaderToggleReserved: + toggle_reserved(); + return true; + + case KK_HeaderTogglePvt: + toggle_pvt(); + return true; + + case KK_HeaderToggleSent: + toggle_sent(); + return true; + } + return false; +} + +// ------------------------------------------------------------------ + +void ChgAttrs(int mode, GMsg* __msg) { if(mode) { MenuMsgPtr = __msg; if(EDIT->HeaderAttrs() or (mode == ALWAYS)) DispAttrWindow(true); - k1 = chgonkey(NULL); - setonkey(Key_A_F1, toggle_dispattrwindow, 0); - setonkey(Key_A_1, toggle_reserved , 0); - setonkey(Key_A_2, toggle_groupmsg , 0); - setonkey(Key_A_4, toggle_scanned , 0); - setonkey(Key_A_A, toggle_file , 0); - setonkey(Key_A_B, toggle_arcsent , 0); - setonkey(Key_A_C, toggle_crash , 0); - setonkey(Key_A_D, toggle_direct , 0); - setonkey(Key_A_E, toggle_delsent , 0); - setonkey(Key_A_F, toggle_freq , 0); - setonkey(Key_A_G, toggle_zonegate , 0); - setonkey(Key_A_H, toggle_hold , 0); - setonkey(Key_A_I, toggle_imm , 0); - setonkey(Key_A_J, toggle_transit , 0); - setonkey(Key_A_K, toggle_kill , 0); - setonkey(Key_A_L, toggle_locked , 0); - setonkey(Key_A_M, toggle_retrecreq , 0); - setonkey(Key_A_N, toggle_retrec , 0); - setonkey(Key_A_O, toggle_orphan , 0); - setonkey(Key_A_P, toggle_pvt , 0); - setonkey(Key_A_Q, toggle_audit , 0); - setonkey(Key_A_R, toggle_received , 0); - setonkey(Key_A_S, toggle_sent , 0); - setonkey(Key_A_T, toggle_trunc , 0); - setonkey(Key_A_U, toggle_updreq , 0); - setonkey(Key_A_V, toggle_hubhost , 0); - setonkey(Key_A_W, toggle_local , 0); - setonkey(Key_A_X, toggle_xmail , 0); - setonkey(Key_A_Y, toggle_cfmrecreq , 0); - setonkey(Key_A_Z, clear_attrib , 0); } else { DispAttrWindow(false); freonkey(); - chgonkey(k1); } } @@ -490,9 +584,23 @@ void AskAttributes(GMsg* __msg) { update_statusline(LNG->ChangeAttrs); whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL); whelppcat(H_Attributes); - getxch(); + + gkey key; + do { + gkey kk; + + key = getxch(); + if(key < KK_Commands) { + key = key_tolower(key); + kk = SearchKey(key, HeaderKey, HeaderKeys); + if(kk) + key = kk; + } + } + while(ProcessAttrs(key) == true); + whelpop(); - ChgAttrs(false, __msg); + ChgAttrs(NO, __msg); } diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index 4c338da..3f850b4 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -31,10 +31,6 @@ extern GMsg* reader_msg; -static GMsg* MLstMsgPtr; -static GMsg* mlstmsg = NULL; -static uint msgmark2; -static MLst* mlst; static int mlst_bysiz; static int mlst_tosiz; static int mlst_resiz; @@ -71,37 +67,206 @@ inline void mlst_with_date(int with_date) { // ------------------------------------------------------------------ -static void mlst_dodelayed(PInf* p) { - - // Update header and statusline +class GMsgList : public gwinpick { - if(AA->Msglistheader()) { - AA->LoadMsg(MLstMsgPtr, mlst[p->pos].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); - mlst[p->pos].goldmark = goldmark; - int mlstwh = whandle(); - HeaderView->Use(AA, MLstMsgPtr); - HeaderView->Paint(); - wactiv_(mlstwh); - } + gwindow window; + GMsg msg; + vector mlst; + uint msgmark2; - if(CFG->switches.get(msglistviewsubj)) - wtitle(mlst[p->pos].re, TCENTER|TBOTTOM, p->tattr); + void open(); // Called after window is opened + void close(); // Called after window is closed + void update_title(); + void do_delayed(); + void print_line(uint idx, uint pos, bool isbar); + bool handle_key(); // Handles keypress + void ReadMlst(int n); - if(CFG->switches.get(msglistpagebar)) - wscrollbar(W_VERT, p->maxidx+1, p->maxidx, p->idx); +public: - update_statuslinef(LNG->MsgLister, p->idx+1, p->maxidx+1, p->maxidx-p->idx); + void Run(); + + GMsgList() { memset(&msg, 0, sizeof(GMsg)); }; + ~GMsgList() { ResetMsg(&msg); }; +}; + + +// ------------------------------------------------------------------ + +void GMsgList::open() { + + window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, wattr, sbattr); + update_title(); + center(CFG->displistcursor); } // ------------------------------------------------------------------ -static void mlst_dispbuf(char* abuf, MLst* ml) { +void GMsgList::close() { + window.close(); +} + + +// ------------------------------------------------------------------ + +void GMsgList::ReadMlst(int n) { + + MLst* ml = &mlst[n]; + + if(ml->initialized) + return; + + ml->high = 0; + + strcpy(ml->marks, " "); + + ml->msgno = AA->Msgn.CvtReln(n + 1); + + if(AA->bookmark == AA->Msgn.CvtReln(n + 1)) { + ml->marks[0] = MMRK_BOOK; + ml->high |= MLST_HIGH_BOOK; + } + + if(AA->Mark.Count()) { + if(AA->Mark.Find(ml->msgno)) { + ml->marks[1] = MMRK_MARK; + ml->high |= MLST_HIGH_MARK; + } + } + + if(AA->Msglistfast()) { + AA->LoadHdr(&msg, ml->msgno); + } + else { + AA->LoadMsg(&msg, ml->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); + } + ml->goldmark = goldmark; + + for(vector::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) { + if(strieql(msg.By(), x->name)) { + ml->high |= MLST_HIGH_FROM; + msg.attr.fmu1(); + } + if(strieql(msg.to, x->name)) { + ml->high |= MLST_HIGH_TO; + msg.attr.tou1(); + } + } + if(strieql(msg.to, AA->Internetaddress())) { + ml->high |= MLST_HIGH_TO; + msg.attr.tou1(); + } + + // Highlight FROM if local + if(CFG->switches.get(displocalhigh) and msg.attr.loc()) + ml->high |= MLST_HIGH_FROM; + + // Highlight if unread + if(msg.timesread == 0 and CFG->switches.get(highlightunread)) + ml->high |= MLST_HIGH_UNREAD; + + // Highlight if unsent + if(msg.attr.uns()and not msg.attr.rcv() and not msg.attr.del()) + ml->high |= MLST_HIGH_UNSENT; + + ml->written = msg.written; + ml->arrived = msg.arrived; + ml->received = msg.received; + strcpy(ml->by, msg.By()); + strcpy(ml->to, msg.To()); + strcpy(ml->re, msg.re); +} + + +// ------------------------------------------------------------------ + +void GMsgList::do_delayed() { + + // Update header and statusline + if(AA->Msglistheader()) { + ReadMlst(index); + AA->LoadMsg(&msg, mlst[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); + mlst[index].goldmark = goldmark; + int mlstwh = whandle(); + HeaderView->Use(AA, &msg); + HeaderView->Paint(); + wactiv_(mlstwh); + } + + if(CFG->switches.get(msglistviewsubj)) + wtitle(msg.re, TCENTER|TBOTTOM, tattr); + + if(CFG->switches.get(msglistpagebar)) + wscrollbar(W_VERT, maximum_index+1, maximum_index, index); + + update_statuslinef(LNG->MsgLister, index+1, maximum_index+1, maximum_index-index); +} + + +// ------------------------------------------------------------------ + +void GMsgList::update_title() { + + int bycol = 8; + int tocol = bycol + mlst_bysiz + 1 + fldadd1; + int recol = tocol + mlst_tosiz + 1 + fldadd1; + int dtcol = recol + mlst_resiz + 1 + fldadd2; + if(AA->Msglistwidesubj()) + recol = tocol; + + window.title(NULL, tattr, TCENTER); + window.message(CFG->switches.get(disprealmsgno) ? LNG->MsgReal : LNG->Msg, TP_BORD, 3, tattr); + window.message(LNG->FromL, TP_BORD, bycol, tattr); + if(not AA->Msglistwidesubj()) + window.message(LNG->ToL, TP_BORD, tocol, tattr); + window.message(LNG->SubjL, TP_BORD, recol, tattr); + switch(AA->Msglistdate()) { + case MSGLISTDATE_WRITTEN: window.message(LNG->Written, TP_BORD, dtcol, tattr); break; + case MSGLISTDATE_ARRIVED: window.message(LNG->Arrived, TP_BORD, dtcol, tattr); break; + case MSGLISTDATE_RECEIVED: window.message(LNG->Received, TP_BORD, dtcol, tattr); break; + } +} + + +// ------------------------------------------------------------------ + +void GMsgList::print_line(uint idx, uint pos, bool isbar) { + + int bycol = 7; + int tocol = bycol + mlst_bysiz + 1 + fldadd1; int bysiz = mlst_bysiz + fldadd1; int tosiz = mlst_tosiz + fldadd1; int resiz = mlst_resiz + fldadd2; + ReadMlst(idx); + MLst* ml = &mlst[idx]; + + int wattr_, hattr_, mattr_; + if(isbar) { + wattr_ = sattr; + hattr_ = sattr; + mattr_ = sattr; + } + else if(ml->high & MLST_HIGH_UNSENT) { + wattr_ = C_MENUW_UNSENT; + hattr_ = C_MENUQ_UNSENTHIGH; + mattr_ = hattr; + } + else if(ml->high & MLST_HIGH_UNREAD) { + wattr_ = C_MENUW_UNREAD; + hattr_ = C_MENUQ_UNREADHIGH; + mattr_ = hattr; + } + else { + wattr_ = wattr; + hattr_ = hattr; + mattr_ = hattr; + } + + char buf[256]; + if(AA->Msglistwidesubj()) { resiz += tosiz + 1; tosiz = 0; @@ -123,7 +288,7 @@ static void mlst_dispbuf(char* abuf, MLst* ml) { else *dbuf = NUL; sprintf(nbuf, "%5lu", CFG->switches.get(disprealmsgno) ? ml->msgno : AA->Msgn.ToReln(ml->msgno)); - sprintf(abuf, "%-5.5s%s%-*.*s %-*.*s%s%-*.*s %s", + sprintf(buf, "%-5.5s%s%-*.*s %-*.*s%s%-*.*s %s", nbuf, ml->marks, bysiz, bysiz, ml->by, tosiz, tosiz, ml->to, @@ -131,49 +296,15 @@ static void mlst_dispbuf(char* abuf, MLst* ml) { resiz, resiz, ml->re, dbuf ); -} - -// ------------------------------------------------------------------ - -static void mlst_dispit(PInf* p, uint pos, int type) { - - int bycol = 7; - int tocol = bycol + mlst_bysiz + 1 + fldadd1; - int bysiz = mlst_bysiz + fldadd1; - int tosiz = mlst_tosiz + fldadd1; - - MLst* ml = &mlst[pos]; - - int wattr, hattr, mattr=p->hattr; - if(type == PICK_BAR) { - wattr = p->sattr; - hattr = p->sattr; - mattr = p->sattr; - } - else if(ml->high & MLST_HIGH_UNSENT) { - wattr = C_MENUW_UNSENT; - hattr = C_MENUQ_UNSENTHIGH; - } - else if(ml->high & MLST_HIGH_UNREAD) { - wattr = C_MENUW_UNREAD; - hattr = C_MENUQ_UNREADHIGH; - } - else { - wattr = p->wattr; - hattr = p->hattr; - } - - char buf[256]; - mlst_dispbuf(buf, ml); - wprints(pos, 0, wattr, buf); + window.prints(pos, 0, wattr_, buf); if(ml->high & (MLST_HIGH_BOOK|MLST_HIGH_MARK)) - wprints(pos, 5, mattr, ml->marks); + window.prints(pos, 5, mattr_, ml->marks); if(ml->high & MLST_HIGH_FROM) - wprintns(pos, bycol, hattr, ml->by, bysiz); + window.printns(pos, bycol, hattr_, ml->by, bysiz); if((ml->high & MLST_HIGH_TO) and not AA->Msglistwidesubj()) - wprintns(pos, tocol, hattr, ml->to, tosiz); + window.printns(pos, tocol, hattr_, ml->to, tosiz); goldmark = ml->goldmark; } @@ -181,408 +312,131 @@ static void mlst_dispit(PInf* p, uint pos, int type) { // ------------------------------------------------------------------ -static void mlst_disp(PInf* p) { +bool GMsgList::handle_key() { - mlst_dispit(p, p->pos, p->type); -} - - -// ------------------------------------------------------------------ - -static void mlst_get_mlst(MLst* ml, PInf* p, int n) { - - GMsg* msg = mlstmsg; - - ml->high = 0; - - strcpy(ml->marks, " "); - - ml->msgno = AA->Msgn.CvtReln(p->idx + n + 1); - - if(AA->bookmark == AA->Msgn.CvtReln(p->idx + n + 1)) { - ml->marks[0] = MMRK_BOOK; - ml->high |= MLST_HIGH_BOOK; - } - - if(AA->Mark.Count()) { - if(AA->Mark.Find(ml->msgno)) { - ml->marks[1] = MMRK_MARK; - ml->high |= MLST_HIGH_MARK; - } - } - - if(AA->Msglistfast()) { - AA->LoadHdr(msg, ml->msgno); - } - else { - AA->LoadMsg(msg, ml->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar), GMSG_COPY); // do quick load - } - ml->goldmark = goldmark; - - for(vector::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) { - if(strieql(msg->By(), x->name)) { - ml->high |= MLST_HIGH_FROM; - msg->attr.fmu1(); - } - if(strieql(msg->to, x->name)) { - ml->high |= MLST_HIGH_TO; - msg->attr.tou1(); - } - } - if(strieql(msg->to, AA->Internetaddress())) { - ml->high |= MLST_HIGH_TO; - msg->attr.tou1(); - } - - // Highlight FROM if local - if(CFG->switches.get(displocalhigh) and msg->attr.loc()) - ml->high |= MLST_HIGH_FROM; - - // Highlight if unread - if(msg->timesread == 0 and CFG->switches.get(highlightunread)) - ml->high |= MLST_HIGH_UNREAD; - - // Highlight if unsent - if(msg->attr.uns()and not msg->attr.rcv() and not msg->attr.del()) - ml->high |= MLST_HIGH_UNSENT; - - ml->written = msg->written; - ml->arrived = msg->arrived; - ml->received = msg->received; - strcpy(ml->by, msg->By()); - strcpy(ml->to, msg->To()); - strcpy(ml->re, msg->re); -} - - -// ------------------------------------------------------------------ - -static void mlst_page(PInf* p) { - - char linebuf[200]; - vchar vlinebuf[200]; - uint m, n; - - if(not AA->Msglistfast()) - w_info(LNG->Wait); - - p->idx -= p->pos; - m = p->maxidx - p->idx; - - for(n=0; n<=p->maxpos and n<=m; n++) - mlst_get_mlst(&mlst[n], p, n); - - if(not AA->Msglistfast()) - w_info(NULL); - - for(n=0; n<=p->maxpos and n<=m; n++) - mlst_dispit(p, n, (n==p->pos) ? PICK_BAR : PICK_DISP); - - for(int c = 0; c < MAXCOL-2; c++) - vlinebuf[c] = _box_table(p->btype, 1); - vlinebuf[MAXCOL-2] = NUL; - - if(n <= p->maxpos or (p->maxpos == p->maxidx and p->maxpos < (p->height-3))) - wprintvs(n, 0, p->wattr|ACSET, vlinebuf); - - memset(linebuf, ' ', MAXCOL-2); - linebuf[MAXCOL-2] = NUL; - - for(++n; n<=p->height-2; n++) - wprints(n, 0, p->wattr, linebuf); - p->idx += p->pos; -} - - -// ------------------------------------------------------------------ - -static void mlst_center(PInf* p) { - - uint botroom = p->maxidx - p->idx; - - switch(CFG->displistcursor) { - case LIST_TOP: - if(botroom > p->maxpos) - p->pos = 0; - else - p->pos = p->maxpos - botroom; - break; - case LIST_NEARTOP: - { - uint room; - uint toproom = p->idx; - if(toproom > (p->maxpos/4)) { - if(botroom > (p->maxpos/4)) - room = p->maxpos/4; - else if(botroom) - room = p->maxpos - botroom; - else - room = p->maxpos; - } - else - room = toproom; - p->pos = room; - } - break; - case LIST_MIDDLE: - { - uint room; - uint toproom = p->idx; - if(toproom > (p->maxpos/2)) { - if(botroom > (p->maxpos/2)) - room = p->maxpos/2; - else if(botroom) - room = p->maxpos - botroom; - else - room = p->maxpos; - } - else - room = toproom; - p->pos = room; - } - break; - case LIST_NEARBOTTOM: - { - uint room; - uint toproom = p->idx; - if(toproom > 3*(p->maxpos/4)) { - if(botroom > 3*(p->maxpos/4)) - room = 3*(p->maxpos/4); - else if(botroom) - room = p->maxpos - botroom; - else - room = p->maxpos; - } - else - room = toproom; - p->pos = room; - } - break; - case LIST_BOTTOM: - p->pos = p->maxpos; - break; - } - mlst_page(p); -} - - -// ------------------------------------------------------------------ - -static void mlst_scroll(PInf* p, int direction) { - - if(direction == SUP) { - memmove(&mlst[0], &mlst[1], p->maxpos*sizeof(MLst)); - mlst_get_mlst(&mlst[p->maxpos], p, 0); - } - else { - memmove(&mlst[1], &mlst[0], p->maxpos*sizeof(MLst)); - mlst_get_mlst(&mlst[0], p, 0); - } - wscroll(1, direction); -} - - -// ------------------------------------------------------------------ - -static void mlst_title(PInf* p) { - - int bycol = 8; - int tocol = bycol + mlst_bysiz + 1 + fldadd1; - int recol = tocol + mlst_tosiz + 1 + fldadd1; - int dtcol = recol + mlst_resiz + 1 + fldadd2; - if(AA->Msglistwidesubj()) - recol = tocol; - - wtitle(NULL, TCENTER, p->tattr); - wmessage(CFG->switches.get(disprealmsgno) ? LNG->MsgReal : LNG->Msg, TP_BORD, 3, p->tattr); - wmessage(LNG->FromL, TP_BORD, bycol, p->tattr); - if(not AA->Msglistwidesubj()) - wmessage(LNG->ToL, TP_BORD, tocol, p->tattr); - wmessage(LNG->SubjL, TP_BORD, recol, p->tattr); - switch(AA->Msglistdate()) { - case MSGLISTDATE_WRITTEN: wmessage(LNG->Written, TP_BORD, dtcol, p->tattr); break; - case MSGLISTDATE_ARRIVED: wmessage(LNG->Arrived, TP_BORD, dtcol, p->tattr); break; - case MSGLISTDATE_RECEIVED: wmessage(LNG->Received, TP_BORD, dtcol, p->tattr); break; - } -} - - -// ------------------------------------------------------------------ - -static void mlst_open(PInf* p) { - - wopen_(p->row, p->column, p->height, p->width, p->btype, p->battr, p->wattr, p->sbattr); - mlst_title(p); - mlst_center(p); -} - - -// ------------------------------------------------------------------ - -static void mlst_close(PInf* p) { - - NW(p); - wclose(); -} - - -// ------------------------------------------------------------------ - -static int mlst_dokey(PInf* p, gkey* keycode) { - - int tpos; - gkey key, kk; - uint temp, tmpmsgno; - - key = *keycode; - *keycode = 0; + gkey kk; if(key < KK_Commands) { - key = key_tolower(key); + // See if it's a listkey kk = SearchKey(key, ListKey, ListKeys); if(kk) key = kk; - } - - // See if it's a listkey - switch(key) { - case KK_ListGotoPrev: - case KK_ListGotoNext: - case KK_ListGotoFirst: - case KK_ListGotoLast: - case KK_ListAskExit: - case KK_ListQuitNow: - case KK_ListAbort: - case KK_ListSelect: - case KK_ListToggleMark: - case KK_ListToggleBookMark: - case KK_ListGotoBookMark: - case KK_ListMarkingOptions: - case KK_ListDosShell: - case KK_ListMacro: - case Key_0: - case Key_1: - case Key_2: - case Key_3: - case Key_4: - case Key_5: - case Key_6: - case Key_7: - case Key_8: - case Key_9: - break; - - // If not a listkey, see if it matches a readkey - default: + else { + // If not a listkey, see if it matches a readkey if(not IsMacro(key, KT_M)) { kk = SearchKey(key, ReadKey, ReadKeys); if(kk) key = kk; } + } } + ReadMlst(index); + switch(key) { case KK_ListGotoPrev: - *keycode = Key_Up; + key = Key_Up; + default_handle_key(); break; case KK_ListGotoNext: - *keycode = Key_Dwn; + listgotonext: + key = Key_Dwn; + default_handle_key(); break; case KK_ListGotoFirst: - *keycode = Key_Home; + key = Key_Home; + default_handle_key(); break; case KK_ListGotoLast: - *keycode = Key_End; + key = Key_End; + default_handle_key(); break; case KK_ListAskExit: { GMenuQuit MenuQuit; - p->aborted = gkbd.quitall = (MenuQuit.Run()); - if(gkbd.quitall) { + aborted = gkbd.quitall = (MenuQuit.Run()); + if(gkbd.quitall) AA->bookmark = AA->Msgn.CvtReln(msgmark2); - return NO; - } } break; case KK_ListQuitNow: - p->aborted = gkbd.quitall = true; - AA->bookmark = AA->Msgn.CvtReln(msgmark2); - return NO; + gkbd.quitall = true; + ///////////////// Drop Through case KK_ListAbort: + aborted = true; AA->bookmark = AA->Msgn.CvtReln(msgmark2); - p->aborted = YES; ///////////////// Drop Through case KK_ListSelect: - return NO; + return false; case KK_ListToggleMark: - temp = AA->Mark.Find(mlst[p->pos].msgno); - if(temp) { - AA->Mark.DelReln(temp); - mlst[p->pos].marks[1] = ' '; - mlst[p->pos].high &= ~MLST_HIGH_MARK; + { + ulong temp = AA->Mark.Find(mlst[index].msgno); + if(temp) { + AA->Mark.DelReln(temp); + } + else { + AA->Mark.Add(mlst[index].msgno); + } } - else { - AA->Mark.Add(mlst[p->pos].msgno); - mlst[p->pos].marks[1] = MMRK_MARK; - mlst[p->pos].high |= MLST_HIGH_MARK; - } - if(p->idx < p->maxidx) { - mlst_disp(p); - *keycode = Key_Dwn; - } - break; + goto listgotonext; case KK_ListToggleBookMark: - if(AA->bookmark == mlst[p->pos].msgno) { - mlst[p->pos].marks[0] = ' '; + if(AA->bookmark == mlst[index].msgno) { + mlst[index].marks[0] = ' '; AA->bookmark = 0; - mlst[p->pos].high &= ~MLST_HIGH_BOOK; - mlst_disp(p); + mlst[index].high &= ~MLST_HIGH_BOOK; + display_bar(); } else { - temp = AA->Msgn.ToReln(AA->bookmark-1); - AA->bookmark = mlst[p->pos].msgno; - mlst[p->pos].marks[0] = MMRK_BOOK; - mlst[p->pos].high |= MLST_HIGH_BOOK; - mlst_disp(p); - if(temp) { - tpos = p->pos; - p->pos += (temp - p->idx); - if(p->pos <= p->maxpos) { - mlst[p->pos].marks[0] = ' '; - mlst[p->pos].high &= ~MLST_HIGH_BOOK; - mlst_disp(p); + long prevbm = AA->Msgn.ToReln(AA->bookmark-1); + long newbm = index; + AA->bookmark = mlst[index].msgno; + mlst[index].marks[0] = MMRK_BOOK; + mlst[index].high |= MLST_HIGH_BOOK; + display_bar(); + if(prevbm) { + if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { + ReadMlst(prevbm); + mlst[prevbm].marks[0] = ' '; + mlst[prevbm].high &= ~MLST_HIGH_BOOK; + index = prevbm; + position += prevbm - newbm; + display_line(); + index = newbm; + position -= prevbm - newbm; } - p->pos = tpos; } } break; case KK_ListGotoBookMark: if(AA->bookmark) { - tpos = p->pos + ((AA->Msgn.ToReln(AA->bookmark-1)) - p->idx); - temp = p->idx + 1; - p->idx = AA->Msgn.ToReln(AA->bookmark-1); - AA->bookmark = AA->Msgn.CvtReln(temp); - if(tpos >= 0 and (uint)tpos <= p->maxpos) { - mlst[tpos].marks[0] = ' '; - mlst[tpos].high &= ~MLST_HIGH_BOOK; - mlst[p->pos].marks[0] = MMRK_BOOK; - mlst[p->pos].high |= MLST_HIGH_BOOK; - mlst_disp(p); - p->pos = tpos; - mlst_disp(p); + long prevbm = AA->Msgn.ToReln(AA->bookmark-1); + long newbm = index; + index = prevbm; + AA->bookmark = mlst[newbm].msgno; + if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { + mlst[newbm].marks[0] = MMRK_BOOK; + mlst[newbm].high |= MLST_HIGH_BOOK; + index = newbm; + display_line(); + index = prevbm; + ReadMlst(index); + mlst[index].marks[0] = ' '; + mlst[index].high &= ~MLST_HIGH_BOOK; + position += prevbm - newbm; + display_bar(); } else - mlst_center(p); + center(CFG->displistcursor); } else SayBibi(); @@ -591,11 +445,11 @@ static int mlst_dokey(PInf* p, gkey* keycode) { case KK_ListMarkingOptions: { uint lrbak = AA->lastread(); - AA->set_lastread(p->idx + 1); - MLstMsgPtr->msgno = AA->Msgn.CvtReln(AA->lastread()); - MarkMsgs(MLstMsgPtr); + AA->set_lastread(index + 1); + msg.msgno = AA->Msgn.CvtReln(AA->lastread()); + MarkMsgs(&msg); AA->set_lastread(lrbak); - mlst_page(p); + update(); } break; @@ -605,39 +459,19 @@ static int mlst_dokey(PInf* p, gkey* keycode) { case KK_ListToggleWideSubj: AA->ToggleMsglistwidesubj(); - mlst_title(p); - mlst_page(p); + update_title(); + update(); break; case KK_ListToggleDate: AA->NextMsglistdate(); mlst_with_date(AA->Msglistdate()); - mlst_title(p); - mlst_page(p); - break; - - case Key_0: - case Key_1: - case Key_2: - case Key_3: - case Key_4: - case Key_5: - case Key_6: - case Key_7: - case Key_8: - case Key_9: - case KK_ReadGotoMsgno: - tmpmsgno = p->idx; - reader_keycode = key; - GotoMsgno(); - if(AA->lastread()-1 != tmpmsgno) { - p->idx = AA->lastread()-1; - mlst_center(p); - } + update_title(); + update(); break; case KK_ReadMessageList: - mlst_center(p); + center(CFG->displistcursor); break; case Key_Tick: @@ -649,64 +483,44 @@ static int mlst_dokey(PInf* p, gkey* keycode) { default: if(not PlayMacro(key, KT_M)) { - switch(key) { - case KK_ReadNewArea: - p->aborted = true; - } if(gkbd.kbuf == NULL) kbput(key); - return NO; + switch(key) { + case KK_ListAbort: + case KK_ReadNewArea: + aborted = true; + } + return false; } } - return YES; + return true; } // ------------------------------------------------------------------ -uint MsgBrowser(GMsg* msg) { +void GMsgList::Run() { - GFTRK("MsgBrowser"); + ypos = AA->Msglistheader() ? 6 : 1; // Window Starting Row + xpos = 0; // Window Starting Column + ylen = MAXROW-3-ypos; // Window Height + xlen = MAXCOL-2; // Window Width + btype = W_BMENU; // Window Border Type + battr = C_MENUB; // Window Border Color + wattr = C_MENUW; // Window Color + tattr = C_MENUT; // Window Title Color + sattr = C_MENUS; // Window Selection Bar Color + hattr = C_MENUQ; // Window Highlight Color + sbattr = C_MENUPB; // Window Scrollbar Color + title = LNG->ThreadlistTitle; // Window Title + helpcat = H_MessageBrowser; // Window Help Category + listwrap = CFG->switches.get(displistwrap); - Pick pick; - PInf p; - - memset(&p, 0, sizeof(PInf)); - memset(&pick, 0, sizeof(Pick)); - p.btype = W_BMENU; - p.battr = C_MENUB; - p.wattr = C_MENUW; - p.sattr = C_MENUS; - p.tattr = C_MENUT; - p.hattr = C_MENUQ; - p.sbattr = C_MENUPB; - p.row = AA->Msglistheader() ? 6 : 1; - p.height = MAXROW-p.row-1; - p.width = MAXCOL; - p.helpcat = H_MessageBrowser; - p.delay = 150; // milliseconds - p.listwrap = CFG->switches.get(displistwrap); - - pick.open = mlst_open; - pick.close = mlst_close; - pick.disp = mlst_disp; - pick.page = mlst_page; - pick.scroll = mlst_scroll; - pick.dokey = mlst_dokey; - pick.dodelayed = mlst_dodelayed; - - p.maxidx = AA->Msgn.Count()-1; - p.maxpos = MinV((uint)(p.height-3), p.maxidx); - p.aborted = NO; - - p.idx = AA->Msgn.ToReln(msg->msgno)-1; + index = AA->Msgn.ToReln(reader_msg->msgno)-1; + minimum_index = 0; + maximum_index = AA->Msgn.Count()-1; msgmark2 = AA->Msgn.ToReln(AA->bookmark); - MLstMsgPtr = msg; - - mlst = (MLst*)throw_calloc(p.maxpos+2, sizeof(MLst)); - mlstmsg = (GMsg*)throw_calloc(1, sizeof(GMsg)); - if(AA->Msglistdate() != MSGLISTDATE_NONE) { if(AA->Msglistdate() != MSGLISTDATE_WRITTEN) { if(AA->ishudson() or AA->isgoldbase() or AA->ispcboard()) @@ -721,22 +535,24 @@ uint MsgBrowser(GMsg* msg) { fldadd1 = (MAXCOL-80)/3; fldadd2 = (MAXCOL-80) - (fldadd1*2); - _in_msglist = true; + mlst.clear(); - Picker(&p, &pick); + MLst dummy_mlst; + dummy_mlst.initialized = false; + for(uint i=0; iset_lastread(AA->Msgn.ToReln(mlst[index].msgno)); + } } @@ -745,10 +561,10 @@ uint MsgBrowser(GMsg* msg) { void MessageBrowse() { if(AA->Msgn.Count()) { - uint temp = AA->lastread(); - AA->set_lastread(MsgBrowser(reader_msg)); - if(AA->lastread() == 0) - AA->set_lastread(temp); + GMsgList p; + _in_msglist = true; + p.Run(); + _in_msglist = false; if(AA->PMrk.Tags() == 0) AA->isreadpm = false; if(AA->Mark.Count() == 0) @@ -761,8 +577,6 @@ void MessageBrowse() { // ------------------------------------------------------------------ -#include - class ThreadEntry { public: @@ -802,7 +616,6 @@ public: GThreadlist() { memset(&msg, 0, sizeof(GMsg)); }; ~GThreadlist() { ResetMsg(&msg); }; - }; @@ -1133,55 +946,21 @@ bool GThreadlist::handle_key() { if(key < KK_Commands) { key = key_tolower(key); + // See if it's a listkey kk = SearchKey(key, ListKey, ListKeys); if(kk) key = kk; - } - - // See if it's a listkey - switch(key) { - case KK_ListGotoPrev: - case KK_ListGotoNext: - case KK_ListGotoFirst: - case KK_ListGotoLast: - case KK_ListAskExit: - case KK_ListQuitNow: - case KK_ListAbort: - case KK_ListSelect: - case KK_ListToggleMark: - case KK_ListToggleBookMark: - case KK_ListGotoBookMark: - case KK_ListMarkingOptions: - case KK_ListDosShell: - case Key_0: - case Key_1: - case Key_2: - case Key_3: - case Key_4: - case Key_5: - case Key_6: - case Key_7: - case Key_8: - case Key_9: - break; - - // If not a listkey, see if it matches a readkey - default: + else { + // If not a listkey, see if it matches a readkey if(not IsMacro(key, KT_M)) { kk = SearchKey(key, ReadKey, ReadKeys); if(kk) key = kk; } + } } switch(key) { - case Key_C_PgUp: - case Key_C_PgDn: - NextThread((key == Key_C_PgDn)); - if(list.size() <= 1) - return false; - center(CFG->displistcursor); - break; case KK_ListGotoPrev: case KK_ListGotoNext: NextThread((key == KK_ListGotoNext)); @@ -1189,8 +968,16 @@ bool GThreadlist::handle_key() { return false; center(CFG->displistcursor); break; - case KK_ListGotoFirst: precursor(); cursor_first(); break; - case KK_ListGotoLast: precursor(); cursor_last(); break; + + case KK_ListGotoFirst: + key = Key_Home; + default_handle_key(); + break; + + case KK_ListGotoLast: + key = Key_End; + default_handle_key(); + break; case KK_ListAskExit: { @@ -1254,7 +1041,7 @@ bool GThreadlist::handle_key() { case KK_ReadNewArea: aborted = true; } - return NO; + return false; } } return true; @@ -1284,8 +1071,7 @@ void GThreadlist::Run() { if(list.size() > 1) run_picker(); - - if(list.size() <= 1) { + else { w_info(LNG->NoThreadlist); waitkeyt(5000); w_info(NULL); diff --git a/golded3/genode.cpp b/golded3/genode.cpp index 938eb93..d991f5c 100644 --- a/golded3/genode.cpp +++ b/golded3/genode.cpp @@ -742,9 +742,6 @@ static int browse_nodelist(GMsg* msg, char* title, int topline) { NodelistBrowser* browser = new NodelistBrowser; throw_new(browser); - if(topline == 0) - ChgAttrs(NO, msg); // Close the attributes menu - browser->btype = W_BMENU; browser->battr = C_MENUB; browser->wattr = C_MENUW; @@ -770,9 +767,6 @@ static int browse_nodelist(GMsg* msg, char* title, int topline) { delete browser; - if(topline == 0) - ChgAttrs(YES, msg); // Turn on the attributes menu again - return (not aborted); } diff --git a/golded3/geprot.h b/golded3/geprot.h index 5411458..e06cc4c 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -183,6 +183,7 @@ void InvalidateControlInfo(GMsg *msg); void DispHeadAttrs(GMsg* msg); void AskAttributes(GMsg* msg); +bool ProcessAttrs(gkey &key); void ChgAttrs(int mode, GMsg* msg); int ChangeAka(); int ChangeCharsIn(); @@ -197,7 +198,6 @@ int ChangeXlatImport(); // ------------------------------------------------------------------ // GEMLST prototypes -uint MsgBrowser(GMsg* msg); void MsgThreadlist(); diff --git a/golded3/geread.cpp b/golded3/geread.cpp index 464c010..bd11b2e 100644 --- a/golded3/geread.cpp +++ b/golded3/geread.cpp @@ -713,7 +713,7 @@ void Reader() { } break; - case KK_ReadUserbase: + case KK_ReadAddressbook: edit_addressbook(msg); break; diff --git a/golded3/geusrbse.cpp b/golded3/geusrbse.cpp index 68dd996..49a5f35 100644 --- a/golded3/geusrbse.cpp +++ b/golded3/geusrbse.cpp @@ -606,11 +606,20 @@ void guserbase::update_screen(bool force) { bool guserbase::handle_key() { + gkey kk; + + if(key < KK_Commands) { + key = key_tolower(key); + kk = SearchKey(key, AddressbookKey, AddressbookKeys); + if(kk) + key = kk; + } + switch(key) { - case Key_Esc: + case KK_AddressbookQuit: aborted = true; return false; - case Key_Ins: // Add new entry + case KK_AddressbookAdd: { clear_entry(&entry); lock(); @@ -629,7 +638,7 @@ bool guserbase::handle_key() { center(CFG->displistcursor); } break; - case Key_Ent: // Select/Edit entry + case KK_AddressbookSelect: if(not select_list) { if(not entry.is_deleted) { lock(); @@ -645,7 +654,7 @@ bool guserbase::handle_key() { aborted = false; return false; } - case Key_Del: // Soft-Delete Entry + case KK_AddressbookDelete: lock(); refresh_maximum_index(); read_entry(index); @@ -654,7 +663,7 @@ bool guserbase::handle_key() { unlock(); update_screen(); break; - case Key_A_P: // Pack Addressbook + case KK_AddressbookPack: pack_addressbook(); index = position = 0; update_screen(); diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index cc3ca5f..6bc37bb 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -256,7 +256,7 @@ void w_progress(int mode, int attr, long pos, long size, const char* title) { goto oops; // Oops, someone forgot to open the window.. if((pos*58/size) != (prev_pos*58/size)) { force_update: - wpropbar(PROP_BARGRAPH, 1, 0, -59, 1, attr, pos, size); + wpropbar(1, 0, 59, attr, pos, size); } prev_pos = pos; break; diff --git a/goldlib/gall/gkbdbase.cpp b/goldlib/gall/gkbdbase.cpp index aa6a40d..e72dc04 100644 --- a/goldlib/gall/gkbdbase.cpp +++ b/goldlib/gall/gkbdbase.cpp @@ -1594,8 +1594,9 @@ int setonkey(gkey keycode, VfvCP func, gkey pass) { gkey key_tolower(gkey __keycode) { - if(isupper(KCodAsc(__keycode))) - return (gkey)(__keycode + 'a' - 'A'); + byte &ascii = KCodAsc(__keycode); + if(isupper(ascii)) + ascii = tolower(ascii); return __keycode; } diff --git a/goldlib/gall/gvidall.h b/goldlib/gall/gvidall.h index 4d8d1b4..7217f79 100644 --- a/goldlib/gall/gvidall.h +++ b/goldlib/gall/gvidall.h @@ -35,13 +35,6 @@ #include #if defined(__USE_NCURSES__) #include -#else -#define ACS_BOARD '°' -#ifndef __linux__ -#define ACS_BLOCK 'Û' -#else -#define ACS_BLOCK ' ' -#endif #endif #if defined(__WIN32__) #include @@ -196,7 +189,7 @@ struct __int10_ah1b_statebuf { #endif #define INTENSE 8 -#if defined(__UNIX__) and not defined(__USE_NCURSES__) +#if defined(__UNIX__) && !defined(__USE_NCURSES__) #define ACSET BLINK #else #define ACSET 0 @@ -345,15 +338,11 @@ public: extern GVid *gvid; -#if defined(__UNIX__) and not defined(__USE_NCURSES__) -extern bool gvid_xterm; -#endif - // ------------------------------------------------------------------ // Box characters table -#if not defined(__USE_NCURSES__) +#if !defined(__USE_NCURSES__) extern char* __box_table[]; #define _box_table(i,j) (__box_table[i][j]) diff --git a/goldlib/gall/gvidbase.cpp b/goldlib/gall/gvidbase.cpp index ed6712e..c01bee0 100644 --- a/goldlib/gall/gvidbase.cpp +++ b/goldlib/gall/gvidbase.cpp @@ -177,7 +177,6 @@ inline gdma gdmaptr(int col, int row) { // ------------------------------------------------------------------ extern int gvid_stdout; -extern bool gvid_xterm; extern const char* gvid_acs_enable; extern const char* gvid_acs_disable; int gvid_last_attr = 0; diff --git a/goldlib/gall/gvidinit.cpp b/goldlib/gall/gvidinit.cpp index c4da9f5..d8273bf 100644 --- a/goldlib/gall/gvidinit.cpp +++ b/goldlib/gall/gvidinit.cpp @@ -92,7 +92,6 @@ GVid *gvid; #elif defined(__UNIX__) int gvid_stdout = -1; -bool gvid_xterm = false; const char* gvid_acs_enable; const char* gvid_acs_disable; @@ -401,26 +400,31 @@ int GVid::detectadapter() { adapter = V_VGA; - #elif defined(__UNIX__) + #elif defined(__linux__) + for(int n=0; n<8; n++) + __box_table[n] = __box_table[8]; + + gvid_acs_enable = "\016"; + gvid_acs_disable = "\017"; + + gvid_stdout = fileno(stdout); + + adapter = V_VGA; + + #elif defined(__UNIX__) // code below should not be normally used... + + bool gvid_xterm = false; const char* term = getenv("TERM"); -#ifndef __linux__ + if(term and strneql(term, "xterm", 5)) { -#endif gvid_xterm = true; for(int n=0; n<8; n++) __box_table[n] = __box_table[8]; -#ifndef __linux__ } -#endif - -#ifndef __linux__ + gvid_acs_enable = gvid_xterm ? "\033)0\033(B\016" : "\033[11m"; gvid_acs_disable = gvid_xterm ? "\033(B\033)B\017" : "\033[10m"; -#else - gvid_acs_enable = gvid_xterm ? "\016" : ""; - gvid_acs_disable = gvid_xterm ? "\017" : ""; -#endif gvid_stdout = fileno(stdout); diff --git a/goldlib/gall/gwinall.h b/goldlib/gall/gwinall.h index ac7a5e7..063ecb1 100644 --- a/goldlib/gall/gwinall.h +++ b/goldlib/gall/gwinall.h @@ -380,10 +380,11 @@ int wprintvs (int wrow, int wcol, int attr, const vchar* str); int wprintns (int wrow, int wcol, int attr, const char* str, uint len, vchar fill=' ', int fill_attr=-1); int wprintsf (int wrow, int wcol, int attr, const char* format, const char* str); int wprintws (int wrow, int wcol, vatch* buf, uint len); -void wpropbar (int mode, int xx, int yy, long len, long barlen, int attr, long pos, long size); +void wpropbar (int xx, int yy, long len, int attr, long pos, long size); int wputc (vchar ch); int wputs (const char* str); int wputx (int wrow, int wcol, int attr, vchar chr, uint len); +int wputy (int wrow, int wcol, int attr, vchar chr, uint len); int wreadcur (int* wrow, int* wcol); int wscroll (int count, int direc); void wscrollbar (int orientation, uint total, uint maxpos, uint pos, int sadd=0); diff --git a/goldlib/gall/gwinbase.cpp b/goldlib/gall/gwinbase.cpp index 914770e..5b8f295 100644 --- a/goldlib/gall/gwinbase.cpp +++ b/goldlib/gall/gwinbase.cpp @@ -309,14 +309,14 @@ int wshadow(int attr) { // read current screen characters/attributes and save in shadow's buffer vatch tmp[2]; *q = vgetw(crow, ccol); -#ifndef __linux__ +#if defined(__USE_NCURSES__) || !defined(__UNIX__) tmp[0] = vsattr(*q, attr); #else tmp[0] = vsattr(' ', attr); #endif q++; *q = vgetw(crow, ccol + 1); -#ifndef __linux__ +#if defined(__USE_NCURSES__) || !defined(__UNIX__) tmp[1] = vsattr(*q, attr); #else tmp[1] = vsattr(' ', attr); @@ -339,7 +339,7 @@ int wshadow(int attr) { // read attribs/chars and store in buffers *q = vgetw(crow, ccol++); -#ifndef __linux__ +#if defined(__USE_NCURSES__) || !defined(__UNIX__) *wptr++ = vsattr(*q, attr); #else *wptr++ = vsattr(' ', attr); @@ -918,6 +918,16 @@ int wputx(int wrow, int wcol, int attr, vchar chr, uint len) { } +// ------------------------------------------------------------------ + +int wputy(int wrow, int wcol, int attr, vchar chr, uint len) { + + const int &border = gwin.active->border; + vputy(gwin.active->srow+wrow+border,gwin.active->scol+wcol+border,attr,chr,len); + return gwin.werrno=W_NOERROR; +} + + // ------------------------------------------------------------------ // Displays a string inside active window @@ -1882,83 +1892,32 @@ int wmessage(const char* str, int border, int leftofs, int attr) { // ------------------------------------------------------------------ // Proportion bar -void wpropbar(int mode, int xx, int yy, long len, long barlen, int attr, long pos, long size) { +void wpropbar(int xx, int yy, long len, int attr, long pos, long size) { - // mode = PROP_PAGE or PROP_BARGRAPH. // xx, yy = start position in window. // len = length (in chars) of progress field. // attr = color to use for progress field. // pos = present position. // size = total size of field. -#ifndef __linux__ - const vchar _fld = ACS_BOARD; - const vchar _bar = ACS_BLOCK; + const vchar barchar = _box_table(gwin.active->btype, 13); +#ifdef __UNIX__ // prefferable under xterm + const vchar thumbchar = ' '; + int thumbattr = revsattr(attr); #else - const vchar _fld = ' '; - const vchar _bar = _box_table(gwin.active->btype, 13); + const vchar thumbchar = '\xDB'; + int thumbattr = attr; #endif - const vchar _up = '\x18'; - const vchar _dwn = '\x19'; - int dir=0, x, y; - long first, width, length; + long thumblen = (pos*len)/size; - if(len > 0) - dir = 1; // Vertical - else - len = -len; // Horizontal - - if(not barlen) - length = size-len; - else - length = size; - - if((size > len) or (mode!=PROP_PAGE)) { - if(not barlen) - barlen = (len*len)/size; - if(not barlen) - barlen = 1; - width = len-barlen; - first = (pos*width)/length; - } - else { - first = 0; - barlen = len; - } - - if(dir) { - if(mode==PROP_PAGE) { - if(pos > 0) - wprintc(yy,xx,revsattr(attr),_up); - else - wprintc(yy,xx,revsattr(attr),' '); - if(pos+len < size) - wprintc(yy+(int)len-1,xx,revsattr(attr),_dwn); - else - wprintc(yy+(int)len-1,xx,revsattr(attr),' '); - } - for(y=yy+(mode==PROP_PAGE); y<(yy+first); y++) { - wprintc(y,xx,attr|ACSET,mode==PROP_BARGRAPH?_bar:_fld); - } - for(; y<(yy+first+barlen); y++) { - wprintc(y,xx,attr|ACSET,_bar); - } - for(; y<(yy+len-(mode==PROP_PAGE)); y++) { - wprintc(y,xx,attr|ACSET,_fld); - } - } - else { - for(x=xx; x<(xx+first); x++) { - wprintc(yy,x,attr|ACSET,mode==PROP_BARGRAPH?_bar:_fld); - } - for(; x<(xx+first+barlen); x++) { - wprintc(yy,x,attr|ACSET,_bar); - } - for(; x<(xx+len); x++) { - wprintc(yy,x,attr|ACSET,_fld); - } + int x = xx; + if(thumblen != 0) { + wputx(yy, x, thumbattr|ACSET, thumbchar, thumblen); + x += thumblen; } + if(thumblen != len) + wputx(yy, x, attr|ACSET, barchar, len-thumblen); } @@ -2044,85 +2003,78 @@ int wtitle(const char* str, int tpos, int tattr) { void wscrollbar(int orientation, uint total, uint maxpos, uint pos, int sadd) { + int attr = (gwin.active->sbattr == -1) ? gwin.active->battr : gwin.active->sbattr; + int invattr = revsattr(attr); + const vchar barchar = _box_table(gwin.active->btype, 13); - const vchar thumbchar = ACS_BLOCK; const vchar arrowupchar = '\x18'; const vchar arrowdownchar = '\x19'; const vchar arrowleftchar = '\x1B'; const vchar arrowrightchar = '\x1A'; - - int attr = (gwin.active->sbattr == -1) ? gwin.active->battr : gwin.active->sbattr; -#ifdef __linux__ - int thumbattr = revsattr(attr); +#ifdef __UNIX__ // prefferable under xterm + const vchar thumbchar = ' '; + int thumbattr = revsattr(attr); +#else + const vchar thumbchar = '\xDB'; + int thumbattr = attr; #endif - int srow, scol; - uint visiblelen, barlen; - uint maxthumbpos, thumbpos, thumblen; - if(maxpos == 0) maxpos = 1; - if(orientation == W_VERT) { - srow = gwin.active->srow + gwin.active->border + sadd; - scol = gwin.active->ecol; + uint visiblelen; + if(orientation == W_VERT) visiblelen = (gwin.active->erow - (gwin.active->srow+sadd)) + 1 - (gwin.active->border?2:0); - } - else { - srow = gwin.active->erow; - scol = gwin.active->scol + gwin.active->border + sadd; + else visiblelen = (gwin.active->ecol - (gwin.active->scol+sadd)) + 1 - (gwin.active->border?2:0) - 2; - } - - barlen = visiblelen - 2; - thumblen = (visiblelen*barlen) / total; + uint barlen = visiblelen - 2; + uint thumblen = (visiblelen*barlen) / total; if(thumblen == 0) thumblen = 1; else if(thumblen > barlen) thumblen = barlen; - maxthumbpos = barlen - thumblen; - thumbpos = (pos*maxthumbpos) / maxpos; + uint maxthumbpos = barlen - thumblen; + uint thumbpos = (pos*maxthumbpos) / maxpos; uint thumbdiv = (pos*maxthumbpos) % maxpos; if((thumbdiv >= (maxpos/2)) and (maxpos > 1)) thumbpos++; if(thumbpos > maxthumbpos) thumbpos = maxthumbpos; + barlen -= thumbpos + thumblen; if(orientation == W_VERT) { - register int row = srow; - register int erow1 = srow + thumbpos + 1; - register int erow2 = erow1 + thumblen; - register int erow3 = srow + barlen + 1; - vputc(row++, scol, revsattr(attr), arrowupchar); - while(row < erow1) - vputc(row++, scol, attr|ACSET, barchar); - while(row < erow2) -#ifdef __linux__ - vputc(row++, scol, thumbattr|ACSET, thumbchar); -#else - vputc(row++, scol, attr|ACSET, thumbchar); -#endif - while(row < erow3) - vputc(row++, scol, attr|ACSET, barchar); - vputc(row, scol, revsattr(attr), arrowdownchar); + uint scol = gwin.active->ecol - gwin.active->scol - gwin.active->border; + vputc((sadd++)+gwin.active->srow+gwin.active->border, gwin.active->ecol, invattr|ACSET, arrowupchar); + if(thumbpos != 0) { + wputy(sadd, scol, attr|ACSET, barchar, thumbpos); + sadd += thumbpos; + } + if(thumblen != 0) { + wputy(sadd, scol, thumbattr|ACSET, thumbchar, thumblen); + sadd += thumblen; + } + if(barlen != 0) { + wputy(sadd, scol, attr|ACSET, barchar, barlen); + sadd += barlen; + } + vputc(sadd+gwin.active->srow+gwin.active->border, gwin.active->ecol, invattr|ACSET, arrowdownchar); } else { - register int col = scol; - register int ecol1 = scol + thumbpos + 1; - register int ecol2 = ecol1 + thumblen; - register int ecol3 = scol + barlen + 1; - vputc(srow, col++, revsattr(attr), arrowleftchar); - while(col < ecol1) - vputc(srow, col++, attr|ACSET, barchar); - while(col < ecol2) -#ifdef __linux__ - vputc(srow, col++, thumbattr|ACSET, thumbchar); -#else - vputc(srow, col++, attr|ACSET, thumbchar); -#endif - while(col < ecol3) - vputc(srow, col++, attr|ACSET, barchar); - vputc(srow, col, revsattr(attr), arrowrightchar); + uint srow = gwin.active->erow - gwin.active->srow - gwin.active->border; + vputc(gwin.active->erow, (sadd++)+gwin.active->scol+gwin.active->border, invattr|ACSET, arrowleftchar); + if(thumbpos != 0) { + wputx(srow, sadd, attr|ACSET, barchar, thumbpos); + sadd += thumbpos; + } + if(thumblen != 0) { + wputx(srow, sadd, thumbattr|ACSET, thumbchar, thumblen); + sadd += thumblen; + } + if(barlen != 0) { + wputx(srow, sadd, attr|ACSET, barchar, barlen); + sadd += barlen; + } + vputc(gwin.active->erow, sadd+gwin.active->scol+gwin.active->border, invattr|ACSET, arrowrightchar); } } diff --git a/goldlib/gall/gwinpick.cpp b/goldlib/gall/gwinpick.cpp index 21e6569..f54fb2f 100644 --- a/goldlib/gall/gwinpick.cpp +++ b/goldlib/gall/gwinpick.cpp @@ -34,233 +34,6 @@ #include -// ------------------------------------------------------------------ - -int Picker(PInf* p, Pick* pick) { - - int keyok; - gkey keycode, newkey; - - #ifdef GOLD_MOUSE - gmou.HideCursor(); - #endif - - // Open and initialize - - if(pick->open) - pick->open(p); - if(p->helpcat) - whelppcat(p->helpcat); - - do { - - // Display selection bar - - wgotoxy(p->pos, 0); - p->type = PICK_BAR; - pick->disp(p); - p->type = PICK_DISP; - - // Handle keyboard and delay function - - if(pick->dodelayed) - pick->dodelayed(p); - - #ifdef GOLD_MOUSE - gmou.ShowCursor(); - #endif - - keyok = YES; - - do { - newkey = keycode = getxchtick(); - if(newkey == Key_Tick) - pick->dokey(p, &keycode); - } while(newkey == Key_Tick); - - do { - #ifdef GOLD_MOUSE - gmou.HideCursor(); - #endif - newkey = 0; - switch(keycode) { - case Key_Up: - case Key_Dwn: - case Key_PgUp: - case Key_PgDn: - case Key_Home: - case Key_End: - if(pick->precursor) - pick->precursor(p); - break; - } - switch(keycode) { - case Key_Up: - p->direction = -1; - if(p->pos) { - pick->disp(p); - p->pos--; - p->idx--; - } - else if(p->idx > p->minidx) { - pick->disp(p); - p->idx--; - pick->scroll(p, SDOWN); - } - else if(p->listwrap) - newkey = Key_End; - break; - - case Key_Dwn: - p->direction = 1; - if(p->pos < p->maxpos) { - if(p->idx < p->maxidx) { - pick->disp(p); - p->pos++; - p->idx++; - } - else if(p->listwrap) - newkey = Key_Home; - } - else if(p->idx < p->maxidx) { - pick->disp(p); - p->idx++; - pick->scroll(p, SUP); - } - else if(p->listwrap) - newkey = Key_Home; - break; - - case Key_PgUp: - p->direction = -1; - if(p->pos) { - pick->disp(p); - p->idx -= p->pos; - p->pos = 0; - } - else if(p->idx > p->minidx) { - p->idx -= (p->idx >= p->maxpos) ? p->maxpos : p->idx; - pick->page(p); - } - break; - - case Key_PgDn: - p->direction = 1; - if(p->pos < p->maxpos) { - if(p->idx == p->maxidx) { - if(p->maxpos < p->maxidx) { - p->pos = p->maxpos; - p->idx = p->maxidx; - pick->page(p); - } - } - else if(p->idx + (p->maxpos-p->pos) >= p->maxidx) { - pick->disp(p); - p->pos += p->maxidx-p->idx; - p->idx = p->maxidx; - } - else if(p->pos != p->maxpos) { - pick->disp(p); - p->idx += p->maxpos-p->pos; - p->pos = p->maxpos; - } - } - else if(p->idx < p->maxidx) { - if(p->idx+p->maxpos > p->maxidx) { - p->pos = p->maxidx-p->idx; - p->idx = p->maxidx; - pick->page(p); - } - else { - p->idx += p->maxpos; - p->pos = p->maxpos; - pick->page(p); - } - } - break; - - case Key_Home: - p->direction = -1; - if(p->idx > p->minidx) { - if((p->idx - p->pos) <= p->minidx) { - pick->disp(p); - p->idx = p->minidx; - p->pos = 0; - } - else { - p->pos = 0; - p->idx = p->minidx; - pick->page(p); - } - } - break; - - case Key_End: - p->direction = 1; - if(p->idx < p->maxidx) { - if(p->idx + (p->maxpos-p->pos) >= p->maxidx) { - pick->disp(p); - p->pos += p->maxidx-p->idx; - p->idx = p->maxidx; - } - else { - p->pos = (p->maxidx-p->idx) < p->maxpos ? p->maxidx-p->idx : p->maxpos; - p->idx = p->maxidx; - pick->page(p); - } - } - else if(p->pos < p->maxpos) { - if(p->maxpos < p->maxidx) { - p->pos = p->maxpos; - p->idx = p->maxidx; - pick->page(p); - } - } - break; - - case Key_C_Up: - p->direction = -1; - if(p->idx - p->pos) { - p->idx--; - pick->page(p); - } - break; - - case Key_C_Dwn: - p->direction = 1; - if(p->idx < p->maxidx) { - p->idx++; - pick->page(p); - } - break; - - default: - keyok = pick->dokey(p, &keycode); - newkey = keycode; - } - if(newkey) - keycode = newkey; - } while(newkey); - } while(keyok); - - #ifdef GOLD_MOUSE - gmou.HideCursor(); - #endif - - // Close and clean - if(p->helpcat) - whelpop(); - if(pick->close) - pick->close(p); - - #ifdef GOLD_MOUSE - gmou.ShowCursor(); - #endif - - return p->retval; -} - - // ------------------------------------------------------------------ gwinpick::gwinpick() { diff --git a/goldlib/gall/gwinpick.h b/goldlib/gall/gwinpick.h index 0f10214..801d1c0 100644 --- a/goldlib/gall/gwinpick.h +++ b/goldlib/gall/gwinpick.h @@ -46,66 +46,6 @@ const int LIST_NEARTOP = 1; const int LIST_TOP = 2; -// ------------------------------------------------------------------ -// Picker info - -struct PInf { - - PInf() : ypos(row), xpos(column), ylen(height), xlen(width) {} - - uint& ypos; - uint& xpos; - uint& ylen; - uint& xlen; - uint row; //ypos; // Window Starting Row - uint column; //xpos; // Window Starting Column - uint height; //ylen; // Window Height - uint width; //xlen; // Window Width - int btype; // Window Border Type - int battr; // Window Border Color - int wattr; // Window Color - int tattr; // Window Title Color - int sattr; // Window Selection Bar Color - int hattr; // Window Highlight Color - int loattr; // Window LoAttr Color - int sbattr; // Window Scrollbar Color - char* title; // Window Title - int helpcat; // Window Help Category - uint maxidx; // List Entries - 1 - uint minidx; // Minimum index in the list - uint maxpos; // Display Pos - uint idx; // List Index - uint pos; // Display Pos - long delay; // Ticks until delay - int type; // Bar or Disp - int retval; // Return value - bool aborted; // True if aborted - bool listwrap; // True if wrap-around is supported - int direction; // 1 if next, -1 if previous -}; - - -// ------------------------------------------------------------------ -// Picker definable functions - -struct Pick { - void (*open) (PInf*); // Called after window is opened - void (*close) (PInf*); // Called after window is closed - void (*precursor)(PInf*); // Called before any cursor movement - void (*dodelayed)(PInf*); // Called after a delay - void (*disp) (PInf*); // Display line - void (*page) (PInf*); // Display page - void (*scroll) (PInf*, int); // Scroll list (direction) - int (*dokey) (PInf*, gkey*); // Called with key (&keycode) -}; - - -// ------------------------------------------------------------------ -// Prototypes - -int Picker(PInf* p, Pick* pick); - - // ------------------------------------------------------------------ class gwinpick { diff --git a/goldlib/gall/gwinput.h b/goldlib/gall/gwinput.h index 529b433..9dca853 100644 --- a/goldlib/gall/gwinput.h +++ b/goldlib/gall/gwinput.h @@ -188,8 +188,6 @@ public: void restore_field(); void delete_left_word(); void delete_right_word(); - void clear_to_end_field(); - void clear_to_end_form(); void go_left_word(); void go_right_word(); void enter_char(char ch); diff --git a/goldlib/gall/gwinput2.cpp b/goldlib/gall/gwinput2.cpp index 05088de..86bb041 100644 --- a/goldlib/gall/gwinput2.cpp +++ b/goldlib/gall/gwinput2.cpp @@ -516,20 +516,6 @@ void gwinput::delete_right_word() { } -// ------------------------------------------------------------------ - -void gwinput::clear_to_end_field() { - -} - - -// ------------------------------------------------------------------ - -void gwinput::clear_to_end_form() { - -} - - // ------------------------------------------------------------------ void gwinput::go_left_word() { @@ -619,8 +605,6 @@ bool gwinput::handle_key(gkey key) { case Key_C_R: restore_field(); break; case Key_C_BS: delete_left_word(); break; case Key_C_T: delete_right_word(); break; - case Key_C_U: clear_to_end_field(); break; - case Key_C_Y: clear_to_end_form(); break; case Key_C_Lft: go_left_word(); break; case Key_C_Rgt: go_right_word(); break; default: diff --git a/goldlib/gcfg/gxareas.cpp b/goldlib/gcfg/gxareas.cpp index 11d5671..59a07d7 100644 --- a/goldlib/gcfg/gxareas.cpp +++ b/goldlib/gcfg/gxareas.cpp @@ -50,9 +50,10 @@ void gareafile::ReadAreasBBS(char* tag) { // Read each AREAS.BBS while(ptr) { if(*ptr != '-') { + int echos_before = echolist.Echos(); GetAreasBBS(ptr, origin, options); echos = echolist.Echos(); - for(int n=0; n