OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [common/] [win32/] [CellView.cpp] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
//===========================================================================
23
//#####DESCRIPTIONBEGIN####
24
//
25
// Author(s):   sdf
26
// Contact(s):  sdf
27
// Date:                1998/08/11
28
// Version:             0.01
29
// Purpose:     
30
// Description: Implementation of a the cell window view class
31
// Requires:    
32
// Provides:    
33
// See also:#include    
34
// Known bugs:  
35
// Usage:       
36
//
37
//####DESCRIPTIONEND####
38
//
39
//===========================================================================
40
 
41
#include "stdafx.h"
42
#include "ConfigTool.h"
43
#include "CellView.h"
44
#include "ControlView.h"
45
#include "ConfigItem.h"
46
#include "IntegerEdit.h"
47
#include "DoubleEdit.h"
48
#include "StringEdit.h"
49
#include "ComboEdit.h"
50
 
51
#include "CTUtils.h"
52
#include "ConfigToolDoc.h"
53
 
54
#include "resource.h"
55
 
56
#ifdef PLUGIN
57
  #define INCLUDEFILE "ide.guicommon.h" // for ID_EDIT_FINDAGAIN
58
  #include "IncludeSTL.h"
59
#endif
60
 
61
#ifdef _DEBUG
62
#define new DEBUG_NEW
63
#undef THIS_FILE
64
static char THIS_FILE[] = __FILE__;
65
#endif
66
 
67
/////////////////////////////////////////////////////////////////////////////
68
// CCellView
69
 
70
IMPLEMENT_DYNCREATE(CCellView, CView)
71
 
72
CCellView::CCellView():
73
  m_bComboSellPending(false)
74
{
75
  m_hInCell=NULL;
76
  m_pwndCell=NULL;
77
  m_GrayPen.CreatePen(PS_SOLID,1,RGB(192,192,192));
78
  CConfigTool::SetCellView(this);
79
}
80
 
81
CCellView::~CCellView()
82
{
83
    deleteZ(m_pwndCell);
84
    CConfigTool::SetCellView(0);
85
}
86
 
87
 
88
BEGIN_MESSAGE_MAP(CCellView, CView)
89
        //{{AFX_MSG_MAP(CCellView)
90
        ON_WM_LBUTTONDOWN()
91
        ON_WM_SIZE()
92
        ON_WM_CREATE()
93
        ON_WM_VSCROLL()
94
        ON_WM_MOUSEMOVE()
95
        ON_WM_MOUSEWHEEL()
96
    ON_COMMAND(ID_EDIT_FIND,OnEditFind)
97
    ON_COMMAND(ID_EDIT_FINDAGAIN,OnEditFindAgain)
98
        ON_UPDATE_COMMAND_UI(ID_EDIT_FINDAGAIN, OnUpdateEditFindAgain)
99
        ON_WM_RBUTTONDOWN()
100
        ON_UPDATE_COMMAND_UI(ID_EDIT_FIND, OnUpdateEditFind)
101
        ON_WM_ERASEBKGND()
102
        ON_COMMAND(ID_EDIT_COPY,   OnEditCopy)
103
        ON_COMMAND(ID_EDIT_CUT,    OnEditCut)
104
        ON_COMMAND(ID_EDIT_PASTE,  OnEditPaste)
105
        ON_COMMAND(ID_EDIT_CLEAR,  OnEditDelete)
106
        ON_UPDATE_COMMAND_UI(ID_EDIT_COPY,   OnUpdateEditCopy)
107
        ON_UPDATE_COMMAND_UI(ID_EDIT_CUT,    OnUpdateEditCut)
108
        ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE,  OnUpdateEditPaste)
109
        ON_UPDATE_COMMAND_UI(ID_EDIT_CLEAR,  OnUpdateEditDelete)
110
        ON_WM_HELPINFO()
111
    ON_MESSAGE(WM_CANCEL_EDIT,OnCancelEdit)
112
 
113
        //}}AFX_MSG_MAP
114
END_MESSAGE_MAP()
115
 
116
/////////////////////////////////////////////////////////////////////////////
117
// CCellView drawing
118
 
119
void CCellView::OnInitialUpdate()
120
{
121
        m_nFirstVisibleItem=0;
122
        CView::OnInitialUpdate();
123
}
124
 
