You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
//
|
|
// G A M E.O.N.E - LOW LEVEL LIB V1.0
|
|
// Copyright (C) 2001 LEVEL ONE ENTERTAINMENT,
|
|
// Licensed under the terms of LGPL.
|
|
//:---------------------------------------------------------------------------
|
|
//:Description
|
|
//
|
|
// FRAMEWORK Layerobject - displays/inputs a text from Keyboard
|
|
//
|
|
// CActor
|
|
// +--CLayer
|
|
// +--CLayerFloatingText
|
|
// +--CLayerInputText
|
|
//
|
|
// Keyboard input
|
|
//
|
|
//:---------------------------------------------------------------------------
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#if !defined(_LAYER_INPUTTEXT_H)
|
|
#define _LAYER_INPUTTEXT_H
|
|
|
|
#include "llfrm_layerfloatingtext.h"
|
|
|
|
#define CURSOR_BLINK_RATE (1.0f/3)
|
|
|
|
|
|
class CLayerInputText : public CLayerFloatingText
|
|
{
|
|
public:
|
|
CLayerInputText();
|
|
virtual ~CLayerInputText();
|
|
|
|
virtual void Action(float delta);
|
|
|
|
virtual bool ParseMsg(const char *arg );
|
|
|
|
char *m_enter_msg; // send on enter
|
|
char *m_cursor_char; // cursor zeichen
|
|
char *m_default;
|
|
float m_cursor_wait; // laufvariable zur blinkrate
|
|
float m_cursor_blinktime; // blinkrate
|
|
int m_cursor_pos;
|
|
|
|
int m_input_maxchars; // maximal anzahl zeichen einschliesslich cursor
|
|
bool m_input_focus; // verliert fokus bei return
|
|
bool m_autoclear; // löscht text automatisch wenn return gedrückt wurde
|
|
|
|
void LoadText();
|
|
void SaveText();
|
|
void OnKeyReturn(); // text wird im varmgr abgespeichert
|
|
void OnKeyBackspace();
|
|
void OnKey(int ch);
|
|
|
|
private:
|
|
bool m_cursor_state; // true = sichtbar
|
|
};
|
|
|
|
#endif // !defined(_LAYER_INPUTTEXT_H)
|