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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
|
#
# Copyright (c) 1997-2002 The Protein Laboratory, University of Copenhagen
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
# Main widget description
#
# $Id: Widget.cls,v 1.52 2005/04/29 09:06:05 dk Exp $
object Prima::Widget( Prima::Drawable)
{
# user variables
Handle accelTable; # accelerator table
Handle currentWidget; # current widget pointer
int cursorLock; # cursor lock count
NPoint designScale; # font width and height for view design
char * helpContext; # help context string
char * hint; # hint tag text
int lockCount; # lock count
Font popupFont; # font for popup menu
ColorSet popupColor; # colors for popup menu
Handle popupMenu; # popup menu by default
int pointerType; # pointer type, crXXX
Point pos; # last position
int selectingButtons; # which mouse buttons can select a view
Point sizeMin; # default min size
Point sizeMax; # default max size
int tabOrder; # tab ordering number
char * text; # caption text
int widgetClass; # predefined system class
List widgets; # list of child widgets
Handle * enum_lists; # list of currently running enumerators
# geometry managers data
# common:
int geometry; # geometry manager, gtXXX
Point geomSize; # requested size, common to all managers
GeomInfo geomInfo; # managers options
# growMode:
int growMode; # growing flags, see gmGrowXXX
Point virtualSize; # fictive size not aware of size limits
# pack:
Handle packSlaves; # first pack slave in linked list
# place
Handle placeSlaves; # first place slave in linked list
# properties
property SV * accelItems;
property Handle accelTable;
property Bool autoEnableChildren;
property Color backColor;
property int bottom;
property Bool briefKeys;
property Bool buffered;
property Bool clipOwner;
property Color color;
property Color colorIndex( int index);
property Bool current;
property Handle currentWidget;
property Point cursorPos;
property Point cursorSize;
property Bool cursorVisible;
property NPoint designScale;
property Bool enabled;
property int geometry;
property int geomHeight;
property Point geomSize;
property int geomWidth;
property int growMode;
property Bool firstClick;
property Bool focused;
property SV * helpContext;
property SV * hint;
property int hintVisible;
property int left;
property Handle popup;
property SV * popupItems;
property Bool ownerBackColor;
property Bool ownerColor;
property Bool ownerFont;
property Bool ownerHint;
property Bool ownerShowHint;
property Bool ownerPalette;
property Point origin;
property SV * packInfo;
property SV * palette;
property SV * placeInfo;
property Point pointerHotSpot;
property Handle pointerIcon;
property Point pointerPos;
property int pointerType;
property Color popupColorIndex( int index);
property Bool packPropagate;
property Rect rect;
property int right;
property Bool scaleChildren;
property Bool selectable;
property Bool selected;
property Handle selectedWidget;
property int selectingButtons;
property Handle shape;
property Bool showHint;
property Point size;
property Point sizeMax;
property Point sizeMin;
property Bool syncPaint;
property int tabOrder;
property Bool tabStop;
property SV * text;
property int top;
property Bool transparent;
property Bool visible;
property int widgetClass;
# direct call methods
method void attach( Handle objectHandle);
method Bool begin_paint();
method Bool begin_paint_info();
method void bring_to_front();
method Bool can_close();
method void cleanup();
public void client_to_screen();
method Bool close();
c_only Bool custom_paint();
method void detach( Handle objectHandle, Bool kill);
method void done();
method void end_paint();
method void end_paint_info();
method Bool exposed() => apc_widget_is_exposed;
static SV *fetch_resource( char *className, char *name, char *classRes, char *res, Handle owner, int resType = frString);
method Handle first();
c_only Handle first_that( void * actionProc, void * params);
c_only void handle_event ( PEvent event);
method void hide();
method void hide_cursor();
import Bool help();
method void init( HV * profile);
method void insert_behind( Handle view);
method void invalidate_rect( Rect rect);
c_only Bool is_child( Handle possibleOwner);
method void key_event( int command, int code, int key = kbNoKey, int mod = 0, int repeat = 1, Bool post = 0);
method Handle last();
method Bool lock();
method Color map_color( Color color) => apc_widget_map_color;
method void mouse_event( int command = cmMouseDown, int button = mbLeft, int mod = 0, int x = 0, int y = 0, Bool dblclk = 0, Bool post = 0);
method Handle next();
method Handle next_tab( Bool forward = true);
method Handle next_positional( int dx, int dy);
import SV * notification_types();
method void post_message( SV * info1, SV * info2);
c_only Bool process_accel( int key);
import SV * profile_default ();
method Handle prev();
method void repaint();
method Bool responsive() => apc_widget_is_responsive;
public void screen_to_client();
public void scroll( int dx, int dy, Rect *confine, Rect *clip, Bool withChildren);
method void send_to_back();
method void set( HV * profile);
method void setup();
method void show();
method void show_cursor();
method Bool showing() => apc_widget_is_showing;
method Bool unlock();
method void update_view();
c_only void update_sys_handle( HV * profile);
c_only Bool validate_owner( Handle * newOwner, HV * profile);
method Bool validate_rect( Rect rect) => apc_widget_validate_rect;
# properties read methods
method Bool get_capture() => apc_widget_is_captured;
static Font get_default_font( char * dummy = "");
static Font get_default_popup_font( char * dummy = "");
method Rect get_invalid_rect() => apc_widget_get_invalid_rect;
method SV * get_handle();
method Bool get_locked();
method int get_mouse_state() => apc_pointer_get_state;
public void get_pack_slaves();
method Handle get_parent();
method SV * get_parent_handle();
public void get_place_slaves();
static Point get_pointer_size( char * dummy = "");
method Font get_popup_font();
c_only Handle get_selectee();
method int get_shift_state() => apc_kbd_get_state;
method Point get_virtual_size();
public void get_widgets();
# properties write methods
method void set_capture( Bool capture, Handle confineTo = nilHandle);
method void set_centered( Bool x, Bool y);
method void set_font( Font font);
method void set_popup_font( Font font);
# other
method void on_paint( SV * canvas);
}
|