--- as_assist.cpp 2002/11/26 19:41:17 1.23
+++ as_assist.cpp 2002/11/26 20:25:16 1.24
@@ -257,52 +257,54 @@
pEditpopup->insertSeparator();
pEditpopup->insertItem("Preferences...", this, SLOT(configPrefs()));
- // Construct the view menu
- QPopupMenu *pViewpopup = new QPopupMenu(this);
- QPopupMenu *pTbarspopup = new QPopupMenu(this);
- pTbarspopup->insertTearOffHandle();
- pTbarspopup->setCheckable(true);
- QPopupMenu *pColspopup = new QPopupMenu(this);
- pColspopup->insertTearOffHandle();
- pColspopup->setCheckable(true);
+ // Construct the view menu and submenus
+ m_pViewpopup = new QPopupMenu(this);
+ m_pTbarspopup = new QPopupMenu(this);
+ m_pColspopup = new QPopupMenu(this);
+
+ // Give the new menus krass attributes
+ m_pTbarspopup->insertTearOffHandle();
+ m_pTbarspopup->setCheckable(true);
+ m_pColspopup->insertTearOffHandle();
+ m_pColspopup->setCheckable(true);
// Major sanity check wrapped in one call
- if (!(pViewpopup && pTbarspopup && pColspopup))
+ if (!(m_pViewpopup && m_pTbarspopup && m_pColspopup))
throw Genexcept("Main window view popups creation failed.");
// Populate the view menu with subitems
- m_pMenubar->insertItem(trUtf8("&View"), pViewpopup);
- pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
- nMenuid = pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
- pViewpopup->setItemEnabled(nMenuid, false);
- pViewpopup->insertSeparator();
- pViewpopup->insertItem(trUtf8("&Toolbars"), pTbarspopup);
- nMenuid = pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar()));
- pTbarspopup->setItemChecked(nMenuid, true);
- nMenuid = pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar()));
- pTbarspopup->setItemChecked(nMenuid, true);
- nMenuid = pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar()));
- pTbarspopup->setItemChecked(nMenuid, true);
- pViewpopup->insertSeparator();
- pViewpopup->insertItem(trUtf8("&Columns"), pColspopup);
- nMenuid = pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol()));
- pColspopup->setItemEnabled(nMenuid, false);
- nMenuid = pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol()));
- pColspopup->setItemEnabled(nMenuid, false);
+ m_pMenubar->insertItem(trUtf8("&View"), m_pViewpopup);
+ m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
+ nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
+ m_pViewpopup->setItemEnabled(nMenuid, false);
+ m_pViewpopup->insertSeparator();
+ m_pViewpopup->insertItem(trUtf8("&Toolbars"), m_pTbarspopup);
+ nMenuid = m_pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar()));
+ m_pTbarspopup->setItemChecked(nMenuid, true);
+ nMenuid = m_pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar()));
+ m_pTbarspopup->setItemChecked(nMenuid, true);
+ nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar()));
+ m_pTbarspopup->setItemChecked(nMenuid, true);
+ m_pViewpopup->insertSeparator();
+ m_pViewpopup->insertItem(trUtf8("&Columns"), m_pColspopup);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
+ nMenuid = m_pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol()));
+ m_pColspopup->setItemEnabled(nMenuid, false);
// Pad spacing to force help menu to appear far right
m_pMenubar->insertSeparator();
@@ -331,6 +333,8 @@
if (m_pFiletools == NULL) // Sanity check
throw Genexcept("File tool bar creation failed.");
m_pFiletools->setLabel(trUtf8("File Ops"));
+ m_pFiletools->setOpaqueMoving(true);
+ m_pFiletools->setCloseMode(QDockWindow::Never);
m_pFilenewact->addTo(m_pFiletools);
m_pFileopenact->addTo(m_pFiletools);
m_pFilesaveact->addTo(m_pFiletools);
@@ -340,6 +344,8 @@
if (m_pEdittools == NULL) // Sanity check
throw Genexcept("Edit tool bar creation failed.");
m_pEdittools->setLabel(trUtf8("Edit Ops"));
+ m_pEdittools->setOpaqueMoving(true);
+ m_pEdittools->setCloseMode(QDockWindow::Never);
m_pCutact->addTo(m_pEdittools);
m_pCopyact->addTo(m_pEdittools);
m_pPasteact->addTo(m_pEdittools);
@@ -352,6 +358,8 @@
if (m_pWhatstools == NULL) // Sanity check
throw Genexcept("Whats this tool bar creation failed.");
m_pWhatstools->setLabel(trUtf8("Whats this"));
+ m_pWhatstools->setOpaqueMoving(true);
+ m_pWhatstools->setCloseMode(QDockWindow::Never);
QWhatsThis::whatsThisButton(m_pWhatstools); // Preconfigured whats this button
}
|