Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CMainFrame isn't activated my IDR_MAINFRAME accelerator Collapse All
Subject Author Date
JunSung Kwon Dec 26, 2010 - 11:37 PM

Hi everyone~


I had used 2.54 version of ProfiUIS. I  had made my project SDI.


In these days I contact the problem.


My program is not activated the accelerator. Why? :(


I don’t know how to deal.  I show the code below-related part I think


this is my MainFrame.h header.


class CMainFrame //: //public CFrameWnd//, public CExtDynamicBarSite

 : public CExtNCW < CFrameWnd >

   #if (!defined __EXT_MFC_NO_CUSTOMIZE )

   , public CExtCustomizeSite

   #endif // (!defined __EXT_MFC_NO_CUSTOMIZE)

{

 void _ConfigureCustomizeSite();

 bool _IsInitialized;


this is my MainFrame.cpp OnCreate


 


if( CExtNCW < CFrameWnd > :: OnCreate( lpCreateStruct ) == -1 )

  return -1;


 




CWinApp * pApp = ::AfxGetApp();

 ASSERT( pApp != NULL );

 ASSERT( pApp->m_pszRegistryKey != NULL );

 ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );

 ASSERT( pApp->m_pszProfileName != NULL );

 ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );

 pApp;


 

 VERIFY(

  g_CmdManager->ProfileSetup(

   pApp->m_pszProfileName, // __PROF_UIS_PROJECT_CMD_PROFILE_NAME,

   GetSafeHwnd()

   )

  );

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

 VERIFY(

  g_CmdManager->UpdateFromMenu(

   pApp->m_pszProfileName, // __PROF_UIS_PROJECT_CMD_PROFILE_NAME,

   IDR_MAINFRAME

   )

  );


 


 

 

 if( ! m_wndView.Create(

   this,

   CRect( 0,0,0,0 ),

   UINT( AFX_IDW_PANE_FIRST ),

   WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN

   //WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN

   )

  )

 {

  TRACE0("Failed to create view window\n");

  return -1;

 }

 m_wndView.AddPages();

 m_wndView.OrientationSet(__ETWS_ORIENT_LEFT);

 //PROJTYPE_MDI

 if( !m_wndMenuBar.Create(

   NULL, // _T("Menu Bar"),

   this,

   ID_VIEW_MENUBAR,

   WS_CHILD|WS_VISIBLE

    |CBRS_TOP|CBRS_TOOLTIPS|CBRS_GRIPPER

    |CBRS_TOOLTIPS

    |CBRS_FLYBY

    |CBRS_SIZE_DYNAMIC

    |CBRS_HIDE_INPLACE

    )

  )

    {

        TRACE0("Failed to create menubar\n");

        return -1;      // failed to create

    }




 if (!m_wndStatusBar.Create(this) ||

  !m_wndStatusBar.SetIndicators(indicators,

    sizeof(indicators)/sizeof(UINT)))

 {

  TRACE0("Failed to create status bar\n");

  return -1;      // fail to create

 }




 if( !m_wndDrawingToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_FEATURE,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndDrawingToolBar.LoadToolBar( IDR_DRAWING_TOOL )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }


 if( !m_wndToolToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_MEASURE,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndToolToolBar.LoadToolBar( IDR_TOOL_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }




UINT g_arrResetTextIDs[] =

{

 ID_POINT, ID_LINE, ID_ARC, ID_CIRCLE, ID_ELLIPSE,


 ID_TOOL_CROSSHAIR, ID_TOOL_EDGE, ID_TOOL_CIRCLE,

 ID_TOOL_ARC, ID_TOOL_ELLIPSE,ID_TOOL_RECTANGLE, ID_TOOL_LINEWIDTH, ID_TOOL_AREA,

 ID_TOOL_CONTOURTOOL, ID_TOOL_AUTOFOCUS, ID_TOOL_ANYCIRCLETOOL, ID_TOOL_EDGEOVERLAY,

 

 ID_FEATURE_LINEINTERSECTION, ID_FEATURE_OFFSET, ID_FEATURE_PROJECTION, ID_FEATURE_REFLECTION,

 ID_FEATURE_ROTATION, ID_FEATURE_PARALLELLINE, ID_FEATURE_BISECTION,


 ID_MEASURE_3DPOINT, ID_MEASURE_3DLINE, ID_MEASURE_3DDISTANCE, ID_MEASURE_3DANGLE, ID_MEASURE_3DPLANE,


 ID_LASER_SCANPOINT, ID_LASER_SCANLINE, ID_LASER_SCANAREA,


 ID_SETTINGS_CALIBRATION, ID_SETTINGS_CHANGEORIGIN, ID_SETTINGS_CHANGEAXIS, ID_SETTINGS_COORDINATEPLANE,


 ID_MEASURE_POINT, ID_MEASURE_LINE, ID_MEASURE_CIRCLE, ID_MEASURE_ELLIPSE, ID_MEASURE_RECTANGLE,

 ID_MEASURE_DISTANCE, ID_MEASURE_ANGLE, ID_MEASURE_LINEWIDT, ID_MEASURE_HEIGHT, ID_MEASURE_AREA, ID_MEASURE_ANGLEFROMLINE,

 ID_MEASURE_CIRCULARITY, ID_MEASURE_CENTEREDNESS, ID_MEASURE_STRAIGHTNESS,

 ID_MEASURE_FLATNESS, ID_MEASURE_PARALLELNESS, ID_MEASURE_STATISTICS, ID_MEASURE_CALCULATION

};

 for( int i = 0; i < sizeof(g_arrResetTextIDs)/sizeof(g_arrResetTextIDs[0]); i++ )

 {

  CExtCmdItem * pCmdItem =

   g_CmdManager->CmdGetPtr(

    pApp->m_pszProfileName,

    g_arrResetTextIDs[i]

    );

  if(pCmdItem) {

   ASSERT( pCmdItem != NULL );

   //pCmdItem->m_sToolbarText = pCmdItem->m_sMenuText;

   pCmdItem->m_sTipTool = pCmdItem->m_sMenuText;

  }

 }


 if( !m_wndMeasureToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_RELATION,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndMeasureToolBar.LoadToolBar( IDR_MEASURE_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }


 if( !m_wndIndirectToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_TRANSFORMATION,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndIndirectToolBar.LoadToolBar( IDR_INDIRECTFEATURE_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }




 if( !m_wnd3DMeasureToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_3D,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wnd3DMeasureToolBar.LoadToolBar( IDR_3DMEASURE_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }


 if( !m_wndOptionToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_AXIS,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndOptionToolBar.LoadToolBar( IDR_OPTION_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }


 if( !m_wndLaserToolBar.Create(

   NULL, // _T("Drawing Tool Toolbar"),

   this,

   ID_TOOLBARS_LASER,

   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC

    | CBRS_TOOLTIPS

     | CBRS_HIDE_INPLACE

   ) ||

  !m_wndLaserToolBar.LoadToolBar( IDR_LASER_TOOLBAR )

  )

 {

  TRACE0("Failed to create toolbar\n");

  return -1;      // fail to create

 }


 CreateCommandBar();


 m_wndView.PageSelectionSet(0);


 Create3DBar();


 CreateListBar();


 CreateSelectedListBar();


 CreateCurrentInfoBar();

 CreateObjectInfoBar();


 CreatePartProgramBar();


 CreateQuickMenuBar();


 if( ((CXiLaser3DApp*)pApp)->m_bSamsungScale ) {

  CreateStatisticsBar();

 }


 CreateMoveLightBar();


 CreateDXFimportBar();


 m_wndMenuBar.EnableDocking( CBRS_ALIGN_ANY );

 m_wndResizableCommandBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndDrawingToolBar.EnableDocking( CBRS_ALIGN_ANY );


 m_wndToolToolBar.EnableDocking( CBRS_ALIGN_ANY );


 m_wndMeasureToolBar.EnableDocking( CBRS_ALIGN_ANY );


 m_wndIndirectToolBar.EnableDocking( CBRS_ALIGN_ANY );


 m_wnd3DMeasureToolBar.EnableDocking( CBRS_ALIGN_ANY );


 m_wndOptionToolBar.EnableDocking( CBRS_ALIGN_ANY );

 m_wndLaserToolBar.EnableDocking( CBRS_ALIGN_ANY );




 m_wnd3DBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndListBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndSelectedListBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndCurrentInfoBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndObjectInfoBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndPartProgramBar.EnableDocking(CBRS_ALIGN_ANY);


 m_wndQuickMenuBar.EnableDocking(CBRS_ALIGN_ANY);


 if(( ((CXiLaser3DApp*)pApp)->m_bSamsungScale )) {

  m_wndStatisticsBar.EnableDocking(CBRS_ALIGN_ANY);

 }

 

 m_wndMoveLightBar.EnableDocking(CBRS_ALIGN_ANY);

 m_wndDXFimportBar.EnableDocking(CBRS_ALIGN_ANY);


 if( !CExtControlBar::FrameEnableDocking(this) )

 {

  ASSERT( FALSE );

  return -1;

 }


 


 // Enable autohide feature for resizable control bars

 //VERBOSE

 if( !CExtControlBar::FrameInjectAutoHideAreas(this) )

 {

  ASSERT( FALSE );

  return -1;

 }

 DockControlBar( &m_wndMenuBar );




 m_wndResizableCommandBar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,2,this,true);

 m_wnd3DBar.SetInitDesiredSizeVertical( CSize(0,30) );

 m_wnd3DBar.SetInitDesiredSizeFloating( CSize(30,20) );

 m_wnd3DBar.DockControlBar(AFX_IDW_DOCKBAR_LEFT,1,this,false);


 m_wndQuickMenuBar.SetInitDesiredSizeVertical( CSize(310,30) );

 m_wndQuickMenuBar.SetInitDesiredSizeFloating( CSize(200,30) );

 m_wndQuickMenuBar.DockControlBar(AFX_IDW_DOCKBAR_LEFT,1,this,false);


 m_wndCurrentInfoBar.SetInitDesiredSizeVertical( CSize(310,30) );

 m_wndCurrentInfoBar.SetInitDesiredSizeFloating( CSize(200,30) );

 m_wndCurrentInfoBar.DockControlBar(AFX_IDW_DOCKBAR_LEFT,1,this,false); 


 m_wndListBar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,2,this, false);

 m_wndObjectInfoBar.DockControlBarLTRB(50, &m_wndListBar,AFX_IDW_DOCKBAR_RIGHT);

 m_wndDXFimportBar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,2,this, false);


 if(( ((CXiLaser3DApp*)pApp)->m_bSamsungScale )) {

  m_wndStatisticsBar.DockControlBar(AFX_IDW_DOCKBAR_LEFT,2,this,false);

 }


 m_wndMoveLightBar.DockControlBar(AFX_IDW_DOCKBAR_LEFT,2,this, false);


 

 m_wndPartProgramBar.SetInitDesiredSizeVertical( CSize(265,80) ); //가로,세로

 m_wndPartProgramBar.SetInitDesiredSizeFloating( CSize(215,100) );

 m_wndPartProgramBar.DockControlBar(AFX_IDW_DOCKBAR_RIGHT,1,this, false);


 m_wndSelectedListBar.DockControlBarLTRB(80, &m_wndPartProgramBar,AFX_IDW_DOCKBAR_BOTTOM);


 DockControlBar( &m_wndDrawingToolBar, AFX_IDW_DOCKBAR_TOP );  //2개의 툴바를 나란히

 CRect DrawingRect;


 m_wndDrawingToolBar.GetWindowRect(&DrawingRect);

 DrawingRect.OffsetRect(20,20);

 

 DockControlBar(&m_wndToolToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 m_wndToolToolBar.GetWindowRect(&DrawingRect);

 DrawingRect.OffsetRect(20,10);


 DockControlBar(&m_wndMeasureToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 DockControlBar(&m_wndIndirectToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 DrawingRect.OffsetRect(20,0);

 DockControlBar(&m_wnd3DMeasureToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 DrawingRect.OffsetRect(20,0);

 DockControlBar(&m_wndOptionToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 DrawingRect.OffsetRect(20,0);

 DockControlBar(&m_wndLaserToolBar,AFX_IDW_DOCKBAR_TOP, &DrawingRect );


 


static UINT statBasicCommands[] =

{


 ID_APP_EXIT,

 ID_APP_ABOUT,

 

 ID_VIEW_MEASURE_BAR,

 ID_VIEW_FUNCTION_BAR,

 ID_VIEW_COMMAND_BAR,

 ID_VIEW_LISTBAR,




 

 0 // end of commands list

};


 


 


 #if (!defined __EXT_MFC_NO_CUSTOMIZE)

  


  VERIFY(

   CExtCustomizeSite::MenuInfoLoadAccelTable(

    _T("Default"),

    IDR_MAINFRAME

    )

   );


  if( !CExtCustomizeSite::EnableCustomization(

    this,

    __ECSF_DEFAULT

    )

   )

  {

   ASSERT( FALSE );

   return -1;

  }

 


  DockControlBar( &m_wndMenuBar );

  RecalcLayout();

 #endif // (!defined __EXT_MFC_NO_CUSTOMIZE)


  if( !CExtControlBar::ProfileBarStateLoad(

    this,

    pApp->m_pszRegistryKey,

    pApp->m_pszProfileName,

    pApp->m_pszProfileName,

    &m_dataFrameWP

    )

   )

  {

   DockControlBar( &m_wndMenuBar );

  

   RecalcLayout();


  }

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

 SetTheme();


 DoSplash();


 LoadStageCalibration();


 m_wndMenuBar.UpdateMenuBar();




#ifdef _USBLOCKED

 SetTimer(1,1000,0);

#endif

  _IsInitialized = true;




 return 0;


This is MainFrame.cpp PreTranslateMessage


 if( m_wndMenuBar.TranslateMainFrameMessage(pMsg) )

  return TRUE;

 

 if(m_bUIFixed){

  if(pMsg->hwnd == m_wndPartProgramBar.GetSafeHwnd() ){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }


  if(pMsg->hwnd == m_wndMoveLightBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }

  if(pMsg->hwnd == this->m_wndSelectedListBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }


  if(pMsg->hwnd == this->m_wndObjectInfoBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }


  if(pMsg->hwnd == this->m_wnd3DBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }


  if(pMsg->hwnd == this->m_wndCurrentInfoBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK)

    return true;

   

  }

  

  if(pMsg->hwnd == this->m_wndListBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK){

    return true;

   }

  }


  if(pMsg->hwnd == this->m_wndResizableCommandBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK){

    return true;

   }

  }


  if(pMsg->hwnd == this->m_wndObjectInfoBar.GetSafeHwnd()){

   if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK){

    return true;

   }

  }

 }


 return CFrameWnd::PreTranslateMessage(pMsg);


 


Almost 3 days I try to find the solution. But I couln’t find it.


Please tell me what is caused this problem anything~


Thanks.