Announcement

Collapse
No announcement yet.

Edit Menu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Edit Menu

    Hi,

    I have used PowerBASIC for DOS before, but I am new to the Windows version. I am using PowerBASIC Forms and PowerBASIC/Win v8.04.0042

    How do I create a Edit menu? I assume that is possible some how

    Brian
    Brian Heibert
    [email protected]
    http://www.heibertsoftware.com
    http://www.winvocalassist.com
    http://www.heibert.net

  • #2
    You will find a menu tutorial and a few others at http://www.powerbasic.com/support/quickstart/index.html
    Sincerely,

    Steve Rossell
    PowerBASIC Staff

    Comment


    • #3
      I have looked at all the tutorials
      and I still don't know how to make a EDIT menu
      Brian Heibert
      [email protected]
      http://www.heibertsoftware.com
      http://www.winvocalassist.com
      http://www.heibert.net

      Comment


      • #4
        Originally posted by Brian Heibert View Post
        I have looked at all the tutorials
        and I still don't know how to make a EDIT menu
        Brian, more details on specifically what you want to do are needed. Do you want to create an "Edit" menu on the top of the (main) dialog? If so, the look at the "Menu example" program in the Help File. Load and run it a few times to get the hang of things.

        Or do you want to create "window" you can edit text in? A different animal.

        ======================================
        Fish and visitors stink in three days.
        Ben Franklin
        ======================================
        It's a pretty day. I hope you enjoy it.

        Gösta

        JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
        LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

        Comment


        • #5
          Originally posted by Brian Heibert View Post
          I have looked at all the tutorials
          and I still don't know how to make a EDIT menu
          At step 20 (after the File menu), instead of creating a Help menu, change the text to create a Edit menu.

          Instead of
          20. In the "Caption" Textbox, type in "&Help" (without the quotes).

          do
          20. In the "Caption" Textbox, type in "&Edit" (without the quotes).
          Sincerely,

          Steve Rossell
          PowerBASIC Staff

          Comment


          • #6
            Originally posted by Steve Rossell View Post
            At step 20 (after the File menu), instead of creating a Help menu, change the text to create a Edit menu.

            Instead of
            20. In the "Caption" Textbox, type in "&Help" (without the quotes).

            do
            20. In the "Caption" Textbox, type in "&Edit" (without the quotes).
            I have looked at a bunch of examples including Interface Explorer
            and I still don't know how to make a Edit menu I have made a menu called Edit with Cut,Copy and Paste, but I don't know what code I need to make it work.

            I am using PowerBASIC Forms to create the Interface however I have modified the code in PB/Win

            I am sorry to be bugging the forum about this but I am still learning
            Brian Heibert
            [email protected]
            http://www.heibertsoftware.com
            http://www.winvocalassist.com
            http://www.heibert.net

            Comment


            • #7
              I am used to a programming language called REALbasic. REALbasic provides the Edit menu and it's functionality automatically. So I guess it will take me a while to learn PB
              Brian Heibert
              [email protected]
              http://www.heibertsoftware.com
              http://www.winvocalassist.com
              http://www.heibert.net

              Comment


              • #8
                Some of us don't use PBForms and you can make a menu without it.
                Here is an example. Insert this before the Dialog New statement
                change values to your specific needs.
                This also includes a subpopup
                Code:
                  LOCAL hMenu as LONG, hPopupC1 as long, hSubPopupC1 as long,
                  LOCAL hPopupC2 as long, hPopupC3 as long, hPopupC4 as long
                  LOCAL hPopupC5 as long, hPopupC6 as long, hPopupC9 as long
                
                  MENU NEW BAR TO hMenu
                  MENU NEW POPUP TO hPopupC1
                  MENU ADD POPUP, hMenu, "&File", hPopupC1, %MF_ENABLED
                
                  MENU NEW POPUP TO hSubPopupC1 'hPopupC7
                  MENU ADD POPUP, hPopupC1, "Maintenance", hSubPopupC1,%MF_ENABLED
                  MENU ADD STRING, hSubPopupC1, "Client Information"+$tab+"(31)",          %ID_Client, Stat&'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "&Chart of Accounts"+$tab+"(32)",   %ID_Chart,      stat&'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "&Employee"+$tab+"(33)",            %ID_Emplo,      stat& '%MF_ENABLED'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "&Payee (A/P Vendor)"+$tab+"(34)",               %ID_Payee,      stat& '%MF_ENABLED'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "&Synonyms"+$tab+"(35)",            %ID_Syn,        stat& '%MF_ENABLED'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "CIP File"+$tab+"(36)",             %ID_CIP,        stat& '%MF_ENABLED'"&Chart of Accounts"
                  MENU ADD STRING, hSubPopupC1, "&GPA File"+$tab+"(37)",            %ID_GPA,        stat& '%MF_ENABLED'
                  MENU ADD STRING, hSubPopupC1, "Preferences"+$tab+"(39)",        %ID_CONFIG,     stat& '%MF_ENABLED'
                  MENU ADD STRING, hSubPopupC1, "&Fica Rate File"+$tab+"(63)",      %ID_FICARATE,   stat& '%MF_ENABLED'
                  MENU ADD STRING, hSubPopupC1, "&Letterhead (Preparer)"+$tab+"(67)",%ID_PREP,      stat& '%MF_ENABLED'
                  MENU ADD STRING, hSubPopupC1, "&Letter Editor"+$tab+"(68)",       %ID_EDITOR,     %MF_ENABLED
                  MENU ADD STRING, hSubPopupC1, "&Journal Descriptions"+$tab+"(88)",%ID_JDESCRIP,   %MF_ENABLED
                  MENU ADD STRING, hSubPopupC1, "Customer (A/R)"+$tab+"(92)",       %ID_CUST, %MF_ENABLED
                
                  MENU ADD STRING, hPopupC1, "-",                          0, 0
                  MENU ADD STRING, hPopupC1, "Create New Client"+$tab+"(61)",    %ID_NEWCLI,     stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "Erase Client Files"+$tab+"(64)",   %ID_ERASECLI,   stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "Change Client"+$tab+"(73)",        %ID_CHGCLI,     stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "-",                          0, 0
                  MENU ADD STRING, hPopupC1, "COA Wizard"+$tab+"(77)",           %ID_COAWIZ,     stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "Change W-2  Col/Row"+$tab+"(78)",  %ID_W2COLROW,   stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "Change 1099 Col/Row"+$tab+"(79)",  %ID_1099COLROW, stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "Change W-3  Col/Row"+$tab+"(90)",  %ID_W3COLROW,   stat& '%MF_ENABLED'
                  MENU ADD STRING, hPopupC1, "-",                          0, 0
                  MENU ADD STRING, hPopupC1, "E&xit"+$tab+"(Esc)",                %ID_EXIT, %MF_ENABLED
                
                  MENU NEW POPUP TO hPopupC2
                  MENU ADD POPUP, hMenu, "&Processing", hPopupC2, %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "&Journal Posting "+$tab+"(11)",               %ID_JOURNALPOSTING, %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "Update CIP"+$TAB+"(12)",                     %ID_UPDATECIP,      %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "&Update Employee/Payee"+$TAB+"(13)",         %ID_UPDATEEMP,      %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "&Close Period"+$TAB+"(14)",                  %ID_CLOSEPERIOD,    %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "Clear &QTD Payroll"+$TAB+"(15)",             %ID_CLEARQTD,       %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "&Bank Reconciliation"+$TAB+"(16)",          %ID_BANKREC,        %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "Client &Status"+$TAB+"(17)",                 %ID_CLIENTSTATUS,   %MF_ENABLED
                
                  MENU ADD STRING, hPopupC2, "Trial Balance Adjustment posting"+$tab+"(19)",%ID_TBADJ,          %MF_ENABLED
                
                  MENU ADD STRING, hPopupC2, "-",                          0, 0
                  MENU ADD STRING, hPopupC2, "&Backup/Restore Client"+$TAB+"(69)",         %ID_BACKREST,       %MF_ENABLED
                  MENU ADD STRING, hPopupC2, "-",                          0, 0
                  MENU ADD STRING, hPopupC2, "&Depreciation/Amortization"+$TAB+"(82)",     %ID_DEPRMENU,       %MF_ENABLED
                
                  MENU NEW POPUP TO hPopupC3
                  MENU ADD POPUP, hMenu, "&Reports", hPopupC3, %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Journal"+$TAB+"(21)",             %ID_JOURNAL,  %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Detail Ledger"+$TAB+"(22)",       %ID_LEDGER,   %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Account Detail"+$TAB+"(23)",      %ID_ACCDETAIL,%MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Trial Balance"+$TAB+"(24)",       %ID_TRIALBAL, %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Financial Statements"+$TAB+"(25)", %ID_FINANCS,  %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&CIP Statement"+$TAB+"(26)",       %ID_CIPSTAMT, %MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Gross Profit"+$TAB+"(28)",        %ID_GROSSPROF,%MF_ENABLED
                  MENU ADD STRING, hPopupC3, "&Y-T-D Detail"+$TAB+"(29)",        %ID_YTDDETAIL,%MF_ENABLED
                
                
                  MENU NEW POPUP TO hPopupC4
                  MENU ADD POPUP, hMenu, "&Listings", hPopupC4, %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&Chart of Accounts"+$TAB+"(41)",      %ID_COALIST,  %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&Employee File"+$TAB+"(42)",          %ID_EMPLIST,  %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "Employee (Alphabetical)"+$TAB+"(43)", %ID_EMPALIST, %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&Payee (A/P Vendor)"+$TAB+"(44)",     %ID_PAYEELIST,%MF_ENABLED
                  MENU ADD STRING, hPopupC4, "CIP File"+$TAB+"(45)",                %ID_CIPLIST,  %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "Customer (A/R)"+$TAB+"(46)",          %ID_CUSTLIST, %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&GPA File"+$TAB+"(47)",               %ID_GPALIST,  %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "Journal Notes"+$TAB+"(48)",           %ID_JNOTES,   %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&Journal Posting Time"+$TAB+"(49)",   %ID_JPTIME,   %MF_ENABLED
                  MENU ADD STRING, hPopupC4, "&Mailing List Programs"+$TAB+"(89)", %ID_MailList, %MF_ENABLED
                  MENU NEW POPUP TO hPopupC5
                  MENU ADD POPUP, hMenu, "Pa&yroll Reports", hPopupC5, %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&Payroll Register"+$TAB+"(51)",    %ID_EARN,  %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&Quarter to Date"+$tab+"(52)",     %ID_QTD,   %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "Quarterly &Report"+$tab+"(53)",    %ID_Q941,  %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&Unemployment Report"+$tab+"(54)", %ID_UNEMP, %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&W-2s"+$tab+"(55)",                %ID_W2,    %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "1099 (Employee File)"+$tab+"(56)",%ID_1099E, %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&1099 (Payee File)"+$tab+"(57)",   %ID_1099P, %MF_ENABLED
                  MENU ADD STRING, hPopupC5, "&Income Tax Summary"+$tab+"(74)",  %ID_INCTAX,%MF_ENABLED
                
                  MENU NEW POPUP TO hPopupC6
                  MENU ADD POPUP, hMenu, "&Other", hPopupC6, %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "&Format Floppy Disk"+$tab+"(62)",         %ID_FORMATF,  %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "&Disk Directory"+$tab+"(65)",             %ID_DISKDIR,  %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "&Disk Space"+$tab+"(66)",                 %ID_DISKSPA,  %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "-",                          0, 0
                  MENU ADD STRING, hPopupC6, "&Consolidated Maintenance"+$tab+"(76)",   %ID_CONSOL,   %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "&Custom Applications"+$tab+"(59)",        %ID_PLUGINS,  %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "-",                          0, 0
                  MENU ADD STRING, hPopupC6, "&AR/AP Menu"+$tab+"(83)",                 %ID_ARAPMEMU, %MF_ENABLED
                  MENU ADD STRING, hPopupC6, "-",                          0, 0
                  MENU ADD STRING, hPopupC6, "&Export Transactions"+$tab+"(71)",        %ID_EXPORTTRAN,%MF_ENABLED
                  MENU ADD STRING, hPopupC6, "&Import Transactions"+$tab+"(72)",        %ID_IMPORTTRAN,%MF_ENABLED
                  MENU ADD STRING, hPopupC6, "-",                          0, 0
                  MENU ADD STRING, hPopupC6, "&Update from other packages"+$tab+"(84)", %ID_GLX,       %MF_ENABLED
                
                  MENU NEW POPUP TO hPopupC9
                  MENU ADD POPUP,  hMenu,    "&Help",     hPopupC9,    %MF_ENABLED
                  MENU ADD STRING, hPopupC9, "&Contents"+$tab+"(81)", %ID_HELP,    %MF_ENABLED
                  MENU ADD STRING, hPopupC9, "&About"+$tab+"(91)",    %ID_ABOUT,   %MF_ENABLED
                  MENU ADD STRING,hPopupC9,"Register"+$tab+"(93)",  %ID_REGISTER,%MF_ENABLED
                  MENU ADD STRING, hPopupC9,"Email us"+$tab+"(94)", %ID_Email,%MF_ENABLED
                  MENU ADD STRING, hPopupC9,"About New Help", %ID_NEWHELP,%MF_ENABLED
                Then just before your DIALOG SHOW statement, insert

                MENU ATTACH hMenu, hDlg

                You will need to have all the %ID_... variables defined near the top of the program.
                In the callback function you will need a case for each %ID_... to do whatever you
                want it to do. the select case will be under:
                Code:
                SELECT CASE CBMSG
                   CASE %WM_COMMAND
                       SELECT CASE CBCTL
                          CASE %ID_CLIENT 'as an example
                ' this would have code to do whatever (like open a file) when %ID_CLIENT under 'File' is clicked'
                'The topmost File Edit .... Help don't need a case unless there are no popups under them and it is what you want to use
                ' to process something.
                You can even do it within a resource file though i have never done it that way. (Resource =RC extension ->filename.PBR)
                Last edited by Fred Buffington; 26 Feb 2008, 06:47 PM.
                Client Writeup for the CPA

                buffs.proboards2.com

                Links Page

                Comment


                • #9
                  In your ShowDIALOG1Proc():

                  Code:
                   
                    CASE %IDM_CUT
                        Control Send CbHndl, %IDC_TEXTBOX1, %WM_CUT, 0, 0
                    CASE %IDM_COPY
                        Control Send CbHndl, %IDC_TEXTBOX1, %WM_COPY, 0, 0
                    CASE %IDM_PASTE
                        Control Send CbHndl, %IDC_TEXTBOX1, %WM_PASTE, 0, 0
                  Have a look at the SDK samples, eg PBNote.bas too to see how menu selections are handled in the CallBack.
                  Last edited by Dave Biggs; 26 Feb 2008, 07:07 PM.
                  Rgds, Dave

                  Comment


                  • #10
                    Originally posted by Dave Biggs View Post
                    In your ShowDIALOG1Proc():

                    Code:
                     
                      CASE %IDM_CUT
                          Control Send CbHndl, %IDC_TEXTBOX1, %WM_CUT, 0, 0
                      CASE %IDM_COPY
                          Control Send CbHndl, %IDC_TEXTBOX1, %WM_COPY, 0, 0
                      CASE %IDM_PASTE
                          Control Send CbHndl, %IDC_TEXTBOX1, %WM_PASTE, 0, 0
                    Have a look at the SDK samples, eg PBNote.bas too to see how menu selections are handled in the CallBack.
                    Thanks it works.

                    Brian
                    Brian Heibert
                    [email protected]
                    http://www.heibertsoftware.com
                    http://www.winvocalassist.com
                    http://www.heibert.net

                    Comment

                    Working...
                    X