Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Icon for Cut, Copy,Paste
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Icon for Cut, Copy,Paste

 Post Reply Post Reply
Author
Message
KumarCJ View Drop Down
Groupie
Groupie
Avatar

Joined: 02 April 2007
Location: India
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote KumarCJ Quote  Post ReplyReply Direct Link To This Post Topic: Icon for Cut, Copy,Paste
    Posted: 23 April 2007 at 6:53am
Hi,
 
I am using Code jock 10.4.2 in our application.
 
I have used following line of code to create Menu and toolbar and for Setting the xtpThemeOffice2003 Theam.
 
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 
m_wndMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
 if(m_wndMenuBar == NULL)
    {
        TRACE0("Failed to create menu bar.\n");
        return -1;      // fail to create
    }
 m_wndMenuBar->SetFlags(xtpFlagAddMDISysPopup);
 
 // Create ToolBar
    m_wndToolBar = (CMCToolBar *) pCommandBars->
                  Add(_T   (g_cmcstandard), xtpBarTop);

    if (!m_wndToolBar || !m_wndToolBar->LoadToolBar(IDR_MAINFRAMELO))
    {
        TRACE0("Failed to create toolbar\n");
        return -1;
    }
 
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
 
}
 
The Issue is that, When I am clicking on "Edit" menu, for Cut, Copy, Paste the image and Ctrl+X, Ctrl+C, Ctrl+V, is not displaying.
 
Please help me out.
 
Thanks,
KumarCJ
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2007 at 7:57am
Hi,
 
Add toolbar resource, add buttons for cut, paste, copy
 
call
pCommandBars->GetImageManager()->SetIcons(IDR_YOURBAR);
 
to set icons.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
KumarCJ View Drop Down
Groupie
Groupie
Avatar

Joined: 02 April 2007
Location: India
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote KumarCJ Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2007 at 2:36am
Hi,
 
Thanks for your reply, my concern is below:
 
The Edit menu looks like below
 
Cut       ctrl+x
Copy    ctrl+c
Paste   ctrl+v
 
But for the edit menu, system is displaying
 
Cut       square box in front of Cut
Copy    square box in front of Copy
Paste   square box in front of Paste
 
it is not displaying, ctrl+x, ctrl+c, ctrl+v for Cut, Copy, Paste.
 
I checked with privious version of application exe, the issue is "Edit" menu is not able expand to it full extend and some thing happening with one more menu.
 
 
pls let me why this is happening.
 
Here is the code what i had added for Code jock 10.4.2
 
int CMainFrame::OnCreate()
{
   // Initialize the command bars
   if (!InitCommandBars())
   return -1;
   // Get Commandbar
   CXTPCommandBar* pCommandBars = GetCommandBars();
   // Create MenuBar using CXTPMenuBar*
   CXTPMenuBar* m_wndMenuBar = pCommandBars->SetMenu(_T("Menu Bar"),  IDR_MAINFRAME);
  if(m_wndMenuBar == NULL)
  {
       TRACE0("Failed to create menu bar.\n");
       return -1;      // fail to create
  }
  m_wndMenuBar->SetFlags(xtpFlagAddMDISysPopup);
 
// Create ToolBar
    CXTPToolBar* m_wndToolBar = (CMCToolBar *) pCommandBars->Add(_T(g_cmcstandard), xtpBarTop);
    if (!m_wndToolBar || !m_wndToolBar->LoadToolBar(IDR_MAINFRAMELO))
    {
        TRACE0("Failed to create toolbar\n");
        return -1;
    }
 
m_wndToolBar->EnableDocking(xtpFlagAlignAny | xtpFlagFloating);
 EnableDocking(CBRS_ALIGN_ANY);
 
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
}
 
 
Is i need add something which is going to expand the menu to its full extend?
 
waiting for your reply.
 
Thanks,
Saket Kumar.
 
 
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2007 at 7:11am
Hi,
 
Call pCommandBars->GetShortcutManager()->SetAccelerators(IDR_RESOURCE);
where IDR_RESOURCE is accelerator table from your resources. (Check that it has accelerators for Cut/Copy etc)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
KumarCJ View Drop Down
Groupie
Groupie
Avatar

Joined: 02 April 2007
Location: India
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote KumarCJ Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2007 at 8:27am
Thank you very much Oleg.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.