125
void CCellView::OnDraw(CDC* pDC)
126
{
127
        CTreeCtrl &Tree=CConfigTool::GetControlView()->GetTreeCtrl();
128
 
129
        CConfigToolDoc* pDoc=CConfigTool::GetConfigToolDoc();
130
        if(pDoc->ItemCount()>0)
131
        {
132
                CRect rect;
133
                Tree.GetItemRect(Tree.GetRootItem(),rect,TRUE);
134
                m_nFirstVisibleItem=rect.top;
135
 
136
                CRect rcClient;
137
                GetClientRect(rcClient);
138
                CPen *pOldPen=pDC->SelectObject(&m_GrayPen);
139
                CFont *pOldFont=pDC->SelectObject(CConfigTool::GetControlView()->GetFont());
140
                pDC->SetBkMode(TRANSPARENT);
141
 
142
                CRect rcClip;
143
                pDC->GetClipBox(rcClip);
144
 
145
                CPtrArray arItems;
146
                int dy=CConfigTool::GetControlView()->GetItemHeight();
147
                int cy=0;
148
                for(HTREEITEM h=Tree.GetFirstVisibleItem();h;h=Tree.GetNextVisibleItem(h))
149
                {
150
                        if(cy>rcClip.bottom){
151
                                break;
152
                        }
153
 
154
                        CRect rcEdit(0,cy,rcClient.right,cy+dy);
155
                        cy+=dy;
156
 
157
                        pDC->MoveTo(rcClient.left,rcEdit.top);
158
                        pDC->LineTo(rcClient.right,rcEdit.top);
159
 
160
                        CConfigItem &ti=TI(h);
161
                        if(h!=m_hInCell){
162
        switch(ti.Type()){
163
                      case CConfigItem::Enum:
164
                                                // Using combobox
165
                                                rcEdit.left+=2;
166
                                                rcEdit.top+=2;
167
            // fall through
168
          case CConfigItem::Integer:
169
          case CConfigItem::Double:
170
          case CConfigItem::String:
171
                                                // Using editbox
172
                                                rcEdit.top+=2;
173
                                                rcEdit.left+=3;
174
            {
175
                                      CString str(ti.StringValue());
176
                                      // cell contents is greyed if the option is not both active and modifiable
177
                                      // or if a booldata item is not enabled
178
                                      const CdlValuable valuable = ti.GetCdlValuable();
179
                                      // check for a package explicitly because is_modifiable() returns true for a package
180
                                      pDC->SetTextColor (GetSysColor ((! valuable) || (valuable->is_modifiable () && valuable->is_active () && ((! ti.HasBool ()) || ti.IsEnabled ()) && ! ti.IsPackage ()) ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT));
181
                                      pDC->TextOut(rcEdit.left,rcEdit.top,str);
182
            }
183
            break;
184
          default:
185
            break;
186
        }
187
                        }
188
                }
189
                pDC->MoveTo(rcClient.left,cy);
190
                pDC->LineTo(rcClient.right,cy);
191
                pDC->SelectObject(pOldPen);
192
                pDC->SelectObject(pOldFont);
193
        }
194
}
195
 
196
/////////////////////////////////////////////////////////////////////////////
197
// CCellView diagnostics
198
 
199
#ifdef _DEBUG
200
void CCellView::AssertValid() const
201
{
202
        CView::AssertValid();
203
}
204
 
205
void CCellView::Dump(CDumpContext&      dc) const
206
{
207
        CView::Dump(dc);
208
}
209
#endif //_DEBUG
210
 
211
/////////////////////////////////////////////////////////////////////////////
212
// CCellView message handlers
213
 
