本文整理汇总了C++中CGeorgesEditDoc类的典型用法代码示例。如果您正苦于以下问题:C++ CGeorgesEditDoc类的具体用法?C++ CGeorgesEditDoc怎么用?C++ CGeorgesEditDoc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGeorgesEditDoc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPredefToDocument
void CTypeDialog::setPredefToDocument ()
{
CGeorgesEditDoc *doc = View->GetDocument ();
if (doc)
{
CGeorgesEditDocSub *current = doc->getSelectedObject ();
CString str;
// Add the predef
vector<vector<string> > stringVector;
stringVector.resize (Predef.ListCtrl.GetItemCount());
uint predef;
for (predef=0; predef<(uint)Predef.ListCtrl.GetItemCount(); predef++)
{
stringVector[predef].resize (2);
// Add the label and value
str = Predef.ListCtrl.GetItemText (predef, 0);
stringVector[predef][0] = (const char*)str;
str = Predef.ListCtrl.GetItemText (predef, 1);
stringVector[predef][1] = (const char*)str;
}
doc->modify (new CActionStringVectorVector (IAction::TypePredef, stringVector, *doc,
doc->getLeftView ()->getCurrentSelectionId (), 0));
}
}
示例2: GetDocument
void CLeftView::OnDelete()
{
// Get tree selection
HTREEITEM item = TreeCtrl.GetSelectedItem ();
if (item)
{
// Edit the label ?
CEdit *edit = TreeCtrl.GetEditControl();
if (edit)
{
edit->SetWindowText ("");
}
else
{
// Get the sub object
CGeorgesEditDocSub *subObject = (CGeorgesEditDocSub*)TreeCtrl.GetItemData (item);
if (subObject)
{
// Editable ?
if (subObject->isEditable ())
{
// Get some information about the current node
bool deleteInsert = false;
// Is a form child ?
CGeorgesEditDocSub *parent = subObject->getParent ();
if (parent && parent->getType () == CGeorgesEditDocSub::Form)
{
// Does the node in the same form ?
CGeorgesEditDoc *doc = GetDocument ();
if (doc)
{
// Get the parent node
const CFormDfn *parentDfn;
uint indexDfn;
const CFormDfn *nodeDfn;
const CType *nodeType;
CFormElm *parentNode;
UFormDfn::TEntryType type;
bool array;
bool parentVDfnArray;
CForm *form=doc->getFormPtr ();
CFormElm *elm = (CFormElm *)doc->getRootNode (subObject->getSlot ());
nlverify ( elm->getNodeByName (parent->getFormName ().c_str (), &parentDfn, indexDfn,
&nodeDfn, &nodeType, &parentNode, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Is a non empty array ?
if (array && parentNode)
{
// Document modified
doc->modify (new CActionBuffer (IAction::FormArrayDelete, NULL, 0, *doc, subObject->getFormName ().c_str (),
toString (subObject->getIdInParent ()).c_str (), doc->getLeftView ()->getCurrentSelectionId (), subObject->getSlot ()));
}
}
}
}
}
}
}
}
示例3: OnEditUndo
void CLeftView::OnEditUndo()
{
CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
if (doc)
{
doc->OnEditUndo();
}
}
示例4: OnUpdateEditUndo
void CLeftView::OnUpdateEditUndo(CCmdUI* pCmdUI)
{
CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
if (doc)
{
doc->OnUpdateEditUndo(pCmdUI) ;
}
}
示例5:
void CLeftView::OnEditFetch3()
{
CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
if (doc)
{
if (doc->isForm ())
((CGeorgesEditDocForm*)doc)->OnEditFetch3();
}
}
示例6: GetRightPane
void CChildFrame::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
CMDIChildWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);
// Get the doc
CGeorgesEditDoc* pDoc = GetRightPane()->GetDocument();
if (pDoc)
{
pDoc->onActivateView ((bActivate==TRUE));
}
}
示例7: setTypeToDocument
void CTypeDialog::setTypeToDocument ()
{
CGeorgesEditDoc *doc = View->GetDocument ();
if (doc)
{
CGeorgesEditDocSub *current = doc->getSelectedObject ();
doc->modify (new CActionString (IAction::TypeType, toString (ComboType.GetCurSel ()).c_str (), *doc,
"", "", doc->getLeftView ()->getCurrentSelectionId (), 0));
}
}
示例8: update
void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const char *_FormName)
{
// Right and left view
CGeorgesEditView *rightView = doc.getRightView ();
nlassert (rightView);
CLeftView *leftView = doc.getLeftView ();
nlassert (leftView);
// Update left view ?
if (updateLeftView)
doc.updateDocumentStructure ();
// Set the current view..
uint subSelection = leftView->getCurrentSelectionId ();
if (subSelection != _SelId)
{
doc.changeSubSelection (_SelId, NULL);
return;
}
if (leftView->getCurrentSelectionId () == 1)
{
rightView->HeaderDialog.getFromDocument (*doc.getHeaderPtr ());
}
else if (doc.isType ())
{
rightView->TypeDialog.getFromDocument (*(doc.getTypePtr()));
}
else if (doc.isDfn ())
{
rightView->DfnDialog.getFromDocument (*(doc.getDfnPtr()));
}
else if (doc.isForm ())
{
if (rightViewFlag == DoNothing)
{
}
else if (rightViewFlag == UpdateLabels)
{
rightView->FormDialog.updateLabels ();
}
else if (rightViewFlag == UpdateValues)
{
rightView->FormDialog.updateValues ();
}
else if (rightViewFlag == Redraw)
{
rightView->FormDialog.getFromDocument ();
}
}
}
示例9: setIncrementToDocument
void CTypeDialog::setIncrementToDocument ()
{
CGeorgesEditDoc *doc = View->GetDocument ();
if (doc)
{
CGeorgesEditDocSub *current = doc->getSelectedObject ();
CString str;
Increment.UpdateData ();
Increment.GetWindowText (str);
doc->modify (new CActionString (IAction::TypeIncrement, str, *doc, "", "",
doc->getLeftView ()->getCurrentSelectionId (), 0));
}
}
示例10: setUIToDocument
void CTypeDialog::setUIToDocument ()
{
CGeorgesEditDoc *doc = View->GetDocument ();
if (doc)
{
CGeorgesEditDocSub *current = doc->getSelectedObject ();
int curSel = ComboUIType.GetCurSel ();
if (curSel != CB_ERR)
{
curSel = (CType::TUI)ComboUIType.GetItemData (curSel);
}
else
{
curSel = CType::Edit;
}
doc->modify (new CActionString (IAction::TypeUI, toString (curSel).c_str (), *doc, "", "",
doc->getLeftView ()->getCurrentSelectionId (), 0));
}
}
示例11: PreTranslateMessage
BOOL CLeftView::PreTranslateMessage(MSG* pMsg)
{
if (theApp.m_pMainWnd->PreTranslateMessage(pMsg))
return TRUE;
// Key ?
if (pMsg->message == WM_KEYDOWN)
{
// Tabulation ?
if ((int) pMsg->wParam == VK_TAB)
{
CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
if (doc)
{
// Right view ?
CGeorgesEditView* pView = doc->getRightView ();
if (pView->isFocusable ())
{
doc->switchToView (pView);
// Shift ?
if (GetAsyncKeyState (VK_SHIFT) & (1<<15))
pView->setFocusLastWidget ();
}
}
return TRUE;
}
else if ((int) pMsg->wParam == VK_INSERT)
{
OnInsert ();
return TRUE;
}
else if ((int) pMsg->wParam == VK_DELETE)
{
OnDelete ();
return TRUE;
}
}
return CView::PreTranslateMessage(pMsg);
}
示例12: OnEditPaste
void CLeftView::OnEditPaste()
{
CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
if (doc)
{
// What is selected ?
HTREEITEM item = TreeCtrl.GetSelectedItem ();
if (item != NULL)
{
// Edit the label ?
CEdit *edit = TreeCtrl.GetEditControl();
if (edit)
{
edit->SendMessage (WM_PASTE);
}
else
{
// Get the sub data
CGeorgesEditDocSub *subData = (CGeorgesEditDocSub*)TreeCtrl.GetItemData (item);
if (subData)
{
// Get thte node type
CGeorgesEditDocSub::TSub subType = subData->getType ();
// Good type for copy ?
if (subType == CGeorgesEditDocSub::Form)
{
// Document is modified by this view
if (theApp.FillMemStreamWithClipboard (subData->getFormName ().c_str(), doc, subData->getSlot ()))
{
doc->modify (new CActionBuffer (IAction::FormPaste, theApp.MemStream.buffer (), theApp.MemStream.length(),
*doc, subData->getFormName ().c_str(), "", doc->getLeftView ()->getCurrentSelectionId (), subData->getSlot ()));
}
}
}
}
}
}
}
示例13: AFX_MANAGE_STATE
// ---------------------------------------------------------------------------
void CGeorgesImpl::LineDown ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CMainFrame* pWnd = dynamic_cast< CMainFrame* >( theApp.m_pMainWnd );
CMDIChildWnd *pChild = pWnd->MDIGetActive ();
if (pChild == NULL) return;
// Get active document
CGeorgesEditDoc *doc = (CGeorgesEditDoc *)pChild->GetActiveDocument ();
if (doc)
{
// Get the left view
CLeftView* pView = doc->getLeftView ();
// Check type
CGeorgesEditDocSub *subDoc = doc->getSelectedObject ();
if (subDoc)
{
// Get the node
const CFormDfn *parentDfn;
uint indexDfn;
const CFormDfn *nodeDfn;
const CType *nodeType;
CFormElm *node;
UFormDfn::TEntryType type;
bool array;
bool parentVDfnArray;
CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Is a type entry ?
if ( (type == UFormDfn::EntryType) && !array )
{
// Select next
if ((subDoc->getIdInParent ()+1) < subDoc->getParent ()->getChildrenCount ())
doc->changeSubSelection (subDoc->getParent ()->getChild (subDoc->getIdInParent ()+1), pView);
}
}
}
}
示例14: IAction
CActionStringVectorVector::CActionStringVectorVector (IAction::TTypeAction type, const std::vector<std::vector<std::string> > &stringVector,
CGeorgesEditDoc &doc, uint selId, uint slot) : IAction (type, selId, slot)
{
// Set the new value
_NewValue = stringVector;
// Backup old value
switch (_Type)
{
case DfnStructure:
{
// Dfn
const NLGEORGES::CFormDfn &dfn = *(doc.getDfnPtr ());
// Add the struct element
_OldValue.resize (dfn.getNumEntry ());
uint elm;
for (elm=0; elm<_OldValue.size (); elm++)
{
// Resize the entry
_OldValue[elm].resize (5);
// Add the label and value
_OldValue[elm][0] = dfn.getEntry (elm).getName ();
switch (elm, dfn.getEntry (elm).getType ())
{
case UFormDfn::EntryType:
_OldValue[elm][1] = dfn.getEntry (elm).getArrayFlag () ? "Type array" : "Type";
_OldValue[elm][4] = dfn.getEntry (elm).getFilenameExt ();
break;
case UFormDfn::EntryDfn:
_OldValue[elm][1] = dfn.getEntry (elm).getArrayFlag () ? "Dfn array" : "Dfn";
break;
case UFormDfn::EntryVirtualDfn:
_OldValue[elm][1] = "Virtual Dfn";
break;
}
_OldValue[elm][2] = dfn.getEntry (elm).getFilename ();
_OldValue[elm][3] = dfn.getEntry (elm).getDefault ();
}
setLabel ("Dfn Structure", doc);
}
break;
case TypePredef:
{
// Type
const NLGEORGES::CType &type = *(doc.getTypePtr ());
uint predef;
_OldValue.resize (type.Definitions.size());
for (predef=0; predef<_OldValue.size(); predef++)
{
// Add the label and value
_OldValue[predef].resize (2);
_OldValue[predef][0] = type.Definitions[predef].Label;
_OldValue[predef][1] = type.Definitions[predef].Value;
}
setLabel ("Type Predef", doc);
}
break;
}
}
示例15: doAction
bool IAction::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime)
{
uint index = (uint)redo;
doc.logValueChange (_LogLabel.c_str (), _Log[index].c_str (), _LogPresent[index]);
return true;
}