Microsoft Visual C++ è MFC. Ïðîãðàììèðîâàíèå äëÿ Win95 è WinNT

         

Òàáëèöà òåêñòîâûõ ñòðîê


 òàáëèöå òåêñòîâûõ ñòðîê ïðîåêòà Dialog îïðåäåëåíà òîëüêî îäíà òåêñòîâàÿ ñòðîêà &About Dialog..., èìåþùàÿ èäåíòèôèêàòîð IDS_ABOUTBOX. Ýòà ñòðîêà ñîäåðæèò òåêñò íîâîãî ýëåìåíòà, êîòîðûé áóäåò äîáàâëåí ê ñèñòåìíîìó ìåíþ ãëàâíîé äèàëîãîâîé ïàíåëè ïðèëîæåíèÿ. Åñëè ïîëüçîâàòåëü âûáåðåò ýòó ñòðîêó ìåíþ, ïðèëîæåíèå âûâåäåò íà ýêðàí íåáîëüøóþ äèàëîãîâóþ ïàíåëü, ñ êðàòêîé èíôîðìàöèåé î ïðèëîæåíèè.

//////////////////////////////////////////////////////////////

// Òàáëèöà ñòðîê

STRINGTABLE DISCARDABLE

BEGIN

      IDS_ABOUTBOX             "&About Dialog..."

END


Äëÿ ïîëó÷åíèÿ áîëåå ïîëíîé èíôîðìàöèè âû ìîæåòå èçó÷èòü ìåòîä GetDocString, êîòîðûé ïîçâîëÿåò îïðåäåëèòü îòäåëüíûå ôðàãìåíòû ñòðîêè, îïèñûâàþùèé äîêóìåíò. Îïèñàíèå ìåòîäà GetDocString ñìîòðèòå â ñïðàâî÷íîé ñèñòåìå Visual C++.
Âòîðîé áëîê òàáëèöû òåêñòîâûõ ñòðîê ñîäåðæèò äâå ñòðîêè ñ èäåíòèôèêàòîðàìè AFX_IDS_APP_TITLE è AFX_IDS_IDLEMESSAGE. Ñòðîêà, èìåþùàÿ èäåíòèôèêàòîð AFX_IDS_IDLEMESSAGE, îòîáðàæàåòñÿ â ïàíåëè ñîñòîÿíèÿ, êîãäà ïðèëîæåíèå íàõîäèòñÿ â ñîñòîÿíèè îæèäàíèÿ.
Êîãäà ïîëüçîâàòåëü ñîçäàåò îáúåêò ãëàâíîãî êëàññà ïðèëîæåíèÿ, îí ìîæåò óêàçàòü èìÿ ïðèëîæåíèÿ. Åñëè ýòî èìÿ íå óêàçàíî, êàê â íàøåì ïðèëîæåíèè, òîãäà â êà÷åñòâå èìåíè ïðèëîæåíèÿ èñïîëüçóåòñÿ ñòðîêà, èìåþùàÿ èäåíòèôèêàòîð AFX_IDS_APP_TITLE.
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
      AFX_IDS_APP_TITLE                    "Single"
      AFX_IDS_IDLEMESSAGE                "Ready"
END
 ñëåäóþùåì áëîêå òåêñòîâûõ ñòðîê îïðåäåëåíû íåñêîëüêî òåêñòîâûõ ñòðîê, èìåþùèõ ñòàíäàðòíûå èäåíòèôèêàòîðû. Ýòè ñòðîêè èñïîëüçóþòñÿ äëÿ îòîáðàæåíèÿ ðàçëè÷íîé èíôîðìàöèè â ïàíåëè ñîñòîÿíèÿ.
STRINGTABLE DISCARDABLE
BEGIN
      ID_INDICATOR_EXT     "EXT"
      ID_INDICATOR_CAPS    "CAP"
      ID_INDICATOR_NUM    "NUM"
      ID_INDICATOR_SCRL    "SCRL"
      ID_INDICATOR_OVR      "OVR"
      ID_INDICATOR_REC      "REC"