214
void CCellView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
215
{
216
        switch(lHint)
217
        {
218
                case CConfigToolDoc::IntFormatChanged:
219
      {
220
                          for(HTREEITEM h=CConfigTool::GetControlView()->GetFirstVisibleItem();h;h=CConfigTool::GetControlView()->GetNextVisibleItem(h)){
221
                                  CConfigItem &ti=TI(h);
222
          if(ti.Type()==CConfigItem::Integer) {
223
                                          CRect rect;
224
                                          GetItemRect(h,rect);
225
                                          InvalidateRect(rect);
226
                                  }
227
                          }
228
        if(m_pwndCell && TI(m_hInCell).Type()==CConfigItem::Integer) {
229
                                  CString strData;
230
                                  m_pwndCell->GetWindowText(strData);
231
                                  ItemIntegerType n;
232
                                  CUtils::StrToItemIntegerType(strData,n);
233
          m_pwndCell->SetWindowText(CUtils::IntToStr(n,CConfigTool::GetConfigToolDoc()->m_bHex));
234
                          }
235
      }
236
                        break;
237
                case CConfigToolDoc::Clear:
238
                        deleteZ(m_pwndCell);
239
                        Invalidate();
240
                        UpdateWindow(); // This prevents cell view half of config pane still being displayed
241
      break;
242
                case CConfigToolDoc::ValueChanged:
243
                        {
244
                                CConfigItem *pti=(CConfigItem *)pHint;
245
                                CRect rect;
246
                                GetItemRect(pti->HItem(),rect);
247
                                InvalidateRect(rect);
248
                        }
249
                        break;
250
                case 0:
251
                        Invalidate();
252
                        break;
253
                default:
254
                        break;
255
        }
256
        UNUSED_ALWAYS(pSender);
257
}
258
 
259
void CCellView::GetItemRect(HTREEITEM h,CRect & rect) const
260
{
261
        CRect rcClient;
262
        GetClientRect(rcClient);
263
 
264
        CConfigTool::GetControlView()->GetItemRect( h, &rect, FALSE );
265
        rect.left=rcClient.left;
266
        rect.right=rcClient.right;
267
}
268
 
269
void CCellView::GetInCellRect(HTREEITEM h, CRect & rect, BOOL bDropped) const
270
{
271
        CConfigItem &ti=TI(h);
272
        GetItemRect(h,rect);
273
  switch(ti.Type()){
274
                case CConfigItem::Enum:
275
                        // Using combobox
276
      if(bDropped) {
277
        CStringArray arEnum;
278
        ti.EvalEnumStrings(arEnum);
279
        rect.bottom += (2+(int)arEnum.GetSize()-1)*rect.Height();
280
      }
281
      break;
282
    case CConfigItem::Integer:
283
    case CConfigItem::Double:
284
    case CConfigItem::String:
285
                        // Using editbox
286
                        //rect.bottom++;
287
                        //rect.DeflateRect(2,2); // To allow room  for the border we draw ourselves
288
      //rect.InflateRect(2,2);
289
      break;
290
    default:
291
      return;
292
  }
293
}
294
 
295
ItemIntegerType CCellView::GetCellValue() const
296
{
297
  // If the item is being edited in-cell, we'll get the data from the control
298
  ItemIntegerType rc=0;
299
  switch(TI(m_hInCell).Type()){
300
                case CConfigItem::Integer:
301
      {
302
        CString strData;
303
        m_pwndCell->GetWindowText(strData);
304
        if(!CUtils::StrToItemIntegerType(strData,rc)){
305
          rc=0;
306
        }
307
      }
308
      break;
309
    case CConfigItem::Enum:
310
    /*
311
    case CConfigItem::Boolean:
312
    case CConfigItem::Radio:
313
    //rc=((CTreeComboBox *)m_pwndCell)->GetCurSel();
314
    rc=((CComboEdit *)m_pwndCell)->GetCurSel();
315
    break;
316
      */
317
    case CConfigItem::String:
318
    default:
319
      int type=TI(m_hInCell).Type();
320
      UNUSED_ALWAYS(type);
321
      ASSERT(FALSE);
322
      break;
323
  }
324
  return rc;
325
}
326
 
327
void CCellView::CancelCellEdit(bool bApplyChanges)
328
{
329
  if(m_hInCell){
330
    CConfigItem &ti=TI(m_hInCell);
331
    if(bApplyChanges){
332
      CString strValue;
333
      m_pwndCell->GetWindowText(strValue);
334
      // Ignore empty strings in integer or floating cells - these are legal as intermediate values but not now
335
      if(strValue!=ti.StringValue() && (!strValue.IsEmpty() || (ti.Type()!=CConfigItem::Integer && ti.Type()!=CConfigItem::Double))){
336
        CConfigTool::GetConfigToolDoc()->SetValue (ti, strValue);
337
      }
338
    }
339
 
340
    deleteZ(m_pwndCell);
341
    m_hInCell=NULL;
342
  }
343
}
344
 
