1
/***************************************************************************
2
ctxwindow.cpp - description
5
copyright : (C) 2000 by Volker Schroer
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* based on the work of Moe Wheatly, AE4JY *
16
***************************************************************************/
18
#include "ctxwindow.h"
21
CTxwindow::CTxwindow (QWidget *parent, const char *name ) : QMultiLineEdit(parent,name)
29
CTxwindow::~CTxwindow(){
32
void CTxwindow::keyPressEvent(QKeyEvent *e) // Bearbeiten der Eingaben im
36
static bool CapsLock = false;
37
if (filled < TXBUFFER_LENGTH)
44
cursorPosition(&akt_line,&akt_col);
46
if(akt_line >= maxline)
47
removeLine(0); //Erste Zeile entfernen
54
inpos = inpos % TXBUFFER_LENGTH;
68
{ // We can delete the last char direct in the buffer
70
inpos = inpos + TXBUFFER_LENGTH - 1;
77
inpos = inpos % TXBUFFER_LENGTH;
82
if ( (e->state() == ShiftButton) || CapsLock)
83
c=toupper(e->ascii());
85
c=tolower(e->ascii());
88
cursorPosition(&akt_line,&akt_col);
92
insertCntrlChar('\n'); //This newline Char will be Transmitted
99
inpos = inpos % TXBUFFER_LENGTH;
106
QApplication::beep();
112
int CTxwindow::getTxChar(void)
117
ch=txbuffer[outpos++];
125
outpos=outpos % TXBUFFER_LENGTH;
126
if (ch == TXOFF_CODE)
127
settings.status=TX_POSTAMBLE_STATE;
135
int CTxwindow::insertTxChar(const char *txtstring, int anzahl)
140
len = TXBUFFER_LENGTH-filled;
142
return len; //TXBuffer full; try later
147
for (i=0;i < len;i++)
149
txbuffer[inpos++]= *(txtstring+i);
150
inpos=inpos % TXBUFFER_LENGTH;
156
void CTxwindow::insertCntrlChar(int CntrlChar)
159
while (filled >= TXBUFFER_LENGTH)
160
qApp->processEvents(100);
162
txbuffer[inpos++]= CntrlChar;
163
inpos %= TXBUFFER_LENGTH;
167
bool CTxwindow::TxBufferisEmpty(void)
170
return true; //Buffer is empty
172
return false; // Some Char's to xmit
175
void CTxwindow::setMaxLine(int count)