summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/ptablevw.cpp
blob: 64c8fa2ecf6c43f8e57eaaebca4ca2ab7748418c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "ptablevw.h"


PObject *
PTableView::createWidget(CreateArgs &ca)
{
  qWarning("Table View is abstract class, cannot create an object from it!!!");
  PTableView *pt = new PTableView(ca.parent);
  pt->setWidget(0);
  pt->setWidgetId(ca.pwI);
  return pt;
}


PTableView::PTableView(PObject *parent)
  : PFrame(parent)
{
  //  kdDebug(5008) << "PTableView PTableView called" << endl;
  tbl = 0;
  setWidget(tbl);
}

PTableView::~PTableView()
{
  // don't delete the widget since none acutally exists.
  // delete widget();     // Delete the frame
  //  tbl=0;          // Set it to 0
//  setWidget(tbl); // Now set all widget() calls to 0.
}

void PTableView::messageHandler(int fd, PukeMessage *pm)
{
//  PukeMessage pmRet;
  switch(pm->iCommand){
      /*
       case PUKE_LINED_SET_MAXLENGTH:
       if(widget() == 0){
       kdDebug(5008) << "PTableView: No Widget set" << endl;
       return;
       }
       widget()->setMaxLength(pm->iArg);
       pmRet.iCommand = - pm->iCommand;
       pmRet.iWinId = - pm->iWinId;
       pmRet.iArg = widget()->maxLength();
       emit outputMessage(fd, &pmRet);
       break;
       */
  default:
    PFrame::messageHandler(fd, pm);
  }
}

void PTableView::setWidget(TQObject *_tbv)
{
  if(_tbv != 0 && _tbv->inherits(TQGRIDVIEW_OBJECT_NAME_STRING) == FALSE)
  {
    errorInvalidSet(_tbv);
    return;
  }

  tbl = (TQGridView *) _tbv;
  if(tbl != 0){
  }
  PFrame::setWidget(_tbv);

}


TQGridView *PTableView::widget()
{
  return tbl;
}


#include "ptablevw.moc"