345
BOOL CCellView::InCell(HTREEITEM h)
346
{
347
  CancelCellEdit();
348
  if(h && TI(h).IsEnabled()){
349
    CConfigItem &ti=TI(h);
350
    // edit cell only if option is both active and modifiable
351
    const CdlValuable valuable = ti.GetCdlValuable();
352
    // check packages explicitly because is_modifiable() returns true for a package
353
    if ((! valuable) || (valuable->is_modifiable () && valuable->is_active () && ! ti.IsPackage ())){
354
      CRect rcEdit;
355
      GetItemRect(h,rcEdit);
356
      rcEdit.bottom++;
357
      switch(ti.Type()){
358
        case CConfigItem::Double:
359
          {
360
            double d;
361
            CUtils::StrToDouble(ti.StringValue(),d);
362
            m_pwndCell=new CDoubleEdit(d);
363
            m_pwndCell->Create(WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL, rcEdit, this, IDC_CELL);
364
          }
365
          break;
366
        case CConfigItem::Integer:
367
          {
368
            ItemIntegerType i;
369
            CUtils::StrToItemIntegerType(ti.StringValue(),i);
370
            m_pwndCell=new CIntegerEdit(i);
371
          }
372
          m_pwndCell->Create(WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL, rcEdit, this, IDC_CELL);
373
          break;
374
        case CConfigItem::String:
375
          {
376
            CStringEdit *pStringEdit=new CStringEdit(ti.StringValue());
377
            m_pwndCell=pStringEdit;
378
            m_pwndCell->Create(WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL, rcEdit, this, IDC_CELL);
379
            pStringEdit->EnableDoubleClickEdit(true,IDC_CT_EDIT);
380
          }
381
 
382
          break;
383
        case CConfigItem::Enum:
384
          {
385
            CStringArray arEnum;
386
            ti.EvalEnumStrings(arEnum);
387
            rcEdit.bottom += (2+(int)arEnum.GetSize()-1)*rcEdit.Height();
388
            m_pwndCell=new CComboEdit(ti.StringValue(),arEnum);
389
            m_pwndCell->Create(WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST, rcEdit, this, IDC_CELL);
390
          }
391
          break;
392
        default:
393
          return 0;
394
          break;
395
      }
396
      m_hInCell=h;
397
      m_pwndCell->SetFont(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
398
      m_pwndCell->SetFocus();
399
      m_pwndCell->GetWindowText(m_strInitialCell);
400
    }
401
  }
402
  return NULL!=m_hInCell;
403
}
404
 
405
void CCellView::OnLButtonDown(UINT nFlags, CPoint point)
406
{
407
    UNUSED_ALWAYS(nFlags);
408
        CTreeCtrl &Tree=CConfigTool::GetControlView()->GetTreeCtrl();
409
        CancelCellEdit();
410
        HTREEITEM h=HitTest();
411
        if(h){
412
                InCell(h);
413
                Tree.SelectItem(h);
414
        }
415
 
416
        // Relay to the splitter
417
        ClientToScreen(&point);
418
        GetParent()->ScreenToClient(&point);
419
        GetParent()->SendMessage(WM_LBUTTONDOWN,(WPARAM)nFlags,MAKELPARAM(point.x,point.y));
420
}
421
 
422
void CCellView::OnSize(UINT nType, int cx, int cy)
423
{
424
        CView::OnSize(nType, cx, cy);
425
        if(m_hInCell){
426
//sdf1          UpdateWindow();
427
                CRect rect;
428
    GetItemRect(m_hInCell,rect);
429
                m_pwndCell->MoveWindow(rect,TRUE);
430
        }
431
 
432
}
433
 
434
int CCellView::OnCreate(LPCREATESTRUCT lpCreateStruct)
435
{
436
        if (CView::OnCreate(lpCreateStruct) == -1)
437
                return -1;
438
 
439
        return 0;
440
}
441
 
442
 
443
 
444
BOOL CCellView::PreCreateWindow(CREATESTRUCT& cs)
445
{
446
        // TODO: Add your specialized code here and/or call the base class
447
        cs.style &= (~WS_BORDER);
448
        return CView::PreCreateWindow(cs);
449
}
450
 
451
void CCellView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
452
{
453
        CView::OnVScroll(nSBCode, nPos, pScrollBar);
454
        Sync();
455
}
456
 
457
void CCellView::Sync()
458
{
459
        CTreeCtrl &t=CConfigTool::GetControlView()->GetTreeCtrl();
460
        CRect rect;
461
        t.GetItemRect(t.GetRootItem(),rect,TRUE);
462
        int pos=rect.top;
463
 
464
        if(pos!=m_nFirstVisibleItem){
465
                ScrollWindow(0,pos-m_nFirstVisibleItem);
466
    UpdateWindow();
467
        }
468
}
469
 
470
 
471
void CCellView::OnMouseMove(UINT nFlags, CPoint point)
472
{
473
        // Relay the mouse event to the splitter
474
        ClientToScreen(&point);
475
        GetParent()->ScreenToClient(&point);
476
        GetParent()->SendMessage(WM_MOUSEMOVE,(WPARAM)nFlags,MAKELPARAM(point.x,point.y));
477
}
478
 
479
 
480
BOOL CCellView::OnMouseWheel(UINT, short zDelta, CPoint)
481
{
482
  UINT nScrollCode=((zDelta<0)?SB_LINEDOWN:SB_LINEUP);
483
  LPARAM lParam=(LPARAM)GetScrollBarCtrl(SB_VERT)->GetSafeHwnd();
484
  if(lParam){
485
    for(int i=0;i<abs(zDelta)/WHEEL_DELTA;i++){
486
      CConfigTool::GetControlView()->SendMessage(WM_VSCROLL,MAKEWPARAM(nScrollCode,0),lParam);
487
      Sync();
488
    }
489
  }
490
  return TRUE;
491
}
492
 
493
void CCellView::OnEditFind()
494
{
495
    CConfigTool::GetControlView()->OnEditFind();
496
}
497
 
498
void CCellView::OnEditFindAgain()
499
{
500
    CConfigTool::GetControlView()->OnEditFindAgain();
501
}
502
 
503
void CCellView::OnUpdateEditFindAgain(CCmdUI* pCmdUI)
504
{
505
    CConfigTool::GetControlView()->OnUpdateEditFindAgain(pCmdUI);
506
}
507
 
508
void CCellView::OnRButtonDown(UINT nFlags, CPoint point)
509
{
510
    UNUSED_ALWAYS(nFlags);
511
    // Make the r-click have an effect equivalent to that when on the control view part
512
    CControlView *pv=CConfigTool::GetControlView();
513
        HTREEITEM h=HitTest();
514
        if(h){
515
                pv->SelectItem(h);
516
    }
517
        // point is in client coords
518
        ClientToScreen(&point);
519
        pv->ShowPopupMenu(h,point);
520
}
521
 
522
void CCellView::OnUpdateEditFind(CCmdUI* pCmdUI)
523
{
524
    CConfigTool::GetControlView()->OnUpdateEditFind(pCmdUI);
525
}
526
 
527
BOOL CCellView::OnEraseBkgnd(CDC* pDC)
528
{
529
    /*
530
    static int x=3;
531
    const MSG *pMsg=GetCurrentMessage();
532
        WNDCLASS wndcls;
533
    if (::GetClassInfo(NULL, _T("AfxFrameOrView42ud"), &wndcls)){
534
        TRACE(_T("proc=%08x hbrBackground=%08x "),wndcls.lpfnWndProc,wndcls.hbrBackground);
535
    }
536
 
537
    TRACE(_T("msg=%d hWnd=%08x wParam=%08x lParam=%08x m_pfnSuper=%08x super=%08x\n"),
538
        pMsg->message,pMsg->hwnd, pMsg->lParam,pMsg->wParam,m_pfnSuper, GetSuperWndProcAddr());
539
    if(x){
540
        return CView::OnEraseBkgnd(pDC);
541
    }
542
    */
543
 
544
    // Work around bug apparently caused by SlickEdit
545
        CRect rcClient;
546
        pDC->GetClipBox(rcClient);
547
        pDC->FillSolidRect(rcClient,GetSysColor(COLOR_WINDOW));
548
 
549
        return TRUE;
550
}
551
 
552
BOOL CCellView::PreTranslateMessage(MSG* pMsg)
553
{
554
        CTreeCtrl &Tree=CConfigTool::GetControlView()->GetTreeCtrl();
555
    if(WM_KEYDOWN==pMsg->message){
556
                switch(pMsg->wParam){
557
            case VK_TAB:
558
                {
559
                        HTREEITEM h=Tree.GetSelectedItem();
560
                    if(h){
561
                                    if(0==(::GetKeyState(VK_SHIFT)&0x8000)){
562
                                            // Shift key not down
563
                            h=Tree.GetNextVisibleItem(h);
564
                        }
565
                        if(h){
566
                            CancelCellEdit();
567
                                Tree.SelectItem(h);
568
                            Tree.SetFocus();
569
                        } else {
570
                            MessageBeep (0xFFFFFFFF);
571
                        }
572
                        // Always handle this message to keep focus within the tree control
573
                        return true;
574
                    }
575
                }
576
                    }
577
    }
578
        return CView::PreTranslateMessage(pMsg);
579
}
580
 
581
HTREEITEM CCellView::HitTest()
582
{
583
        // Can use the control view's hittest because all it's interested in is the y coord
584
 
585
        TVHITTESTINFO tvi;
586
    DWORD dwPos=GetMessagePos();
587
        CTreeCtrl &Tree=CConfigTool::GetControlView()->GetTreeCtrl();
588
    tvi.pt.y=GET_Y_LPARAM(dwPos);
589
    Tree.ScreenToClient(&tvi.pt);
590
    tvi.pt.x=0;
591
        return Tree.HitTest(&tvi);
592
 
593
}
594
 
595
void CCellView::OnEditCopy()
596
{
597
  if(m_pwndCell){
598
    m_pwndCell->OnEditCopy();
599
  }
600
}
601
 
602
void CCellView::OnEditCut()
603
{
604
  if(m_pwndCell){
605
    m_pwndCell->OnEditCut();
606
  }
607
}
608
 
609
void CCellView::OnEditPaste()
610
{
611
  if(m_pwndCell){
612
    m_pwndCell->OnEditPaste();
613
  }
614
}
615
 
616
void CCellView::OnEditDelete()
617
{
618
  if(m_pwndCell){
619
    m_pwndCell->OnEditDelete();
620
  }
621
}
622
 
623
void CCellView::OnUpdateEditCopy(CCmdUI* pCmdUI)
624
{
625
  if(m_pwndCell){
626
    m_pwndCell->OnUpdateEditCopy(pCmdUI);
627
  } else {
628
    pCmdUI->Enable(false);
629
  }
630
}
631
 
632
void CCellView::OnUpdateEditCut(CCmdUI* pCmdUI)
633
{
634
  if(m_pwndCell){
635
    m_pwndCell->OnUpdateEditCut(pCmdUI);
636
  } else {
637
    pCmdUI->Enable(false);
638
  }
639
}
640
 
641
void CCellView::OnUpdateEditPaste(CCmdUI* pCmdUI)
642
{
643
  if(m_pwndCell){
644
    m_pwndCell->OnUpdateEditPaste(pCmdUI);
645
  } else {
646
    pCmdUI->Enable(false);
647
  }
648
}
649
 
650
void CCellView::OnUpdateEditDelete(CCmdUI* pCmdUI)
651
{
652
  if(m_pwndCell){
653
    m_pwndCell->OnUpdateEditDelete(pCmdUI);
654
  } else {
655
    pCmdUI->Enable(false);
656
  }
657
}
658
 
659
BOOL CCellView::OnHelpInfo(HELPINFO* pHelpInfo)
660
{
661
        return CConfigTool::GetControlView()->OnHelpInfo(pHelpInfo);
662
}
663
 
664
LRESULT CCellView::OnCancelEdit(WPARAM wParam, LPARAM)
665
{
666
  CancelCellEdit(wParam);
667
  return 0;
668
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.