Home Index classes Index static functions Index enumerations Index structure types

{Paint_lines|_scrollable}


(including protected members)

CLASS {Paint_lines|_scrollable} , UNTESTED, DESTRUCTORS :



A class to view an arbitrary amount of lines (of the same height). Which scroll bars should be used ("V" - vertical, "H" - horizontal), and can or not it grab a keyboard input focus ("F"), can be specified only when the component is created (by the function New_paint_lines). Lines should be painted either in a parent form method paint or in methods of descendants before_paint and after_paint.


IMPORT : {Paintbox} , {Form} , {AL4_form} , {AL4_drawing} .


BASE CLASS {Paintbox} .


 

FUNCTION New_paint_lines (
     
{Form} Parent|_form ,
     
STR Alias|_paint_lines ,
     
STR Scrollbars|_and_options|_Vertscrollbar|Horzsbar|Focusable|Suggestions|Number|Phone ) ==> {Paint_lines} , NEW



-------------------------------------------------------------- 'attributes'

  

CONSTANT INT :

          MAX_WIDTH_LINE|_IN_POINTS = 100_000_000 .



METHOD Set_line_height|_points (
     
REAL New_h|eight ) , IF New_h IS CONST , THEN New_h IN [0.001 TO 1000] :


REAL Line_width|_points


  

METHOD Set_line_width (
     
REAL New_w|idth ) , SETTER FOR Line_width , IF New_w IS CONST , THEN New_w >= 0 :



OVERRIDE Count ==> INT


INT Lines_count , READ


     

METHOD Set_lines_count (
     
INT New_count ) , SETTER FOR Lines_count , IF New_count IS CONST , THEN New_count >= 0 :



OVERRIDE Set_content_size ( REAL Area_w|idth , REAL Area_h|eight )



METHOD Top_line|_visible ==> INT



METHOD Set_top_line|_visible (
     
INT New_t|op_line ) , SETTER FOR Top_line



OVERRIDE Move_top_left_to (
     
{Geometry}.{point} N|ew_top_left_position_in_points )



----------------------------------------------------- 'count visible lines'

  

METHOD Lines_visible ==> INT



METHOD Line_at|_y_coordinate ( REAL Y|_coordinate ) ==> INT



----------------------------------------------------------- 'caret support'

INT current_line


   

METHOD Current|_line ==> INT



METHOD Set_current_line (
     
INT New_line ) , SETTER FOR Current_line , IF New_line IS CONST , THEN New_line >= -1 :



METHOD Position_current_line ==> REAL


REAL Caret_offset|_X_from_visible_left_border_in_points , READ


 

METHOD Set_caret_offset (
     
REAL New_offset ) , SETTER FOR Caret_offset , IF New_offset IS CONST , THEN New_offset >= 0 :


REAL Caret_width|_points


 

METHOD Set_caret_width (
     
REAL New_w|idth ) , SETTER FOR Caret_width , IF New_w IS CONST , THEN New_w >= 0 :


REAL Caret_height|_points


 

METHOD Set_caret_height (
     
REAL New_h|eight ) , SETTER FOR Caret_height , IF New_h IS CONST , THEN New_h >= 0 :


BOOL caret_provided|_LOCAL


 

OVERRIDE scrolled , CALLBACK



------------------------------------------------------------ 'cursor shape'

 

OVERRIDE Set_cursor ( {Paintbox}.{cursor} New_c|ursor )



-------------------------------------------------- 'focus / unfocus events'

 

METHOD Is_focused ==> BOOL



--------------------------------------------------- 'handling key commands'

 

METHOD Handle_key ( {Form}.{key_info} Key|_to_handle )



---------------------------------------- 'scroll (by mouse wheel or other)'

  

METHOD Scroll_lines ( REAL Dir|ection_and_speed_1_to_scroll_by_page )



OVERRIDE activated


END