END
È íàêîíåö, ïîñëåäíèé, ñàìûé áîëüøîé áëîê òåêñòîâûõ ñòðîê ñîäåðæèò êðàòêèå îïèñàíèÿ êàæäîé ñòðîêè ìåíþ ïðèëîæåíèÿ. Èäåíòèôèêàòîðû ýòèõ ñòðîê ñîîòâåòñòâóþò èäåíòèôèêàòîðàì ñòðîê ìåíþ, êîòîðûå îíè îïèñûâàþò.
Ñòðîêè, îïèñûâàþùèå ìåíþ, ñîñòîÿò èç äâóõ ÷àñòåé, ðàçäåëåííûõ ñèìâîëîì ïåðåâîäà ñòðîêè \n. Ïåðâàÿ ÷àñòü ñòðîêè îòîáðàæàþòñÿ â ïàíåëè ñîñòîÿíèÿ, êîãäà ïîëüçîâàòåëü âûáèðàåò ñòðîêè ìåíþ. Âòîðàÿ ÷àñòü ñòðîêè ñîäåðæèò êðàòêóþ ïîäñêàçêó, êîòîðàÿ îòîáðàæàåòñÿ, åñëè ïîìåñòèòü óêàçàòåëü ìûøè íà êíîïêè è ïîäîæäàòü íåñêîëüêî ñåêóíä. Åñëè âû íå íóæäàåòåñü â êîðîòêîé ïîäñêàçêå äëÿ êíîïîê óïðàâëÿþùåé ïàíåëè, òî âòîðóþ ÷àñòü ñòðîêè ìîæíî íå ïðèâîäèòü.


STRINGTABLE DISCARDABLE
BEGIN
          ID_FILE_NEW                                                        "Create a new document\nNew"
          ID_FILE_OPEN                                                      "Open an existing document\nOpen"
          ID_FILE_CLOSE   "Close the active document\nClose"
          ID_FILE_SAVE                                                       "Save the active document\nSave"
          ID_FILE_SAVE_AS                      " Save the active document with a new
                                                                                                name\nSave As"
          ID_FILE_PAGE_SETUP             "Change the printing options\nPage Setup"
          ID_FILE_PRINT_SETUP            "Change the printer and printing
                                                                                                options\nPrint Setup"
          ID_FILE_PRINT     "Print the active document\nPrint"
          ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
          ID_APP_ABOUT   "                       Display program information, version
                                                                                                number and copyright\nAbout"
          ID_APP_EXIT                                                         "Quit the application; prompts to save
                                                                                                documents\nExit"
          ID_FILE_MRU_FILE1                 "Open this document"
          ID_FILE_MRU_FILE2                 "Open this document"
          ID_FILE_MRU_FILE3                 "Open this document"
          ID_FILE_MRU_FILE4                 "Open this document"
          ID_FILE_MRU_FILE5                 "Open this document"
          ID_FILE_MRU_FILE6                 "Open this document"


          ID_FILE_MRU_FILE7                 "Open this document"
          ID_FILE_MRU_FILE8                 "Open this document"
          ID_FILE_MRU_FILE9                 "Open this document"
          ID_FILE_MRU_FILE10               "Open this document"
          ID_FILE_MRU_FILE11               "Open this document"
          ID_FILE_MRU_FILE12               "Open this document"
          ID_FILE_MRU_FILE13               "Open this document"
          ID_FILE_MRU_FILE14               "Open this document"
          ID_FILE_MRU_FILE15               "Open this document"
          ID_FILE_MRU_FILE16               "Open this document"
          ID_NEXT_PANE   " Switch to the next window pane\nNext Pane"
          ID_PREV_PANE   "Switch back to the previous window
                                                                                                pane\nPrevious Pane"
          ID_WINDOW_SPLIT                   "Split the active window into panes\nSplit"
          ID_EDIT_CLEAR  "Erase the selection\nErase"
          ID_EDIT_CLEAR_ALL               "Erase everything\nErase All"
          ID_EDIT_COPY                                                     "Copy the selection and put it on the
                                                                                                Clipboard\nCopy"
          ID_EDIT_CUT                                                         "Cut the selection and put it on the
                                                                                                Clipboard\nCut"
          ID_EDIT_FIND                                                       "Find the specified text\nFind"
          ID_EDIT_PASTE   "Insert Clipboard contents\nPaste"
          ID_EDIT_REPEAT                        "Repeat the last action\nRepeat"
          ID_EDIT_REPLACE                     "Replace specific text with different
                                                                                                text\nReplace"
          ID_EDIT_SELECT_ALL             "Select the entire document\nSelect All"
          ID_EDIT_UNDO                                                    "Undo the last action\nUndo"
          ID_EDIT_REDO                                                     "Redo the previously undone action\nRedo"
          ID_VIEW_TOOLBAR                   "Show or hide the toolbar\nToggle ToolBar"
          ID_VIEW_STATUS_BAR            "Show or hide the status bar\nToggle
                                                                                                StatusBar"
END

Ñîäåðæàíèå ðàçäåëà