[lazarus] How to use class

hernan.et at pg.com hernan.et at pg.com
Thu Mar 27 18:06:20 EST 2003


Hi all,

After messing around with LCL, I encountered the following code (actually the
code is from packages folder of fpc source)

     PGtkEditable = ^TGtkEditable;
     TGtkEditable = record
          widget : TGtkWidget;
          current_pos : guint;
          selection_start_pos : guint;
          selection_end_pos : guint;
          flag0 : {$ifdef win32}longint{$else}word{$endif};
          ic : PGdkIC;
          ic_attr : PGdkICAttr;
          clipboard_text : Pgchar;
       end;
     TGtkTextfunction = procedure (editable:PGtkEditable; time:guint32); cdecl;

  const
     bm_TGtkEditable_has_selection = $1;
     bp_TGtkEditable_has_selection = 0;
     bm_TGtkEditable_editable = $2;
     bp_TGtkEditable_editable = 1;
     bm_TGtkEditable_visible = $4;
     bp_TGtkEditable_visible = 2;
function  has_selection(var a : TGtkEditable) : guint;
procedure set_has_selection(var a : TGtkEditable; __has_selection : guint);
function  editable(var a : TGtkEditable) : guint;
procedure set_editable(var a : TGtkEditable; __editable : guint);
function  visible(var a : TGtkEditable) : guint;
procedure set_visible(var a : TGtkEditable; __visible : guint);

  type
     PGtkEditableClass = ^TGtkEditableClass;
     TGtkEditableClass = record
          parent_class : TGtkWidgetClass;
          changed : procedure (editable:PGtkEditable);cdecl;
          insert_text : procedure (editable:PGtkEditable; thetext:Pgchar; length:gint; position:Pgint); cdecl;
          delete_text : procedure (editable:PGtkEditable; start_pos:gint; end_pos:gint); cdecl;
          activate : procedure (editable:PGtkEditable);cdecl;
          set_editable : procedure (editable:PGtkEditable; is_editable:gboolean);cdecl;
          move_cursor : procedure (editable:PGtkEditable; x:gint; y:gint);cdecl;
          move_word : procedure (editable:PGtkEditable; n:gint);cdecl;
          move_page : procedure (editable:PGtkEditable; x:gint; y:gint);cdecl;
          move_to_row : procedure (editable:PGtkEditable; row:gint);cdecl;
          move_to_column : procedure (editable:PGtkEditable; row:gint);cdecl;
          kill_char : procedure (editable:PGtkEditable; direction:gint);cdecl;
          kill_word : procedure (editable:PGtkEditable; direction:gint);cdecl;
          kill_line : procedure (editable:PGtkEditable; direction:gint);cdecl;
          cut_clipboard : procedure (editable:PGtkEditable);cdecl;
          copy_clipboard : procedure (editable:PGtkEditable);cdecl;
          paste_clipboard : procedure (editable:PGtkEditable);cdecl;
          update_text : procedure (editable:PGtkEditable; start_pos:gint; end_pos:gint); cdecl;
          get_chars : function (editable:PGtkEditable; start_pos:gint; end_pos:gint):Pgchar; cdecl;
          set_selection : procedure (editable:PGtkEditable; start_pos:gint; end_pos:gint); cdecl;
          set_position : procedure (editable:PGtkEditable; position:gint);cdecl;
       end;

How can I use PGtkEditableClass so that I can manipulate a TMemo?

Yoyong






More information about the Lazarus mailing list