Seems i got programming fever 41° now. I have taken most important keywords beginning with "Fl_" from FLTK and from FB into your syntax highlighter, Joshy.
Code: Select all
' syntax_highlighter.bas
' syntax highlighting for FreeBASIC 1.06
' and Fltk 1.3.3
' with most important keywords
#include once "fltk-c.bi"
#include once "crt/stdlib.bi"
#include once "crt/string.bi"
#define FONTSIZE 14
#define STYLE_PLAIN asc("A")
#define STYLE_KEYWORD asc("B")
#define STYLE_STRING asc("C")
#define STYLE_COMMENT asc("D")
#define STYLE_NUMBER asc("E")
#define STYLE_PREPROC asc("F")
#define STYLE_DATATYPE asc("G")
#define STYLE_OTHER asc("H")
#define STYLE_USERLIB asc("I")
dim as Style_Table_Entry StyleTable(...) => _
{(FL_BLACK ,FL_TIMES ,FONTSIZE), _ ' style 'A'
(FL_DARK_GREEN ,Fl_TIMES_BOLD ,FONTSIZE), _ ' style 'B'
(FL_DARK_MAGENTA ,Fl_COURIER ,FONTSIZE), _ ' style 'C'
(Fl_RED ,Fl_COURIER_ITALIC,FONTSIZE), _ ' style 'D'
(FL_BLACK ,Fl_COURIER_BOLD ,FONTSIZE), _ ' style 'E'
(FL_BLUE ,Fl_COURIER_BOLD ,FONTSIZE), _ ' style 'F'
(FL_DARK_CYAN ,Fl_COURIER ,FONTSIZE), _ ' style 'G'
(FL_LIGHT2 ,Fl_COURIER_BOLD ,FONTSIZE), _ ' style 'H'
(FL_MAGENTA ,Fl_COURIER ,FONTSIZE)} ' style 'I'
' test of simple float (without E notation)
dim as single f1 = 1.234
dim as single f2 = .123
' test of dec, hex, oct, bin numbers
dim as integer d = 123456, h = &h123abc, o = &o1234567, b = &b00110010
function IsWhite(byval c as ubyte) as long
if c=32 then return 1
if c= 9 then return 1
return 0
end function
function IsAlpha(byval c as ubyte) as long
select case as const c
case asc("a") to asc("z") : return 1
case asc("A") to asc("Z") : return 1
case asc("_") : return 1
end select
return 0
end function
function IsNumber(byval c as ubyte) as long
select case as const c
case asc("0") to asc("9") : return 1
end select
return 0
end function
function IsHex(byval c as ubyte) as long
select case as const c
case asc("a") to asc("f") : return 1
case asc("A") to asc("F") : return 1
end select
return IsNumber(c)
end function
function IsOct(byval c as ubyte) as long
select case as const c
case asc("0") to asc("7") : return 1
end select
return 0
end function
function IsBin(byval c as ubyte) as long
select case as const c
case asc("0"),asc("1") : return 1
end select
return 0
end function
function IsAlphaNum(byval c as ubyte) as long
If IsAlpha(c) then return 1
If IsNumber(c) then return 1
return 0
end function
function IsOperator(byval c as ubyte) as long
return instr("=<>-+*/\@",chr(c))
end function
function IsDelimiter(byval c as ubyte) as long
if c=10 then return 1
if c=13 then return 1
if c=34 then return 1
if instr(",:()[]{}",chr(c)) then return 1
return IsOperator(c)
end function
' almost all fb keywords
function IsKeyword(byval s as string) as long
dim as string search = "," & lcase(s) & ","
dim as ubyte char=search[1]
return instr(",abs,access,acos,add,alias,allocate,alpha,and,andalso,any,append,as,asc," & _
"asin,asm,assert,assertwarn,atan2,atn,base,beep,bin,binary,bit,bitreset,bitset,bload," & _
"boolean,bsave,byref,byte,byval,call,callocate,case,cast,cbool,cbyte,cdbl,cdecl,chain," & _
"chdir,chr,cint,circle,class,clear,clng,clngint,close,cls,color,com,command,common," & _
"condbroadcast,condcreate,conddestroy,condsignal,condwait,cons,const,constructor,continue," & _
"cos,cptr,cshort,csign,csng,csrlin,cubyte,cuint,culng,culngint,cunsg,curdir,cushort,custom," & _
"cvd,cvi,cvl,cvlongint,cvs,cvshort,data,date,dateadd,datediff,datepart,dateserial,datevalue," & _
"day,deallocate,declare,defbyte,defdbl,defint,deflng,deflngint,defshort,defsng,defstr," & _
"defubyte,defuint,defulngint,defushort,delete,destructor,dim,dir,do,double,draw,dylibfree," & _
"dylibload,dylibsymbol,dynamic,else,elseif,encoding,end,endif,enum,environ,eof,eqv,erase," & _
"erfn,erl,ermn,err,error,escape,exec,exepath,exit,exp,explicit,export,extends,extern,false," & _
"fboolean,field,fileattr,filecopy,filedatetime,fileexists,filelen,fix,flip,for,format,frac," & _
"fre,freefile,function,get,getjoystick,getkey,getmouse,gosub,goto,hex,hibyte,hiword,hour,if," & _
"iif,imageconvertrow,imagecreate,imagedestroy,imp,import,inkey,inp,input,input$,instr," & _
"instrrev,int,integer,interface,is,isdate,kill,lbound,lcase,left,len,let,lib,line,lobyte,loc," & _
"local,locate,lock,lof,log,long,longint,loop,loword,lpos,lprint,lpt,lset,ltrim,mid,minute,mkd," & _
"mkdir,mki,mkl,mklongint,mks,mkshort,mod,month,monthname,multikey,mutexcreate,mutexdestroy," & _
"mutexlock,mutexunlock,name,namespace,new,next,nokeyword,not,now,object,oct,offsetof,on,once," & _
"open,operator,option,or,orelse,out,output,overload,paint,palette,pascal,pcopy,peek,pipe," & _
"pmap,point,pointer,poke,pos,preserve,preset,print,private,procptr,property,protected,pset," & _
"ptr,public,put,random,randomize,read,reallocate,redim,rem,reset,restore,resume,return,rgb," & _
"rgba,right,rmdir,rnd,rset,rtrim,run,sadd,scope,screen,screencontrol,screencopy,screenevent," & _
"screenglproc,screeninfo,screenlist,screenlock,screenptr,screenres,screenset,screensync," & _
"screenunlock,scrn,second,seek,select,setdate,setenviron,setmouse,settime,sgn,shared,shell,shl," & _
"short,shr,sin,single,sizeof,sleep,space,spc,sqr,static,stdcall,step,stop,str,string,strptr," & _
"sub,swap,system,tab,tan,then,this,threadcreate,threadwait,time,timer,timeserial,timevalue,to," & _
"trans,trim,true,type,ubound,ubyte,ucase,uinteger,ulong,ulongint,union,unlock,unsigned,until," & _
"ushort,using,va_arg,va_first,val,valint,vallng,valuint,valulng,va_next,var,varptr,view,virtual," & _
"wait,wbin,wchr,weekday,weekdayname,wend,whex,while,width,win32,window,windowtitle,winput,with," & _
"woct,write,wspace,wstr,wstring,xor,year,zstring,", search)
return 0
end function
' data words
function IsDatatype(byval s as string) as long
dim as string search = "," & lcase(s) & ","
return instr(",as,byref,byte,byval,boolean,const,double,long,long,longint,ptr,pointer,short,single,string," & _
"ubyte,ulong,ulong,ulongint,ushort,wstring,,zstring,", search)
return 0
end function
' preprocessor
function IsPreproc(byval s as string) as long
dim as string search = "," & ucase(s) & ","
dim as ubyte char=search[1]
select case as const char
case asc("#") : return instr(",#ASSERT,#DEFINE,#ELSE,#ELSEIF,#ENDIF,#ENDMACRO,#ERROR,#IF,#IFDEF,#IFNDEF,#INCLIB,#INCLUDE," & _
"#LANG,#LIBPATH,#LINE,#MACRO,#PRAGMA,#PRINT,#UNDEF,", search)
case asc("_") : return instr(",__DATE_ISO__, __DATE__, __FB_64BIT__, __FB_ARGC__, __FB_ARGV__, __FB_BACKEND__, __FB_BIGENDIAN__," & _
"__FB_BUILD_DATE__, __FB_CYGWIN__, __FB_DARWIN__, __FB_DEBUG__, __FB_DOS__, __FB_ERR__, __FB_FPMODE__, __FB_FPU__, __FB_FREEBSD__," & _
"__FB_GCC__, __FB_LANG__, __FB_LINUX__, __FB_MAIN__, __FB_MIN_VERSION__, __FB_MT__, __FB_NETBSD__, __FB_OPENBSD__," & _
"__FB_OPTION_BYVAL__, , __FB_OPTION_ESCAPE__, __FB_OPTION_EXPLICIT__, __FB_OPTION_GOSUB__, __FB_OPTION_PRIVATE__," & _
"__FB_OUT_DLL__, __FB_OUT_EXE__, __FB_OUT_LIB__, __FB_OUT_OBJ__, __FB_PCOS__, __FB_SIGNATURE__, __FB_SSE__, __FB_UNIX__," & _
"__FB_VECTORIZE__, , , __FB_VER_MINOR__, __FB_VER_PATCH__, __FB_WIN32__, __FB_XBOX__, __FILE_NQ__, __FILE__," & _
"__FUNCTION_NQ__, , , __PATH__, __TIME__,", search)
case else : return instr(",DEFINED,ONCE,TYPEOF,", search)
end select
end function
' some FLTK stuff
function IsUserlib(byval s as string) as long
if len(s)<5 then return 0
dim as string search = "," & lcase(s) & ","
' most common fltk words
if instr(",fl_run,fl_windowshow,fl_windownew,fl_windownew2,fl_double_windownew,fl_double_windownew2,fl_getw,fl_geth," & _
"fl_text_editornew,fl_widgetgetw,fl_widgetgeth,fl_text_buffernew,fl_widgetsetuserdata,fl_text_displaysetlinenumberwidth," & _
"fl_text_displaysetbuffer,fl_text_displayhighlightdata,fl_text_bufferloadfile,fl_text_buffersettext," & _
"fl_text_editor ptr editor,fl_text_buffer,fl_text_displaygetbuffer,fl_widgetgetuserdata," & _
"fl_text_bufferreplace,fl_text_bufferremove,fl_text_bufferselect,fl_text_bufferlinestart,fl_text_bufferlength," & _
"fl_text_bufferlineend,fl_text_buffertextrange,fl_text_bufferreplace," & _
"fl_groupsetresizable,",search) then return 1
dim as ubyte char=search[4]
select case as const char
case asc("a") : return instr(",fl_access,fl_addawakehandler,fl_adjuster,fl_adjustergetsoft,fl_adjusternew,fl_align,fl_align_bottom," & _
"fl_align_bottom_left,fl_align_bottom_right,fl_align_center,fl_align_clip,fl_align_image_backdrop,fl_align_image_mask," & _
"fl_align_image_next_to_text,fl_align_image_over_text,fl_align_inside,fl_align_left,fl_align_left_bottom,fl_align_left_top," & _
"fl_align_position_mask,fl_align_right,fl_align_right_bottom,fl_align_right_top,fl_align_text_next_to_image," & _
"fl_align_text_over_image,fl_align_top,fl_align_top_left,fl_align_top_right,fl_align_wrap,fl_alt,fl_alt_l,fl_alt_r," & _
"fl_args_handler,fl_atclose_handler,fl_awake_handler,fl_awake2,",search)
case asc("b") : return instr(",fl_back,fl_background_color,fl_background2_color,fl_backspace,fl_bep,fl_beep_default," & _
"fl_beep_error,fl_beep_message,fl_beep_notification,fl_beep_password,fl_beep_question,fl_bitmap,fl_bitmapcopy," & _
"fl_bitmapcopy2,fl_bitmapnew,fl_black,fl_blue,fl_bmp_image,fl_bmp_imagenew,fl_bold,fl_bold_italic,fl_border_box," & _
"fl_border_frame,fl_bottom,fl_box,fl_box_draw_f,fl_boxdh,fl_boxdw,fl_boxdx,fl_boxdy,fl_boxhandle,fl_boxnew," & _
"fl_boxnew2,fl_boxtype,fl_browser ,fl_browser_begin,fl_browser_deselect,fl_browser_end,fl_browser_gethassscrollbar," & _
"fl_browser_gethposition,fl_browser_getposition,fl_browser_getscrollbarsize,fl_browser_getscrollbarwidth," & _
"fl_browser_gettextcolor,fl_browser_gettextfont,fl_browser_gettextsize,fl_browser_handle,fl_browser_select," & _
"fl_browser_selectonly,fl_browserdisplayed,fl_browserend,fl_browsergetcolumnchar,fl_browsergetcolumnwidths," & _
"fl_browsergetdata,fl_browsergetformatchar,fl_browsergeticon,fl_browsergetsize,fl_browsergettext,fl_browsergettopline," & _
"fl_browsergetvalue,fl_browserload,fl_browsernew,fl_browserselect,fl_browserselected,fl_browsertype,fl_browservisible," & _
"fl_button,fl_button1,fl_button2,fl_button3,fl_buttonclear,fl_buttongetdownbox,fl_buttongetdowncolor,fl_buttongetshortcut," & _
"fl_buttongetvalue,fl_buttonhandle,fl_buttonnew,fl_buttons,fl_buttonset,fl_buttonsetvalue,",search)
case asc("c") : return instr(",fl_callback,fl_callback_p,fl_callback0,fl_callback1,fl_canvas,fl_canvasdraw,fl_canvashandlebase," & _
"fl_canvasnew,fl_cap_flat,fl_cap_round,fl_cap_square,fl_caps_lock,fl_capslock,fl_char,fl_chart,fl_chart_bar,fl_chart_fill," & _
"fl_chart_horbar,fl_chart_line,fl_chart_pie,fl_chart_specialpie,fl_chart_spike,fl_chartgetautosize,fl_chartgetmaxsize," & _
"fl_chartgetsize,fl_chartgettextcolor,fl_chartgettextfont,fl_chartgettextsize,fl_chartnew,fl_charttype,fl_check,fl_check_browser," & _
"fl_check_browseradd,fl_check_browseradd2,fl_check_browsergetchecked,fl_check_browsernchecked,fl_check_browsernew," & _
"fl_check_browsernitems,fl_check_browserremove,fl_check_browsertext,fl_check_browservalue,fl_check_button,fl_check_buttonnew," & _
"fl_chmod,fl_choice,fl_choicegetvalue,fl_choicehandle,fl_choicenew,fl_choicesetvalue,fl_choicesetvaluebyitem,fl_clipboard_image," & _
"fl_clipboard_notify_handler,fl_clipboard_plain_text,fl_clock,fl_clock_output,fl_clock_outputgetvalue,fl_clock_outputhour," & _
",fl_clock_outputnew,fl_clock_outputsecond,fl_clock_round,fl_clock_square,fl_clocknew,fl_clocknew2,fl_clocktype,fl_color," & _
"fl_color,fl_color_average,fl_color_chooser,fl_color_chooserb,fl_color_chooserg,fl_color_choosergetmode,fl_color_chooserhsv," & _
"fl_color_chooserhue,fl_color_choosernew,fl_color_chooserr,fl_color_chooserrgb,fl_color_choosersaturation,fl_color_chooservalue," & _
"fl_color_cube,fl_colorchooser_byte,fl_colorchooser_default,fl_colorchooser_hex,fl_colorchooser_hsv,fl_colorchooser_rgb," & _
"fl_colorchoosermodes,fl_command,fl_compose,fl_context_cell,fl_context_col_header,fl_context_endpage,fl_context_none," & _
"fl_context_rc_resize,fl_context_row_header,fl_context_startpage,fl_context_table,fl_contrast,fl_control,fl_control_l," & _
"fl_control_r,fl_copy_surface,fl_copy_surfaceclassname,fl_copy_surfacedelete,fl_copy_surfacegetdriver,fl_copy_surfacenew," & _
"fl_counter,fl_counter_normal,fl_counter_simple,fl_counterhandle,fl_counternew,fl_countertype,fl_courier,fl_courier_bold," & _
"fl_courier_bold_italic,fl_courier_italic,fl_cstring,fl_ctrl,fl_ctrl,fl_cursor,fl_cursor_arrow,fl_cursor_cross," & _
"fl_cursor_default,fl_cursor_e,fl_cursor_hand,fl_cursor_help,fl_cursor_insert,fl_cursor_move,fl_cursor_n,fl_cursor_ne," & _
",fl_cursor_none,fl_cursor_ns,fl_cursor_nw,fl_cursor_nwse,fl_cursor_s,fl_cursor_se,fl_cursor_sw,fl_cursor_w,fl_cursor_wait," & _
"fl_cursor_we,fl_cyan,",search)
case asc("d") : return instr(",fl_damage,fl_damage_all,fl_damage_child,fl_damage_expose,fl_damage_overlay,fl_damage_scroll," & _
"fl_damage_user1,fl_damage_user2,fl_dark_blue,fl_dark_cyan,fl_dark_green,fl_dark_magenta,fl_dark_red,fl_dark_yellow,fl_dark1," & _
"fl_dark2,fl_dark3,fl_dash,fl_dashdot,fl_dashdotdot,fl_dataopcode,fl_delete,fl_destructorex,fl_device,fl_device_asany," & _
"fl_dial,fl_dial_fill,fl_dial_line,fl_dial_normal,fl_dialgetangle1,fl_dialgetangle2,fl_dialhandle,fl_dialnew,fl_dialtype," & _
"fl_diamond_down_box,fl_diamond_up_box,fl_directories,fl_dnd,fl_dot,fl_double_window,fl_double_windowex," & _
"fl_double_windowexhandlebase,fl_double_windowexnew,fl_double_windowexnew2,fl_double_windownew,fl_double_windownew2," & _
"fl_down,fl_down_box,fl_down_frame,fl_draw_image_cb,fl_draw_overlayex,fl_drawboxactive,fl_drawcellex,fl_drawex," & _
"fl_double_windowshow,",search)
case asc("e") : return instr(",fl_embossed_box,fl_embossed_frame,fl_end,fl_engraved_box,fl_engraved_frame,fl_enter_key," & _
"fl_escape,fl_event,fl_event_activate,fl_event_button,fl_event_close,fl_event_deactivate,fl_event_dispatch," & _
"fl_event_dnd_drag,fl_event_dnd_enter,fl_event_dnd_leave,fl_event_dnd_release,fl_event_drag,fl_event_enter," & _
"fl_event_focus,fl_event_fullscreen,fl_event_handler,fl_event_hide,fl_event_keyboard,fl_event_keydown," & _
"fl_event_keyup,fl_event_leave,fl_event_mousewheel,fl_event_move,fl_event_paste,fl_event_push," & _
"fl_event_release,fl_event_screen_configuration_changed,fl_event_selectionclear,fl_event_shortcut,fl_event_show," & _
"fl_event_states,fl_event_unfocus,fl_except,fl_execvp,fl_extends1,fl_extends2,fl_extends3,fl_extends4,fl_extends5,",search)
case asc("f") : return instr(",fl_f,fl_f_last,fl_favorites,fl_fd_handler,fl_file_browser,fl_file_browser),fl_file_browsergetfiletype," & _
"fl_le_browsergetfilter,fl_file_browsergeticonsize,fl_file_browsergettextsize,fl_file_browserload,fl_file_browsernew,fl_file_chooser," & _
"fl_file_chooseraddextra,fl_file_choosercount,fl_file_choosergetcolor,fl_file_choosergetdirectory,fl_file_choosergetfilter," & _
"fl_file_choosergetfiltervalue,fl_file_choosergeticonsize,fl_file_choosergetlabel,fl_file_choosergetoklabel," & _
"fl_file_choosergetpreview,fl_file_choosersetpreview,fl_file_chooserrescankeepfilename," & _
"fl_file_choosergettextcolor,fl_file_choosergettextfont,fl_file_choosergettextsize,fl_file_choosergettype,fl_file_choosergetuserdata," & _
"fl_file_choosergetvalue,fl_file_choosernew,fl_file_choosernewbutton,fl_file_chooserpreviewbutton,fl_file_choosershowhiddenbutton," & _
"fl_file_choosershown,fl_file_chooservisible,fl_file_chose_cb,fl_file_icon,fl_file_iconadd,fl_file_iconaddcolor,fl_file_iconaddvertex," & _
"fl_file_iconaddvertex2,fl_file_iconfind,fl_file_iconfirst,fl_file_iconloadfti,fl_file_iconloadimage,fl_file_iconnew,fl_file_iconnext," & _
"fl_file_iconpattern,fl_file_iconsize,fl_file_icontype,fl_file_iconvalue,fl_file_input,fl_file_inputgetdownbox,fl_file_inputgeterrorcolor," & _
"fl_file_inputgetvalue,fl_file_inputhandle,fl_file_inputnew,fl_file_inputsetvalue,fl_file_inputsetvalue2,fl_file_sort_f,fl_file_type," & _
"fl_filechooser_create,fl_filechooser_directory,fl_filechooser_multi,fl_filechooser_single,fl_filechooser_type,fl_fileicon_type," & _
"fl_files,fl_fill_dial,fl_fill_dialnew,fl_fill_slider ,fl_fill_slidernew,fl_find,fl_flat_box,fl_float_input,fl_float_inputnew," & _
"fl_font,fl_fontsize,fl_fontsize,fl_fopen,fl_foreground_color,fl_forward,fl_free_color,fl_free_font,",search)
case asc("g") : return instr(",fl_getawakehandler_,fl_getbelowmouse,fl_getboxtype,fl_getcolor2,fl_getcwd,fl_getdamage,fl_getdndtextops," & _
"fl_getdrawshortcutflag,fl_getenv,fl_getfirstwindow,fl_getfocus,fl_getfontname,fl_getfontsizes,fl_getgrab,fl_geth,fl_getpushed," & _
"fl_getscheme,fl_getscrollbarsize,fl_getshortcutlabel,fl_getvisiblefocus,fl_getw,fl_getx,fl_gety,fl_gif_image,fl_gif_imagenew," & _
"fl_gleam_down_box,fl_gleam_down_frame,fl_gleam_round_down_box,fl_gleam_round_up_box,fl_gleam_thin_down_box,fl_gleam_thin_up_box," & _
"fl_gleam_up_box,fl_gleam_up_frame,fl_graphics_driver,fl_graphics_driverclassname,fl_gray,fl_gray_color,fl_gray_ramp,fl_gray0," & _
"fl_green,fl_group,fl_grouparray,fl_grouparray2,fl_groupasgroup,fl_groupbegin,fl_groupchild,fl_groupchildren,fl_groupconstarray," & _
"fl_groupend,fl_groupfind,fl_groupgetclipchildren,fl_groupgetresizable,fl_grouphandle,fl_groupnew,fl_groupresizeable," & _
"fl_groupsetresizable,fl_gtk_down_box,fl_gtk_down_frame,fl_gtk_round_down_box,fl_gtk_round_up_box,fl_gtk_thin_down_box," & _
"fl_gtk_thin_down_frame,fl_gtk_thin_up_box,fl_gtk_thin_up_frame,fl_gtk_up_box,fl_gtk_up_frame,",search)
case asc("h") : return instr(",fl_handle,fl_handleex,fl_hascheck,fl_hasidle,fl_hastimeout,fl_help,fl_help_f,fl_help_view," & _
"fl_help_viewdirectory,fl_help_viewfilename,fl_help_viewfind,fl_help_viewgetleftline,fl_help_viewgetscrollbarsize," & _
"fl_help_viewgetsize,fl_help_viewgettextcolor,fl_help_viewgettextfont,fl_help_viewgettextsize,fl_help_viewgettopline," & _
"fl_help_viewgetvalue,fl_help_viewload,fl_help_viewnew,fl_help_viewtitle,fl_helvetica,fl_helvetica_bold," & _
"fl_helvetica_bold_italic,fl_helvetica_italic,fl_hold_browser,fl_hold_browsernew,fl_holdbrowser,fl_home,fl_home_page," & _
"fl_hor_fill_slider,fl_hor_fill_slidernew,fl_hor_nice_slider,fl_hor_nice_slidernew,fl_hor_slider,fl_hor_slidernew," & _
"fl_hor_value_slider,fl_hor_value_slidernew,",search)
case asc("i") : return instr(",fl_icon_color,fl_idle_handler,fl_image,fl_image_surface,fl_image_surfaceclassname," & _
"fl_image_surfacegetdriver,fl_image_surfaceimage,fl_image_surfacenew,fl_image_with_alpha,fl_image_asany,fl_imagecopy," & _
"fl_imagecopy2,fl_imagecount,fl_imaged,fl_imagedata,fl_imagegetbytesperpixel,fl_imagegetheight,fl_imagegetpitch," & _
"fl_imagegetwidth,fl_imageh,fl_imageld,fl_imagenew,fl_imagew,fl_inactive,fl_inactive_color,fl_input,fl_input_," & _
"fl_input_choice,fl_input_choicechanged,fl_input_choicegetdownbox,fl_input_choicegetmenu,fl_input_choicegettextcolor," & _
"fl_input_choicegettextfont,fl_input_choicegettextsize,fl_input_choicegetvalue,fl_input_choiceinput,fl_input_choicemenubutton," & _
"fl_input_choicenew,fl_input_copy,fl_input_copycuts,fl_input_cut,fl_input_cut1,fl_input_cut2,fl_input_float," & _
"fl_input_getcursorcolor,fl_input_getinputtype,fl_input_getmark,fl_input_getmaximumsize,fl_input_getposition," & _
"fl_input_getreadonly,fl_input_getshortcut,fl_input_getsize,fl_input_gettabnav,fl_input_gettextcolor," & _
"fl_input_gettextfont,fl_input_gettextsize,fl_input_getvalue,fl_input_getwrap,fl_input_index,fl_input_insert," & _
"fl_input_int,fl_input_multiline,fl_input_multiline_output,fl_input_multiline_output_wrap,fl_input_multiline_wrap," & _
"fl_input_normal,fl_input_normal_output,fl_input_readonly,fl_input_replace,fl_input_secret,fl_input_setmark," & _
"fl_input_setposition,fl_input_setposition2,fl_input_setvalue,fl_input_setvalue2,fl_input_staticvalue,fl_input_staticvalue2," & _
"fl_input_type,fl_input_undo,fl_input_wrap,fl_inputhandle,fl_inputnew,fl_insert,fl_int_input,fl_int_inputnew,fl_iso_key," & _
"fl_isscheme,fl_italic,",search)
case asc("j") : return instr(",fl_join_bevel,fl_join_miter,fl_join_round,fl_jpeg_image,fl_jpeg_imagedelete," & _
"fl_jpeg_imagemem,fl_jpeg_imagenew,fl_jpg_imagedelete,fl_jpg_imagemem,fl_jpg_imagenew,",search)
case asc("k") : return instr(",fl_key_mask,fl_kp,fl_kp_enter,fl_kp_last,",search)
case asc("l") : return instr(",fl_label_draw_f,fl_label_embossed,fl_label_engraved,fl_label_free,fl_label_icon,fl_label_image," & _
"fl_label_measure_f,fl_label_multi,fl_label_no,fl_label_normal,fl_label_shadow,fl_label_symbol,fl_label_type,fl_left," & _
"fl_left_mouse,fl_light_button,fl_light_buttonhandle,fl_light_buttonnew,fl_light1,fl_light2,fl_light3,fl_line_dial," & _
"fl_line_dialnew,fl_line_position,fl_line_style,fl_lock,",search)
case asc("m") : return instr(",fl_magenta,fl_mail,fl_make_path,fl_max_path,fl_media_next,fl_media_play,fl_media_prev," & _
"fl_media_stop,fl_menu,fl_menu_,fl_menu_add,fl_menu_add2,fl_menu_add3,fl_menu_bar,fl_menu_barhandle,fl_menu_barnew," & _
"fl_menu_button,fl_menu_buttonhandle,fl_menu_buttonnew,fl_menu_buttonpopup,fl_menu_clearsubmenu,fl_menu_divider," & _
"fl_menu_findindexbycallback,fl_menu_findindexbyitem,fl_menu_findindexbyname,fl_menu_finditembycallback," & _
"fl_menu_finditembyname,fl_menu_getdownbox,fl_menu_getdowncolor,fl_menu_getmenu,fl_menu_getmode,fl_menu_getsize," & _
"fl_menu_gettextcolor,fl_menu_gettextfont,fl_menu_gettextsize,fl_menu_getvalue,fl_menu_getvaluebyindex," & _
"fl_menu_getvaluebyitem,fl_menu_horizontal,fl_menu_inactive,fl_menu_insert,fl_menu_insert2,fl_menu_invisible," & _
"fl_menu_item,fl_menu_itemactive,fl_menu_itemactivevisible,fl_menu_itemadd,fl_menu_itemadd2,fl_menu_itemcheckbox," & _
"fl_menu_itemchecked,fl_menu_itemfindshortcut,fl_menu_itemfirst,fl_menu_itemfirst2,fl_menu_itemgetargument," & _
"fl_menu_itemgetcallback_p,fl_menu_itemgetlabel,fl_menu_itemgetlabelcolor,fl_menu_itemgetlabelfont," & _
"fl_menu_itemgetlabelsize,fl_menu_itemgetlabeltype,fl_menu_itemgetshortcut,fl_menu_itemgetuserdata," & _
"fl_menu_iteminsert,fl_menu_itemmeasure,fl_menu_itemnext,fl_menu_itemnext2,fl_menu_itempathname,fl_menu_itempopup," & _
"fl_menu_itempulldown,fl_menu_itemradio,fl_menu_itemsize,fl_menu_itemsubmenu,fl_menu_itemtestshortcut," & _
"fl_menu_itemvalue,fl_menu_itemvisible,fl_menu_mvalue,fl_menu_picked,fl_menu_radio,fl_menu_testshortcut," & _
"fl_menu_text,fl_menu_textbyindex,fl_menu_toggle,fl_menu_value,fl_menu_window,fl_menu_windowex," & _
"fl_menu_windowexhandlebase,fl_menu_windowexnew,fl_menu_windowexnew2,fl_menu_windownew,fl_menu_windownew2," & _
"fl_menu_windowoverlay,fl_menubutton_popup_type,fl_menuitem_flag,fl_meta,fl_meta,fl_meta_l,fl_meta_r," & _
"fl_middle,fl_middle_mouse,fl_mkdir,fl_modal,fl_mouse_button,fl_mouse_keyboard_events,fl_mousebutton," & _
"fl_multi_browser,fl_multi_browsernew,fl_multibrowser,fl_multiline_input,fl_multiline_input),fl_multiline_inputnew," & _
"fl_multiline_output,fl_multiline_outputnew,",search)
case asc("n") : return instr(",fl_native_file_chooser,fl_native_file_choosercount,fl_native_file_choosererrormsg," & _
"fl_native_file_chooserfilename,fl_native_file_choosergetdirectory,fl_native_file_choosergetfilename," & _
"fl_native_file_choosergetfilter,fl_native_file_choosergetfiltervalue,fl_native_file_choosergetoptions," & _
"fl_native_file_choosergetpresetfile,fl_native_file_choosergettitle,fl_native_file_choosergettype,fl_native_file_choosernew," & _
"fl_native_file_choosershow,fl_nextwindow,fl_nfc_option,fl_nfc_type,fl_nice_slider,fl_nice_slidernew,fl_no_box,fl_nonspacing," & _
"fl_normal_size,fl_normalbrowser,fl_num_blue,fl_num_free_color,fl_num_gray,fl_num_green,fl_num_lock,fl_num_red,fl_numlock,",search)
case asc("o") : return instr("fl_oflat_box,fl_old_idle_handler,fl_open,fl_option,fl_option_arrow_focus,fl_option_dnd_text," & _
"fl_option_fnfc_uses_gtk,fl_option_last,fl_option_show_tooltips,fl_option_visible_focus,fl_oshadow_box,fl_output,fl_outputnew," & _
"fl_oval_box,fl_oval_frame,fl_overlay_window,fl_overlay_windowcandooverlay,fl_overlay_windowex,fl_overlay_windowexhandlebase," & _
"fl_overlay_windowexnew ,fl_overlay_windowexnew2,",search)
case asc("p") : return instr(",fl_pack,fl_pack_horizontal,fl_pack_type,fl_pack_vertical,fl_packbegin,fl_packend,fl_packgetspacing," & _
"fl_packnew,fl_page_down,fl_page_up,fl_paged_device,fl_paged_deviceformatheight,fl_paged_deviceformatwidht," & _
"fl_paged_devicegetformatname,fl_pause,fl_pixmap,fl_pixmapcopy,fl_pixmapcopy2,fl_pixmapnew,fl_plastic_down_box," & _
"fl_plastic_down_frame,fl_plastic_round_down_box,fl_plastic_round_up_box,fl_plastic_thin_down_box,fl_plastic_thin_up_box," & _
"fl_plastic_up_box,fl_plastic_up_frame,fl_png_image,fl_png_imagemem,fl_png_imagenew,fl_pnm_image,fl_pnm_imagenew," & _
"fl_preferences,fl_preferencesclear,fl_preferencesdeleteallentries,fl_preferencesdeleteallgroups,fl_preferencesdeleteentry," & _
"fl_preferencesdeletegroup,fl_preferencesentries,fl_preferencesentry,fl_preferencesentryexists,fl_preferencesentryname," & _
"fl_preferencesentrypath,fl_preferencesgetdata,fl_preferencesgetdata2,fl_preferencesgetdouble,fl_preferencesgetfloat," & _
"fl_preferencesgetint,fl_preferencesgetsize,fl_preferencesgetstring,fl_preferencesgetstring2,fl_preferencesgetuserdatapath," & _
"fl_preferencesgroup,fl_preferencesgroupexists,fl_preferencesgroups,fl_preferencesnew,fl_preferencesnew2," & _
"fl_preferencesnewchildgroup,fl_preferencesnewgroup,fl_preferencesnewgroup2,fl_preferencessetdata,fl_preferencessetdouble," & _
"fl_preferencessetdouble2,fl_preferencessetfloat,fl_preferencessetfloat2,fl_preferencessetint,fl_preferencessetstring," & _
"fl_print,fl_printer,fl_printerclassname,fl_printerendpage,fl_printergetdriver,fl_printergetprintablerect,fl_printernew," & _
"fl_printerstartjob,fl_printerstartpage,fl_progress,fl_progressgetmaximum,fl_progressgetminimum,fl_progressgetvalue,fl_progressnew,",search)
case asc("r") : return instr(",fl_radio_button,fl_radio_buttonnew,fl_radio_light_button,fl_radio_light_buttonnew," & _
"fl_radio_round_button,fl_radio_round_buttonnew,fl_read,fl_readqueue,fl_ready,fl_red,fl_refresh,fl_reloadscheme," & _
"fl_rename,fl_repeat_button,fl_repeat_buttonhandle,fl_repeat_buttonnew,fl_reserved_type,fl_resizeex,fl_return_button," & _
"fl_return_buttonhandle,fl_return_buttonnew,fl_rflat_box,fl_rgb_color,fl_rgb_image,fl_rgb_imagecopy,fl_rgb_imagecopy2," & _
"fl_rgb_imagenew,fl_right,fl_right_mouse,fl_rmdir,fl_roller,fl_rollernew,fl_root,fl_root_system,fl_root_user," & _
"fl_round_button,fl_round_buttonnew,fl_round_clock,fl_round_clocknew,fl_round_down_box,fl_round_up_box," & _
"fl_rounded_box,fl_rounded_frame,fl_rshadow_box,fl_run,",search)
case asc("s") : return instr(",fl_screen,fl_screen_bold,fl_screencount,fl_screenheight,fl_screenwidth,fl_screenx,fl_screeny,fl_scroll," & _
"fl_scroll_always_on,fl_scroll_both,fl_scroll_both_always,fl_scroll_horizontal,fl_scroll_horizontal_always,fl_scroll_lock,fl_scroll_no," & _
"fl_scroll_type,fl_scroll_vertical,fl_scroll_vertical_always,fl_scrollbar,fl_scrollbargetlinesize,fl_scrollbargetvalue,fl_scrollbarhandle," & _
"fl_scrollbarnew,fl_scrollbarsetvalue,fl_scrollbarvalue,fl_scrollbegin,fl_scrollend,fl_scrollgetscrollbarsize,fl_scrollhandle," & _
"fl_scrollhscrollbar,fl_scrolllock,fl_scrollnew,fl_scrollscrollbar,fl_scrollxposition,fl_scrollyposition,fl_search,fl_secret_input," & _
"fl_secret_inputhandle,fl_secret_inputnew,fl_select_browser,fl_select_browsernew,fl_select_multi,fl_select_none,fl_select_single," & _
"fl_selectbrowser,fl_selection_color,fl_setfonts,fl_setscheme,fl_shadow_box,fl_shadow_frame,fl_shared_handler,fl_shared_image," & _
"fl_shared_imagecopy,fl_shared_imagecopy2,fl_shared_imagefind,fl_shared_imageget,fl_shared_imageimages,fl_shared_imagename," & _
"fl_shared_imagenumimages,fl_shared_imagerefcount,fl_shift,fl_shift_l,fl_shift_r,fl_shortcut,fl_simple_counter," & _
"fl_simple_counternew,fl_single_window,fl_single_windowex,fl_single_windowexhandlebase,fl_single_windowexnew,fl_single_windowexnew2," & _
"fl_single_windownew,fl_single_windownew2,fl_sleep,fl_slider,fl_slider_hor_fill,fl_slider_hor_nice,fl_slider_hor_slider," & _
"fl_slider_type,fl_slider_vert,fl_slider_vert_fill,fl_slider_vert_nice,fl_slidergetslider,fl_slidergetslidersize,fl_sliderhandle," & _
"fl_slidernew,fl_slidernew2,fl_sliderscrollvalue,fl_socket,fl_solid,fl_sort_ascending,fl_sort_descending,fl_sortorder,fl_spinner," & _
"fl_spinnergetcolor,fl_spinnergetformat,fl_spinnergetmaximum,fl_spinnergetminimum,fl_spinnergetstep,fl_spinnergettextcolor," & _
"fl_spinnergettextfont,fl_spinnergettextsize,fl_spinnergettype,fl_spinnergetvalue,fl_spinnerhandle,fl_spinnernew,fl_stat," & _
"fl_stop,fl_string,fl_submenu,fl_submenu_pointer,fl_surface_device,fl_surface_deviceclassname,fl_surface_devicegetdriver," & _
"fl_surface_devicesurface,fl_symbol,fl_system,fl_scrollscrollto,",search)
case asc("t") : return instr(",fl_tab_key,fl_tabbegin,fl_tabend,fl_table,fl_table_row,fl_table_rowex,fl_table_rowexfindcell," & _
"fl_table_rowexhandlebase,fl_table_rowexnew,fl_table_rowgetrows,fl_table_rowgettype,fl_table_rownew,fl_table_rowrowselected," & _
"fl_table_rowselectrow,fl_tablearray,fl_tablecallbackcol,fl_tablecallbackcontext,fl_tablecallbackrow,fl_tablechild," & _
"fl_tablechildren,fl_tablecontext,fl_tableex,fl_tableexfindcell,fl_tableexhandlebase,fl_tableexnew,fl_tablefind," & _
"fl_tablegetcolheader,fl_tablegetcolheadercolor,fl_tablegetcolheaderheight,fl_tablegetcolposition,fl_tablegetcolresize," & _
"fl_tablegetcolresizemin,fl_tablegetcols,fl_tablegetcolwidth,fl_tablegetrowheader,fl_tablegetrowheadercolor," & _
"fl_tablegetrowheaderwidth,fl_tablegetrowheight,fl_tablegetrowposition,fl_tablegetrowresize,fl_tablegetrowresizemin," & _
"fl_tablegetrows,fl_tablegettablebox,fl_tablegettoprow,fl_tableinsert,fl_tableisinteractiveresize,fl_tableisselected," & _
"fl_tablemovecursor,fl_tablenew,fl_tablerowselectmode,fl_tabnew,fl_tabs,fl_tabsend,fl_tabsgetpush,fl_tabsgetvalue," & _
"fl_tabshandle,fl_tabsnew,fl_tabssetpush,fl_tabssetvalue,fl_tabswhich,fl_testshortcut,fl_text_buffer,fl_text_bufferaddress," & _
"fl_text_bufferaddress2,fl_text_bufferappendfile,fl_text_bufferbyteat,fl_text_buffercharat,fl_text_buffercountdisplayedcharacters," & _
"fl_text_buffercountlines,fl_text_bufferfindcharbackward,fl_text_bufferfindcharforward,fl_text_buffergethighlight," & _
"fl_text_buffergettabdistance,fl_text_buffergettext,fl_text_bufferhighlightposition,fl_text_bufferhighlightselection," & _
"fl_text_bufferhighlighttext,fl_text_bufferinsertfile,fl_text_bufferlength,fl_text_bufferlineend,fl_text_bufferlinestart," & _
"fl_text_bufferlinetext,fl_text_bufferloadfile,fl_text_buffernew,fl_text_buffernextchar,fl_text_buffernextcharclipped," & _
"fl_text_bufferoutputfile,fl_text_bufferprevchar,fl_text_bufferprevcharclipped,fl_text_bufferprimaryselection," & _
"fl_text_bufferprimaryselection2,fl_text_bufferrewindlines,fl_text_buffersavefile,fl_text_buffersearchbackward," & _
"fl_text_buffersearchforward,fl_text_buffersecondaryselected,fl_text_buffersecondaryselection,fl_text_bufferaddmodifycallback," & _
"fl_text_buffersecondaryselectionposition,fl_text_buffersecondaryselectiontext,fl_text_bufferselected," & _
"fl_text_bufferselectionposition,fl_text_bufferselectiontext,fl_text_bufferskipdisplayedcharacters,fl_text_bufferskiplines," & _
"fl_text_buffertextrange,fl_text_bufferundo,fl_text_bufferutf8align,fl_text_bufferwordend,fl_text_bufferwordstart,fl_text_display," & _
"fl_text_display_cursor_shape,fl_text_display_wrap_mode,fl_text_displaycoltox,fl_text_displaycountlines,fl_text_displaygetbuffer," & _
"fl_text_displaygetcursorcolor,fl_text_displaygetinsertposition,fl_text_displaygetlinenumberalign," & _
"fl_text_displaygetlinenumberbgcolor,fl_text_displaygetlinenumberfgcolor,fl_text_displaygetlinenumberfont," & _
"fl_text_displaygetlinenumberformat,fl_text_displaygetlinenumbersize,fl_text_displaygetlinenumberwidth," & _
"fl_text_displaygetscrollbaralign,fl_text_displaygetscrollbarwidth,fl_text_displaygetshortcut,fl_text_displaygettextcolor," & _
"fl_text_displaygettextfont,fl_text_displaygettextsize,fl_text_displayhandle,fl_text_displayinselection,fl_text_displaylineend," & _
"fl_text_displaylinestart,fl_text_displaymovedown,fl_text_displaymoveleft,fl_text_displaymoveright,fl_text_displaymoveup," & _
"fl_text_displaynew,fl_text_displaypositionstyle,fl_text_displaypositiontoxy,fl_text_displayrewindlines," & _
"fl_text_displayskiplines,fl_text_displaywordend,fl_text_displaywordstart,fl_text_displaywrappedcolumn," & _
"fl_text_displaywrappedrow,fl_text_displayxtocol,fl_text_editor,fl_text_editorboundkeyfunction,fl_text_displayredisplayrange," & _
"fl_text_editorboundkeyfunction2,fl_text_editorgetinsertmode,fl_text_editorhandle,fl_text_editornew," & _
"fl_text_modify_cb,fl_text_predelete_cb,fl_text_selection,fl_text_selectionend,fl_text_selectiongetselected," & _
"fl_text_selectionincludes,fl_text_selectionposition,fl_text_selectionstart,fl_text_xxx,fl_thin_down_box," & _
"fl_thin_down_frame,fl_thin_up_box,fl_thin_up_frame,fl_threadmessage,fl_tile,fl_tilebegin,fl_tiled_image," & _
"fl_tiled_imagecopy,fl_tiled_imagecopy2,fl_tiled_imageimage,fl_tiled_imagenew,fl_tileend,fl_tilehandle," & _
"fl_tilenew,fl_timeout_handler,fl_times,fl_times_bold,fl_times_bold_italic,fl_times_italic,fl_toggle_button," & _
"fl_toggle_buttonnew,fl_tolower,fl_tooltipgetcolor,fl_tooltipgetcurrentwidget,fl_tooltipgetdelay," & _
"fl_tooltipgetenabled,fl_tooltipgetfont,fl_tooltipgetfontsize,fl_tooltipgethoverdelay,fl_tooltipgetmarginheight," & _
"fl_tooltipgetmarginwidth,fl_tooltipgettextcolor,fl_tooltipgetwrapwidth,fl_top,fl_toupper,fl_tree,fl_tree_connector," & _
"fl_tree_connector_dotted,fl_tree_connector_none,fl_tree_connector_solid,fl_tree_item,fl_tree_item_array," & _
"fl_tree_item_draw_callback,fl_tree_item_draw_default,fl_tree_item_draw_label_and_widget,fl_tree_item_draw_mode," & _
"fl_tree_item_flags,fl_tree_item_height_from_widget,fl_tree_item_reselect_mode,fl_tree_itemadd,fl_tree_itemadd2," & _
"fl_tree_itemadditem,fl_tree_itemadditem2,fl_tree_itemdeparent,fl_tree_itemdepth,fl_tree_itemdrawitemcontent," & _
"fl_tree_itemfindchildbyitem,fl_tree_itemfindchildbyname,fl_tree_itemfindchilditem,fl_tree_itemfindchilditembyname," & _
"fl_tree_itemfindconstchilditem,fl_tree_itemfindconstchilditembyname,fl_tree_itemfindconstitem,fl_tree_itemfinditem," & _
"fl_tree_itemgetchild,fl_tree_itemgetchildren,fl_tree_itemgetconstchild,fl_tree_itemgetconstparent,fl_tree_itemgeth," & _
"fl_tree_itemgetlabel,fl_tree_itemgetlabelbgcolor,fl_tree_itemgetlabelcolor,fl_tree_itemgetlabelfgcolor," & _
"fl_tree_itemgetlabelh,fl_tree_itemgetlabelsize,fl_tree_itemgetlabelw,fl_tree_itemgetlabelx,fl_tree_itemgetlabely," & _
"fl_tree_itemgetparent,fl_tree_itemgetprefs,fl_tree_itemgettree,fl_tree_itemgetuserdata,fl_tree_itemgetw," & _
"fl_tree_itemgetwidget,fl_tree_itemgetx,fl_tree_itemgety,fl_tree_itemhaschildren,fl_tree_iteminsert," & _
"fl_tree_iteminsertabove,fl_tree_itemisclose,fl_tree_itemisopen,fl_tree_itemlabelfont,fl_tree_itemmove," & _
"fl_tree_itemmoveabove,fl_tree_itemmovebelow,fl_tree_itemmoveinto,fl_tree_itemmoveitem,fl_tree_itemnew," & _
"fl_tree_itemnextdisplayed,fl_tree_itemnextsibling,fl_tree_itemprev,fl_tree_itemprevdisplayed," & _
"fl_tree_itemprevsibling,fl_tree_itemremovechild,fl_tree_itemremovechildsetlabel,fl_tree_itemreparent," & _
"fl_tree_itemreplace,fl_tree_itemreplacechild,fl_tree_itemswapchildren,fl_tree_prefs,fl_tree_reason," & _
"fl_tree_reason_closed,fl_tree_reason_deselected,fl_tree_reason_dragged,fl_tree_reason_none,fl_tree_reason_opened," & _
"fl_tree_reason_reselected,fl_tree_reason_selected,fl_tree_select,fl_tree_select_multi,fl_tree_select_none," & _
"fl_tree_select_single,fl_tree_select_single_draggable,fl_tree_selectable_always,fl_tree_selectable_once,fl_tree_sort," & _
"fl_tree_sort_ascending,fl_tree_sort_descending,fl_tree_sort_none,",search)
case asc("u") : return instr(",fl_ucs_to_utf16,fl_unlink,fl_up,fl_up_box,fl_up_frame,fl_utf_nb_char,fl_utf_strcasecmp," & _
"fl_utf_strncasecmp,fl_utf_tolower,fl_utf_toupper,fl_utf2mbcs,fl_utf8back,fl_utf8bytes,fl_utf8decode,fl_utf8encode," & _
"fl_utf8from_mb,fl_utf8froma,fl_utf8fromwc,fl_utf8fwd,fl_utf8len,fl_utf8len1,fl_utf8locale,fl_utf8test," & _
"fl_utf8to_mb,fl_utf8toa,fl_utf8toutf16,fl_utf8towc,",search)
case asc("v") : return instr(",fl_valuator,fl_valuator_horizontal,fl_valuator_type,fl_valuator_vertical,fl_valuatorclamp," & _
"fl_valuatorformat,fl_valuatorgetmaximum,fl_valuatorgetminimum,fl_valuatorgetstep,fl_valuatorgetvalue,fl_valuatorincrement," & _
"fl_valuatorround,fl_valuatorsetvalue,fl_value_input,fl_value_inputgetcursorcolor,fl_value_inputgetshortcut," & _
"fl_value_inputgetsoft,fl_value_inputgettextcolor,fl_value_inputgettextfont,fl_value_inputgettextsize," & _
"fl_value_inputhandle,fl_value_inputnew,fl_value_output,fl_value_outputgetsoft,fl_value_outputgettextcolor," & _
"fl_value_outputgettextfont,fl_value_outputgettextsize,fl_value_outputhandle,fl_value_outputnew,fl_value_slider," & _
"fl_value_slidergettextcolor,fl_value_slidergettextfont,fl_value_slidergettextsize,fl_value_sliderhandle," & _
"fl_value_slidernew,fl_version,fl_visual,fl_volume_down,fl_volume_mute,fl_volume_up,",search)
case asc("w") : return instr(",fl_wait,fl_wait2,fl_wcwidth,fl_when,fl_when_changed,fl_when_enter_key," & _
"fl_when_enter_key_always,fl_when_enter_key_changed,fl_when_never,fl_when_not_changed,fl_when_release," & _
"fl_when_release_always,fl_white,fl_widget,fl_widget_tracker,fl_widget_trackerdeleted,fl_widget_trackerexists," & _
"fl_widget_trackernew,fl_widget_trackerwidget,fl_widget_cast,fl_widgetactive,fl_widgetactiver,fl_widgetasgroup," & _
"fl_widgetaswindow,fl_widgetchanged,fl_widgetcontains,fl_widgetdamageresize,fl_widgetex,fl_widgetexhandlebase," & _
"fl_widgetexnew,fl_widgetgetalign,fl_widgetgetargument,fl_widgetgetbox,fl_widgetgetcallback,fl_widgetgetcolor," & _
"fl_widgetgetcolor2,fl_widgetgetdamage,fl_widgetgetdeimage,fl_widgetgeth,fl_widgetgetimage,fl_widgetgetimage2," & _
"fl_widgetgetlabel,fl_widgetgetlabelcolor,fl_widgetgetlabelfont,fl_widgetgetlabelsize,fl_widgetgetlabeltype," & _
"fl_widgetgetparent,fl_widgetgetselectioncolor,fl_widgetgettooltip,fl_widgetgettype,fl_widgetgetuserdata," & _
"fl_widgetgetw,fl_widgetgetwhen,fl_widgetgetx,fl_widgetgety,fl_widgethandle,fl_widgetinside," & _
"fl_widgetlabelshortcut,fl_widgetoutput,fl_widgets,fl_widgetsetbox,fl_widgettakefocus,fl_widgettakesevents," & _
"fl_widgettestshortcut,fl_widgettestshortcut2,fl_widgettopwindow,fl_widgettopwindowoffset,fl_widgetvisible," & _
"fl_widgetvisibler,fl_widgetwindow,fl_window,fl_windowcurrent,fl_windowdecorated_h,fl_windowdecorated_w," & _
"fl_windowex,fl_windowexhandlebase,fl_windowexnew,fl_windowexnew2,fl_windowfullscreenactive,fl_windowgetborder," & _
"fl_windowgeticonlabel,fl_windowgetlabel,fl_windowgetmenuwindow,fl_windowgetmodal,fl_windowgetnonmodal," & _
"fl_windowgetoverride,fl_windowgettooltipwindow,fl_windowgetxclass,fl_windowhandle,fl_windownew,fl_windownew2," & _
"fl_windowresizable,fl_windowresizeable,fl_windowsetresizable,fl_windowsetresizeable,fl_windowshown," & _
"fl_windowxroot,fl_windowyroot,fl_wizard,fl_wizardbegin,fl_wizardend,fl_wizardgetvalue,fl_wizardnew," & _
"fl_wizardpagebegin,fl_wizardpageend,fl_wizardpagenew,fl_write,fl_widgetposition,fl_windowcopylabel," & _
"fl_widgetsetcallbackarg,fl_widgetsetlabel,fl_windowhide,fl_widgetsetalign,",search)
case asc("x") : return instr(",fl_xbm_image,fl_xbm_imagenew,fl_xid,fl_xpm_image,fl_xpm_imagenew,",search)
case asc("y") : return instr(",fl_yellow,",search)
case asc("z") : return instr(",fl_zapf_dingbats,",search)
end select
return 0
end function
' a litle bit syntax highlighting
sub Highlight(byval Text as const zstring ptr,byval Style as zstring ptr,byval length as long)
#ifdef __FB_DEBUG__
if Text=0 then flMessageBox("ModifyCb","Text=0")
if Style=0 then flMessageBox("ModifyCb","Style=0")
if length<1 then flMessageBox("ModifyCb","length<1")
#endif
#define FILLSTYLE(_style_) Style[e]=_style_:e+=1:length-=1:c=Text[e]
#define RANGESTYLE(_style_) while s<e:Style[s]=_style_:s+=1:wend
dim as long s,e
dim as string w
print "Highlight " & length
dim as ubyte c = Text[e]:length-=1
while length>0
' white chars ?
while IsWhite(c) andalso length>0
FILLSTYLE(STYLE_PLAIN)
wend
' single line comment ?
if c=asc("'") andalso length>0 then
FILLSTYLE(STYLE_COMMENT)
while c<>&H0A andalso length>0
FILLSTYLE(STYLE_COMMENT)
wend
if c=&H0D then FILLSTYLE(STYLE_COMMENT)
end if
' multi line comment ?
if c=asc("/") andalso length>0 then
if Text[e+1]=asc("'") then
FILLSTYLE(STYLE_COMMENT): FILLSTYLE(STYLE_COMMENT)
while c<>asc("'") andalso Text[e]<>asc("/") andalso length>0
FILLSTYLE(STYLE_COMMENT)
wend
FILLSTYLE(STYLE_COMMENT):FILLSTYLE(STYLE_COMMENT)
end if
end if
' string ?
if c=34 then
FILLSTYLE(STYLE_STRING)
while c<>34 andalso c<>&H0A andalso length>0
FILLSTYLE(STYLE_STRING)
wend
if c=34 then FILLSTYLE(STYLE_STRING)
end if
' string ?
if c=34 Then
dim As Long cpt
FILLSTYLE(STYLE_STRING)
cpt=1
while cpt andalso c<>&H0A andalso length>0
if c=34 then
FILLSTYLE(STYLE_STRING)
cpt=1-cpt
if c=34 then cpt=1-cpt:FILLSTYLE(STYLE_STRING)
else
FILLSTYLE(STYLE_STRING)
end if
wend
end if
' dec number ?
if IsNumber(c) then
FILLSTYLE(STYLE_NUMBER)
while IsNumber(c) andalso length>0
FILLSTYLE(STYLE_NUMBER)
wend
end if
' a part of a float number ? (no E notation)
if c=asc(".") then
FILLSTYLE(STYLE_NUMBER)
while IsNumber(c) andalso length>0
FILLSTYLE(STYLE_NUMBER)
wend
end if
' &H &O &B
if c=asc("&") andalso length>2 then
if Text[e+1]=asc("h") or Text[e+1]=asc("H") then
FILLSTYLE(STYLE_NUMBER) : FILLSTYLE(STYLE_NUMBER)
while IsHex(c) andalso length>0
FILLSTYLE(STYLE_NUMBER)
wend
elseif Text[e+1]=asc("o") or Text[e+1]=asc("O") then
FILLSTYLE(STYLE_NUMBER) : FILLSTYLE(STYLE_NUMBER)
while IsOct(c) andalso length>0
FILLSTYLE(STYLE_NUMBER)
wend
elseif Text[e+1]=asc("b") or Text[e+1]=asc("B") then
FILLSTYLE(STYLE_NUMBER) : FILLSTYLE(STYLE_NUMBER)
while IsBin(c) andalso length>0
FILLSTYLE(STYLE_NUMBER)
wend
end if
end if
' get a word
if c=asc("#") or IsAlpha(c) then
s=e : w=""
while c=asc("#") or IsAlphaNum(c) andalso length>0
w &= chr(c) : e+=1 : length-=1 : c=Text[e]
wend
'print "|" & w & "|"
if IsDatatype(w) then
RANGESTYLE(STYLE_DATATYPE)
elseif IsKeyword(w) then
RANGESTYLE(STYLE_KEYWORD)
elseif IsPreproc(w) then
RANGESTYLE(STYLE_PREPROC)
elseif IsUserlib(w) then
RANGESTYLE(STYLE_USERLIB)
else
RANGESTYLE(STYLE_PLAIN)
end if
elseif IsOperator(c) then
FILLSTYLE(STYLE_OTHER)
elseif IsDelimiter(c) then
FILLSTYLE(STYLE_OTHER)
else
FILLSTYLE(STYLE_PLAIN)
end if
wend
#undef FILLSTYLE
#undef RANGESTYLE
end sub
sub ModifyCb cdecl (byval p as long,byval nInserted as long,byval nDeleted as long, _
byval nRestyled as long,byval deletedText as const zstring ptr,byval pUserdata as any ptr)
dim as zstring ptr Text,Style
dim as long e,s=p
dim as Fl_Text_Editor ptr Editor = pUserdata
dim as Fl_Text_Buffer ptr TextBuffer = Fl_Text_DisplayGetBuffer(Editor)
dim as Fl_Text_Buffer ptr StyleBuffer = Fl_WidgetGetUserData(Editor)
#ifdef __FB_DEBUG__
if puserdata=0 then flMessageBox("ModifyCb","puserdata=0")
if TextBuffer=0 then flMessageBox("ModifyCb","TextBuffer=0")
if StyleBuffer=0 then flMessageBox("ModifyCb","StyleBuffer=0")
#endif
print "ModifyCb " & p,nInserted,nDeleted,nRestyled
if nInserted=0 andalso nDeleted=0 then
Fl_Text_BufferUnselect StyleBuffer
return
end if
if (nInserted > 0) then
e = s + nInserted
Style = malloc(nInserted + 1)
memset(Style, STYLE_PLAIN, nInserted)
Style[nInserted] = 0
Fl_Text_BufferReplace(StyleBuffer,s,e,Style)
free Style
end if
if (nDeleted>0) then
e = s + nDeleted
Fl_Text_BufferRemove(StyleBuffer,s,e)
end if
Fl_Text_BufferSelect(StyleBuffer,s,e)
s = Fl_Text_BufferLineStart(TextBuffer,s)
e = Fl_Text_BufferLength(TextBuffer)
'e = Fl_Text_BufferLineEnd(TextBuffer,e)
Text = Fl_Text_BufferTextRange(TextBuffer ,s,e)
Style = Fl_Text_BufferTextRange(StyleBuffer,s,e)
Highlight(Text,Style,e-s)
Fl_Text_BufferReplace(StyleBuffer,s,e,Style)
Fl_Text_DisplayRedisplayRange(Editor,s,e)
Fl_Free Text
Fl_Free Style
end sub
'
' main
'
var win = Fl_WindowNew(Fl_GetW()*0.75,Fl_GetH()*0.75, "Syntax Highlighter")
var edt = Fl_Text_EditorNew(5,5,Fl_WidgetGetW(win)-10,Fl_WidgetGetH(win)-10)
var TextBuffer = Fl_Text_BufferNew()
var StyleBuffer = Fl_Text_BufferNew()
Fl_WidgetSetUserdata(edt,StyleBuffer)
Fl_Text_DisplaySetLinenumberWidth(edt,6*8) '0 = line numbers off
Fl_Text_DisplaySetBuffer(edt,TextBuffer)
Fl_Text_DisplayHighlightData(edt,StyleBuffer,@StyleTable(0),ubound(StyleTable)+1)
Fl_Text_BufferAddModifyCallback(TextBuffer,@ModifyCB,edt)
if Fl_Text_BufferLoadFile(TextBuffer,"syntax_highlighter.bas")<>0 then
Fl_Text_BufferSetText(TextBuffer,!"print \"type your stuff\"")
end if
Fl_GroupSetResizable(win,edt)
Fl_WindowShow(win)
Fl_Run
But i still find some missing here and there, and this will not end soon, i think.