Домой Классы Статические функции Перечисления (ENUM) Записи (RECORD)

{Paint_turtle|_glyph}


(включая защищенные члены)

CLASS {Paint_turtle|_glyph} , UNTESTED, RECURSIVE, BITWISE:



IMPORT : {Form} , {AL4_form} , {Control} , {Paintbox} , {Geometry} , {Canvas} .

BASE CLASS {Paintbox} .


 

ENUMERATION {border|_style} :

        'NONE|_BORDER_NOT_USED' ,

        'FLAT|_BORDER' ,

        'RAISED|_BORDER' ,

        'SUNKEN|_BORDER' .


{border} Border|_style , READ


 

METHOD Set_border ( {border} Style|_to_set ) , SETTER FOR Border


STR Command|s_for_turtle_to_paint_glyph , READ , INIT


 

METHOD Set_command|s_sequence (
     
STR S|equence_set ) , SETTER FOR Command



------------------------------------------------------------------ 'create'

 

FUNCTION New_paint_turtle_button (
     
{Form} Parent|_form ,
     
STR Alias|_of_control ,
     
STR Commands|_to_draw_glyph ) ==> {Paint_turtle} , NEW


STR Subbuttons[] , READ


STR Current|_subbutton_clicked_by_mouse


 

METHOD Set_multi_button|s|_bar (
     
STR Aliases|_of_subbuttons_comma_separated )



------------------------------------------------------- 'like button press'

    

OVERRIDE mouse_down , REPLACE



OVERRIDE mouse_up , REPLACE



OVERRIDE mouse_double_click , REPLACE



METHOD Set_normal_color ( INT N|ormal_color )



------------------------------------------------------------------- 'paint'

   

OVERRIDE before_paint , CALLBACK



OVERRIDE after_paint , CALLBACK



STRUCTURE {turtle_data}

      {rect} Dest|ination_area

      REAL X|_coordinate

      REAL Y|_coordinate

      INT Angle|_0_to_359

      REAL X_sav|ed_coordinate

      REAL Y_sav|ed_coordinate

      INT Save_dir|ection

      {point} Fill_from|_point

      BOOL Do_fill|_or_not_fill

      BOOL Pen|_or_not_pen

      BOOL Fill_pass

      {border} Border|_style

      BOOL Disabled|_state

      BOOL Like_button

      INT Ink|_color

      INT Ink_disabled

      INT Fill|_color

      INT Fill_disabled

      REAL Pen_width

      INT Buttons|_count

      INT Current|_button_index .


BOOL like_button|_LOCAL


 

METHOD Set_like_button ( BOOL True|_if_button )


INT Ink|_color


INT Ink_disabled


INT Fill|_color


INT Fill_disabled


    

METHOD Set_ink|_color ( INT New|_ink_color )



METHOD Set_ink_disabled ( INT New|_ink_disabled )



METHOD Set_fill|_color ( INT New|_fill_color )



METHOD Set_fill_disabled ( INT New|_fill_disabled )


REAL Pen_width


       

FUNCTION Paint_turtle (
     
{Canvas} C|anvas_destinatioin ,
     
{turtle_data} Data|_turtle ,
     
STR Seq|uence_of_commands )



FUNCTION turtle_commands (
     
{Canvas} C|anvas_destinatioin ,
     
{turtle_data} Data|_turtle [] ,
     
STR S|equence_to_interprete ,
     
BOOL New_style|_using_C_A_commands ) , RECURSIVE



FUNCTION find_start_pos|ition_for_bracket (
     
STR C|ommands ,
     
INT Pos|ition_closing_bracket ) ==> INT



FUNCTION move_turtle (
     
{Canvas} Canvas|_destination ,
     
{turtle_data} Data|_turtle [] ,
     
INT N|umber_steps ,
     
BOOL New_style|_using_C_A_commands )



FUNCTION x_off|set_by_direction (
     
INT Dir|ection_move_turtle ) ==> REAL



FUNCTION y_off|set_by_direction (
     
INT Dir|ection_move_turtle ) ==> REAL



OVERRIDE Set_foreground ( INT C|olor_as_ink_color ) , REPLACE


END