summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/multiline_ex.cpp
blob: 16ddd67f4571f6fd7171baa0b663416a18eb1cc5 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/***************************************************************************
                          multiline_ex.cpp  -  description
                             -------------------
    begin                : Fri Aug 25 2000
    copyright            : (C) 2000 -2004 by llornkcor
    email                : ljp@llornkcor.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
//#include <qmultilineedit.h>
#include "multiline_ex.h"

struct MultiLine_ExData
//class  MultiLine_ExData
{
public:
    QColorGroup mypapcolgrp;
    QColorGroup papcolgrp;
    uint ownpalette : 1;
};


MultiLine_Ex::MultiLine_Ex( QWidget *parent ,  const char *name  )
    :QMultiLineEdit( parent,name )
{

#ifndef Q_WS_QWS
//    clearTableFlags( Tbl_autoHScrollBar | Tbl_autoVScrollBar);  //for pre release testing
#else
// clearTableFlags( Tbl_autoVScrollBar );  //for pre release testing
#endif
//     clearTableFlags( Tbl_autoHScrollBar | Tbl_autoVScrollBar); // for release
//    init();
}

void MultiLine_Ex::pageDown( bool mark )
{
  QMultiLineEdit::pageDown( mark );
}

void MultiLine_Ex::pageUp( bool mark )
{
  QMultiLineEdit::pageUp(  mark );
}


void MultiLine_Ex::cursorLeft( bool mark, bool wrap )
{
  QMultiLineEdit::cursorLeft( mark, wrap );
}

void MultiLine_Ex::cursorRight( bool mark, bool wrap )
{
  QMultiLineEdit::cursorRight(  mark,  wrap );
}

void MultiLine_Ex::cursorUp( bool mark )
{
  QMultiLineEdit::cursorUp(  mark );
}

void MultiLine_Ex::cursorDown( bool mark )
{
  QMultiLineEdit::cursorDown(  mark );
}


//void MultiLine_Ex::setPaper( const QBrush& pap)
//{

//}

int MultiLine_Ex::lastRow()
{
  return lastRowVisible();
}

int MultiLine_Ex::topRow()
{
  return topCell();
}

int MultiLine_Ex::editSize( )
{
  return viewHeight() / cellHeight();
//scroll( 0, int yPixels );
}

void MultiLine_Ex::ScrollUp( int lines )
{
    for( int i = 0; i < lines; i++) {
    this->setTopCell( topCell() + 1 );
    }
}

void MultiLine_Ex::ScrollDown( int lines )
{
  for( int i = 0; i < lines; i++) {
  this->setTopCell( topCell() -1 );
  }
}

int MultiLine_Ex::lineHeight( int row)
{
  return this->cellHeight(row );
}

int MultiLine_Ex::Top( )
{
  return this->topCell();
}

int MultiLine_Ex::Rows( )
{
  return findRow ( 1 );
}

int MultiLine_Ex::PageSize()
{
  return viewHeight() / cellHeight() ;
}

bool MultiLine_Ex::hasSelectedText()
{
  return QMultiLineEdit::hasMarkedText();
}