which included commits to RCS files with non-trunk default branches. git-svn-id: svn://10.65.10.50/trunk@5758 c028cbd2-c16b-5b4b-a496-9718f37d4682
103 lines
3.0 KiB
C
Executable File
103 lines
3.0 KiB
C
Executable File
/*******************************************************************************
|
|
* Copyright 1991-1995 by ORCA Software, Inc. *
|
|
* *
|
|
* All rights reserved. May not be reproduced or distributed, in printed or *
|
|
* electronic form, without permission of ORCA Software, Inc. *
|
|
*******************************************************************************/
|
|
|
|
#ifndef TXT_INCLUDED
|
|
#define TXT_INCLUDED
|
|
|
|
typedef long TXT;
|
|
#define NULL_TXT (TXT)0
|
|
|
|
#define TXT_ATR_ENABLED XI_ATR_ENABLED
|
|
#define TXT_ATR_EDITMENU XI_ATR_EDITMENU
|
|
#define TXT_ATR_AUTOSCROLL XI_ATR_AUTOSCROLL
|
|
#define TXT_ATR_AUTOSELECT XI_ATR_AUTOSELECT
|
|
#define TXT_ATR_RJUST XI_ATR_RJUST
|
|
#define TXT_ATR_BORDER XI_ATR_BORDER
|
|
#define TXT_ATR_VISIBLE XI_ATR_VISIBLE
|
|
#define TXT_ATR_FOCUSBORDER XI_ATR_FOCUSBORDER
|
|
#define TXT_ATR_READONLY XI_ATR_READONLY
|
|
|
|
#define TXT_FLAG_TEXT 0x1 /* text has changed */
|
|
#define TXT_FLAG_SELECTION 0x2 /* includes insertion point */
|
|
#define TXT_FLAG_SCROLL 0x4 /* scroll position has changed */
|
|
#define TXT_FLAG_OVF 0x8 /* user filled buffer */
|
|
|
|
typedef enum
|
|
{
|
|
TXT_STATE_NULL,
|
|
TXT_STATE_SELC,
|
|
TXT_STATE_SELW
|
|
}
|
|
TXT_STATE;
|
|
|
|
typedef struct _txt_def
|
|
{
|
|
/* must be initialized by creator */
|
|
RCT rct;
|
|
XI_OBJ *parent_obj;
|
|
unsigned long attrib;
|
|
FONT_OBJ *font;
|
|
COLOR back_color;
|
|
COLOR fore_color;
|
|
COLOR hilight_color; /* for well and platform fields */
|
|
COLOR shadow_color; /* for well and platform fields */
|
|
short text_size;
|
|
char *text;
|
|
short *hit_test;
|
|
WINDOW win;
|
|
BOOLEAN well;
|
|
BOOLEAN platform;
|
|
BOOLEAN inside_only;
|
|
BOOLEAN auto_tab;
|
|
long timer_id;
|
|
BOOLEAN timer_set;
|
|
|
|
/* initialized by txt_reset */
|
|
short pix_baseline;
|
|
unsigned short flags;
|
|
TXT_STATE state;
|
|
short selstart, selstop;
|
|
short scroll_pos;
|
|
short select_start;
|
|
short string_xpos;
|
|
short len;
|
|
BOOLEAN hasfocus;
|
|
short ascent;
|
|
short descent;
|
|
short leading;
|
|
} TXT_DATA;
|
|
/*
|
|
NOTE: if TXT_ATR_RJUST is set, then scroll_pos indicates how many
|
|
characters are to the right of the right margin. Otherwise, it indicates
|
|
how many characters are to the left of the left margin.
|
|
*/
|
|
|
|
|
|
TXT_DATA *txt_reset(TXT_DATA *txt);
|
|
BOOLEAN txt_event(TXT_DATA *txt, EVENT *ep, BOOLEAN gaining_focus);
|
|
unsigned long txt_get_attrib(TXT_DATA *txt);
|
|
void txt_get_sel(TXT_DATA *txt, int *c1, int *c2);
|
|
RCT *txt_get_rect(TXT_DATA *txt, RCT *rct);
|
|
RCT *txt_set_rect(TXT_DATA *txt, RCT *rct);
|
|
void txt_get_text(TXT_DATA *txt, char *s, int len);
|
|
void txt_redraw(TXT_DATA *txt, BOOLEAN inside_only);
|
|
void txt_set_attrib(TXT_DATA *txt, unsigned long attrib);
|
|
/* turns on/off caret if selstart == selstop */
|
|
void txt_caret(TXT_DATA *txt, BOOLEAN caret_state);
|
|
void txt_set_sel(TXT_DATA *txt, int c1, int c2);
|
|
void txt_set_text(TXT_DATA *txt, char *s);
|
|
void txt_display_caret(TXT_DATA *txt);
|
|
void txt_hide_caret(TXT_DATA *txt);
|
|
#if XIWS == MTFWS
|
|
void clean_primesel();
|
|
#endif
|
|
|
|
#endif /* TXT_INCLUDED */
|
|
|
|
|
|
|