Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Dialog Bar

Dialog Bar

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vivekphlp
    wrote on last edited by
    #1

    how can i create a dialog bar in my application.. I inserted the resource Insert->dialog-dialogbar.. When i try to create a class for my dialogbar, using class wizard.. the Base class CDialogBar is not displayed . . . what can i do . .

    Proud To Be an Indian

    P R 2 Replies Last reply
    0
    • V vivekphlp

      how can i create a dialog bar in my application.. I inserted the resource Insert->dialog-dialogbar.. When i try to create a class for my dialogbar, using class wizard.. the Base class CDialogBar is not displayed . . . what can i do . .

      Proud To Be an Indian

      P Offline
      P Offline
      Peter Chan 0
      wrote on last edited by
      #2

      Do you mean toolbar? If it's toolbar, you can do accroding to the following step. 1)create a toolbar resource "Insert->toolbar" 2)add a member CToolBar m_wndToolBar; 3)add the following code in your OnInitDialog() if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } m_wndToolBar.ShowWindow(SW_SHOW); RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); I hope it will works.;P

      V 1 Reply Last reply
      0
      • V vivekphlp

        how can i create a dialog bar in my application.. I inserted the resource Insert->dialog-dialogbar.. When i try to create a class for my dialogbar, using class wizard.. the Base class CDialogBar is not displayed . . . what can i do . .

        Proud To Be an Indian

        R Offline
        R Offline
        Rajkumar R
        wrote on last edited by
        #3

        Hi, I usually derive it from CDialog and rename the CDialog to CDialogBar and if you need you can simplify the create() function with BOOL CYourDlgBar::Create(CWnd* pParentWnd, UINT nStyle) { return CDialogBar::Create(pParentWnd, IDD, nStyle, IDD); } And on your frame window create, dock your dialog bar m_yourDlgBarObj.Create(this, //frame instance WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD |WS_VISIBLE | //style CBRS_BOTTOM|CBRS_TOOLTIPS); m_yourDlgBarObj.EnableDocking(CBRS_ALIGN_BOTTOM | CBRS_ALIGN_TOP); DockControlBar(&m_yourDlgBarObj);

        V 1 Reply Last reply
        0
        • P Peter Chan 0

          Do you mean toolbar? If it's toolbar, you can do accroding to the following step. 1)create a toolbar resource "Insert->toolbar" 2)add a member CToolBar m_wndToolBar; 3)add the following code in your OnInitDialog() if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } m_wndToolBar.ShowWindow(SW_SHOW); RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); I hope it will works.;P

          V Offline
          V Offline
          vivekphlp
          wrote on last edited by
          #4

          hey no its a DIALOG BAR . ..

          Proud To Be an Indian

          1 Reply Last reply
          0
          • R Rajkumar R

            Hi, I usually derive it from CDialog and rename the CDialog to CDialogBar and if you need you can simplify the create() function with BOOL CYourDlgBar::Create(CWnd* pParentWnd, UINT nStyle) { return CDialogBar::Create(pParentWnd, IDD, nStyle, IDD); } And on your frame window create, dock your dialog bar m_yourDlgBarObj.Create(this, //frame instance WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD |WS_VISIBLE | //style CBRS_BOTTOM|CBRS_TOOLTIPS); m_yourDlgBarObj.EnableDocking(CBRS_ALIGN_BOTTOM | CBRS_ALIGN_TOP); DockControlBar(&m_yourDlgBarObj);

            V Offline
            V Offline
            vivekphlp
            wrote on last edited by
            #5

            OK its working now ... i followed what u said . . . I had a button in the dialog bar . . but its disabled why . . .

            Proud To Be an Indian

            R 1 Reply Last reply
            0
            • V vivekphlp

              OK its working now ... i followed what u said . . . I had a button in the dialog bar . . but its disabled why . . .

              Proud To Be an Indian

              R Offline
              R Offline
              Rajkumar R
              wrote on last edited by
              #6

              It is the property of MFC, MFC disables controls if the handlers is not available override OnUpdateCmdUI() this will enable all. But MFC wants handlers for each control Best Regards Raj

              V 1 Reply Last reply
              0
              • R Rajkumar R

                It is the property of MFC, MFC disables controls if the handlers is not available override OnUpdateCmdUI() this will enable all. But MFC wants handlers for each control Best Regards Raj

                V Offline
                V Offline
                vivekphlp
                wrote on last edited by
                #7

                Sorry Raj ... can u plz be more specific... How to add OnUpdateCmdUI() There was a button & text box. The text box is enabled... I added some functionality to the buttn just to display hello,..

                Proud To Be an Indian

                R 1 Reply Last reply
                0
                • V vivekphlp

                  Sorry Raj ... can u plz be more specific... How to add OnUpdateCmdUI() There was a button & text box. The text box is enabled... I added some functionality to the buttn just to display hello,..

                  Proud To Be an Indian

                  R Offline
                  R Offline
                  Rajkumar R
                  wrote on last edited by
                  #8

                  Now you have your CYourDlgBarClass, using class wizard add the override OnUpdateCmdUI(), that's all, this will add virtual void OnUpdateCmdUI( IN CFrameWnd* pTarget, IN BOOL bDisableIfNoHandler ); in your declaration and void CYourDlgBarClass::OnUpdateCmdUI( IN CFrameWnd* /*pTarget*/, IN BOOL /*bDisableIfNoHandler*/ ) { // TODO: Add your specialized code here and/or call the base class } in your implementation if class wizard found to be not helpful, simply code manually, this is enough to enable. for enabling individual controls , use ON_UPDATE_COMMAND_UI(id /* control id*/, memberFxn ) in the message map. Best Regards

                  V 1 Reply Last reply
                  0
                  • R Rajkumar R

                    Now you have your CYourDlgBarClass, using class wizard add the override OnUpdateCmdUI(), that's all, this will add virtual void OnUpdateCmdUI( IN CFrameWnd* pTarget, IN BOOL bDisableIfNoHandler ); in your declaration and void CYourDlgBarClass::OnUpdateCmdUI( IN CFrameWnd* /*pTarget*/, IN BOOL /*bDisableIfNoHandler*/ ) { // TODO: Add your specialized code here and/or call the base class } in your implementation if class wizard found to be not helpful, simply code manually, this is enough to enable. for enabling individual controls , use ON_UPDATE_COMMAND_UI(id /* control id*/, memberFxn ) in the message map. Best Regards

                    V Offline
                    V Offline
                    vivekphlp
                    wrote on last edited by
                    #9

                    Thanks its working nicely . . . can u plz explain what is happening behind.. 1) the UpdateCmdUI was not in Class wizard 2)no code was given inside CYourDlgBarClass::OnUpdateCmdUI(IN CFrameWnd,IN BOOL) { } then how it is enabled??? 3)What is the IN type oops a small probs its not coming in order.. i added it after the main tool bar buts its comming before the standard tool bar..

                    Proud To Be an Indian

                    R 1 Reply Last reply
                    0
                    • V vivekphlp

                      Thanks its working nicely . . . can u plz explain what is happening behind.. 1) the UpdateCmdUI was not in Class wizard 2)no code was given inside CYourDlgBarClass::OnUpdateCmdUI(IN CFrameWnd,IN BOOL) { } then how it is enabled??? 3)What is the IN type oops a small probs its not coming in order.. i added it after the main tool bar buts its comming before the standard tool bar..

                      Proud To Be an Indian

                      R Offline
                      R Offline
                      Rajkumar R
                      wrote on last edited by
                      #10
                      1. No it can be found in class wizard, I donot have issue in VS2005, 2) The default implementation will disable it, we overrided it. 3) IN is simply a empty macro, used just for code readability, (the parameter is input that is caller donot expect change, there is also OUT macro). You need to use DockControlBar() with all parameters set to customise the order of docking. Best Regards Raj
                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups