FLTK-C-1.3.3 for FreeBASIC

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
bcohio2001
Posts: 546
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby bcohio2001 » Aug 06, 2019 22:53

I cannot find an example in this topic, or in any of your "test" programs.

How to create and use multiple windows.
This is how I started, but the "Config" dlg does not have it's button shown.
The dialog itself shows, but not the enclosed button.
(PS. No weird undefined code this time.....LOL)

Code: Select all

#Include Once "fltk-c.bi"
Type ConfigDlg
   As Fl_Window Ptr Win
   As Fl_Button Ptr Setme
   As Boolean CanExit 'exit sub flag
End Type

Sub SetConfig Cdecl (ByVal self As Fl_Widget Ptr, ByVal userdata As Any Ptr)
   'user clicked "Set" button
   Dim As ConfigDlg Ptr C = Cast(ConfigDlg Ptr, userdata)
   C->CanExit = TRUE
End Sub

Sub DoConfig(ByRef P As ULong, ByRef C As UShort)
   Dim As ConfigDlg Dlg
   '
   Dlg.Win = Fl_WindowNew(216, 123, "Configuration") 'Shows
   Dlg.Setme = Fl_ButtonNew(132,105,57,15,"Set") 'DOES NOT SHOW
   Print Dlg.SetMe
   Fl_WidgetSetCallbackArg(Dlg.Setme, @SetConfig, @Dlg)
   Fl_WindowEnd Dlg.Win
   Fl_GroupSetResizable Dlg.Win, Dlg.Win
   '
   Fl_WindowShow Dlg.Win
   '
   'sit here and wait for set button click
   While Dlg.CanExit = FALSE
      Sleep 10
   Wend
   '
   Fl_WindowHide(Dlg.Win) 'close dlg
End Sub

Function ButtonHandleCB Cdecl (ByVal self As Any Ptr,ByVal event As Fl_Event) As Long
   Dim As ULong Plat
   Dim As UShort Cfg
   Select Case As Const event
      Case FL_EVENT_PUSH
         DoConfig(Plat, Cfg)
   End Select
   Return Fl_ButtonExHandleBase(self,event) ' don't eat the event
End Function

Dim As Fl_Window   Ptr Win = Fl_WindowNew(320,200, "Main window")
Dim As Fl_ButtonEx Ptr Btn = Fl_ButtonExNew(10,10,320-20,200-20,"Config")
Fl_ButtonExSetHandleCB Btn,@ButtonHandleCB
Fl_WindowShow Win
Fl_Run
D.J.Peters
Posts: 7835
Joined: May 28, 2005 3:28

Re: FLTK-C-1.3.3 for FreeBASIC

Postby D.J.Peters » Aug 07, 2019 13:17

Code: Select all

   'sit here and wait for set button click
   While Fl_WindowShown(Dlg.Win)
      print ".";
      fl_Wait()
   Wend
I'm sit here and wait for coffee :-)

The problem are you enter the fltk main loop with Fl_Run()
inside from the main loop (a event callback) you create a window
than you enter a second loop your own.

While Dlg.CanExit = FALSE
Sleep 10
Wend

Sleep say's hello OS I go sleeping do with my CPU time what you like

How should fltk do any job while you sleep in a loop :-)

fltk run's in the same thread as your application !

Another point are if your dialog are shown
a user can click the config button again and again
this will create more and more dialogs ! (try it self)

As a solution make the config dialog "modal" before you call Fl_WindowShow(Dlg.Win)
in this case the user must first close the config dialog before the GUI show can go on :-)

here are the result if you search for "modal" in file: "fltk-main.bi"
(i'm 36 hours without sleep I'm off now)

Joshy

Code: Select all

' Returns the top-most modal() window currently shown.
declare function Fl_Modal as Fl_Window ptr
declare sub      Fl_WindowSetModal(byval win as Fl_Window ptr)
declare function Fl_WindowGetModal(byval win as Fl_Window ptr) as long
declare sub      Fl_WindowSetNonModal(byval win as Fl_Window ptr)
declare function Fl_WindowGetNonModal(byval win as Fl_Window ptr) as long
declare sub      Fl_WindowClearModalStates(byval win as Fl_Window ptr)
bcohio2001
Posts: 546
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby bcohio2001 » Aug 07, 2019 20:40

Thanks for the assistance.
This is my first time using FLTK, trying to adapt a large "window's only" program.

From what I read, Fl_Run() repeatably calls Fl_Wait(), so figured that would not need to call anything more.
D.J.Peters
Posts: 7835
Joined: May 28, 2005 3:28

Re: FLTK-C-1.3.3 for FreeBASIC

Postby D.J.Peters » Aug 07, 2019 21:06

bcohio2001 wrote:From what I read, Fl_Run() repeatably calls Fl_Wait(), so figured that would not need to call anything more.
In the case it's a question ?

Yes Fl_Wait() is the Heartbeat of fltk.

So if you are in a loop with sleep the main loop of Fl_Run() can't call Fl_Wait() anymore !

Fl_Wait() will draw your widgets on the window and handled all waiting events if any (window resize, mouse buttons, mouse move, key press etc.)

Happy GUI coding !

Joshy

edit: a note for all fltk-c beginners
if you ever coded with VB 4/5/6 Fl_Wait() is what DoEvents() was in VB ! (if not VB = VisualBasic)
bcohio2001
Posts: 546
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby bcohio2001 » Aug 07, 2019 23:10

Another quick question.
Is there any setting for Fl_Window() to eliminate the system menu. (Minimize/Maximize/Close)
In my "Include Digger" while parsing out the .bi files, I have a window with only a progress bar showing.
I do not want the user to minimize or close it.
I think my only 2 choices are.... Finding a setting or trapping the window events in a callback. Basically doing nothing if user clicks on the close.
D.J.Peters
Posts: 7835
Joined: May 28, 2005 3:28

Re: FLTK-C-1.3.3 for FreeBASIC

Postby D.J.Peters » Aug 08, 2019 0:38

bcohio2001 wrote:I have a window with only a progress bar showing.
The desktop manager draws the buttons, icons and title bar the name for this stuff are "window decoration" :-)

You can disable the decoration in C++ with Fl_Window.border = true or false

in FreeBASIC or C notation Fl_WindowSetBorder()

Question why not looking at the test files ?

Joshy

from file: "Fl_WindowSetBorder01.bas"

Code: Select all

#include once "fltk-c.bi"
sub ButtonCB cdecl (byval self as FL_WIDGET ptr)
  Fl_WindowHide(Fl_WidgetWindow(self))
end sub
' main
var win = Fl_WindowNew2(Fl_GetW()/2-160,Fl_GetH()/2-100,320,200)
Fl_WindowSetBorder(win,0)
Fl_BoxNew(10,10,300,90,"a window without decoration")
Fl_WidgetSetCallback0(Fl_ButtonNew(100,100,120,24,"close"),@ButtonCB)
Fl_WindowShow(win)
Fl_Run()
from file "fltk-main.bi":

Code: Select all

declare sub      Fl_WindowSetBorder(byval win as Fl_Window ptr, byval b as long)
declare function Fl_WindowGetBorder(byval win as Fl_Window ptr) as long
declare sub      Fl_WindowClearBorder(byval win as Fl_Window ptr)
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 08, 2019 10:36

A new version of FastLighter, now with color change, toolbar, tabs and syntax-highlighting. Fbc-options.bi stays the same.

Code: Select all

' FastLighter_21.bas
' IDE for FreeBASIC 1.06 and Fltk-c 1.3.3
' by Knatterton

#ifdef __FB_WIN32__ ' goes for all windows
   var shared fbc_name = @"fbc*.exe"
   var shared fbc_path = @"\FreeBASIC\"
   var shared file_name = @"FastLighter.bas"
   var shared file_path = @"\FreeBASIC\"
#else ' linux or other
   var shared fbc_name = @"fbc"
   var shared fbc_path = @"/usr/local/bin/"
   var shared file_name = @"FastLighter.bas"
   var shared file_path = @"/home/fujitsu/Projekte/"
#endif

dim shared as ubyte r8=218,g8=243,b8=100
dim shared as string cmd_line
cmd_line = " " & *file_name

#include once "fltk-c.bi"
#include once "fbc_options.bi"
#include once "fltk_edit.bi"

dim shared as Fl_Text_Buffer ptr buf
buf = Fl_Text_BufferNew()
var hd  = Fl_Text_BufferNew()

' menubar
sub NewCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  Fl_Text_BufferSetText(buf,"")
end sub

sub OpenCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
 flFileChooserOkLabel("Open")
 dim as string result = CurDir
  var fc = Fl_File_ChooserNew(result, "*", FL_FILECHOOSER_SINGLE, "Select a file")
  Fl_File_ChooserSetPreview(fc,0)
  Fl_File_ChooserShowCenter(fc)
  while Fl_File_ChooserShown(fc) andalso Fl_Wait()=1
  wend
  var file = Fl_File_ChooserGetValue(fc)
  if file then print "pathfile: " & *file
 
  'Fl_ReDraw()
end sub

sub SaveCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  if Fl_Text_BufferSaveFile(buf,file_name) <> 0 then
    print "error"
  end if
end sub

sub SaveAsCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  flFileChooserOkLabel("Save")
  dim as string result = CurDir
  var fc = Fl_File_ChooserNew(result, "*", FL_FILECHOOSER_SINGLE, "Select a file")
  flFileChooserOkLabel("Save")
  Fl_File_ChooserSetPreview(fc,0)
  Fl_File_ChooserShowCenter(fc)
  while Fl_File_ChooserShown(fc) andalso Fl_Wait()=1
  wend
  var file = Fl_File_ChooserGetValue(fc)
  if file then print "pathfile: " & *file
  if Fl_Text_BufferSaveFile(buf,file) <> 0 then
    print "error"
  end if
end sub

sub PrintCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub QuitCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  if flChoice("Do you really want to exit ?","no","yes") then
    Fl_WindowHide Fl_WidgetWindow(self)
  end if
end sub

sub UndoCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub CutCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub CopyCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub PasteCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub DeleteCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub FindCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
end sub

sub ReplaceCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  var hv  = Fl_Help_ViewNew(10,10,620,460)
  Fl_Help_ViewLoad hv,"media/test01.html"
end sub

sub CompileCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
   'A Windows based example but the same idea applies to Linux
   Dim result As Integer
   result = Exec( *fbc_name, cmd_line)
   If result = -1 Then
       Print "Error running "; fbc_name
   Else
       Print "Exit code:"; result
   End If
end sub

sub InputCB cdecl (byval self as Fl_Widget ptr)
  print fbc_path & fbc_name
end sub

sub InputButtonCB cdecl (byval button as FL_WIDGET ptr, inputtext as any ptr)
  flFileChooserOkLabel("Take it")
  dim as string result = CurDir
  var fc = Fl_File_ChooserNew(result, "*" , FL_FILECHOOSER_SINGLE, "Find Fbc")
  Fl_File_ChooserSetPreview(fc,0)
  Fl_File_ChooserShowCenter(fc)
  while Fl_File_ChooserShown(fc) andalso Fl_Wait()=1
  wend
  dim as string filepath = *Fl_File_ChooserGetValue(fc)
  dim as string file
  dim as long last
  ' get file name out of filepath
  last = InStrRev(filepath, SEP)
  file = Mid(filepath, last + 1, len(filepath))
  fbc_opt(37).value = file
  'Fl_WindowCopyLabel but,file
  Fl_Input_SetValue(inputtext, filepath)
  print filepath '*path
end sub

sub PrefEndButtonCB cdecl (byval button as FL_WIDGET ptr, pref as any ptr)
  Fl_WindowHide pref
end sub

sub OptionsCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  fbc_options
end sub

sub PrefCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
   var pref = Fl_WindowNew(440, 100, "Preferences")
   Fl_WindowSetModal(pref)
   var Input_text = Fl_InputNew(120, 12,200, 20, "Path to FBC:")
   Fl_WidgetSetCallback0(Input_text, @InputCB)
   Fl_Input_SetValue(Input_text, *fbc_path & *fbc_name)
   
   var Btn1 = Fl_ButtonNew(330,12,60,22,"Choose")
   Fl_WidgetSetCallbackArg Btn1,@InputButtonCB, Input_text
   
   var Btn2 = Fl_ButtonNew(330,60,60,22,"OK")
   Fl_WidgetSetCallbackArg Btn2,@PrefEndButtonCB, pref
   Fl_WindowShow pref
end sub

sub ColorBackCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  flColorChooser "Background Color",r8,g8,b8, FL_COLORCHOOSER_RGB
  Fl_Background(r8,g8,b8)
  Fl_ReDraw()
end sub

sub ColorBack2CB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  flColorChooser "Background Color 2",r8,g8,b8, FL_COLORCHOOSER_RGB
  Fl_Background2(r8,g8,b8)
  Fl_ReDraw()
end sub

sub ColorBack3CB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  flColorChooser "Background Color 3",r8,g8,b8, FL_COLORCHOOSER_RGB
  'Fl_Background2(r8,g8,b8)
  Fl_ReDraw()
end sub

sub ColorForeCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  flColorChooser "Foreground Color",r8,g8,b8, FL_COLORCHOOSER_RGB
  Fl_Foreground(r8,g8,b8)
  Fl_ReDraw()
end sub

sub GtkCB cdecl (byval self as Fl_Widget ptr, byval userData as any ptr)
  Fl_SetScheme("gtk+") : Fl_ReDraw()
end sub

sub PlasticCB cdecl (byval self as Fl_Widget ptr, byval userData as any ptr)
  Fl_SetScheme("plastic") : Fl_ReDraw()
end sub

sub GleamCB cdecl (byval self as Fl_Widget ptr, byval userData as any ptr)
  Fl_SetScheme("gleam") : Fl_ReDraw()
end sub

sub NoneCB cdecl (byval self as Fl_Widget ptr, byval userData as any ptr)
  Fl_SetScheme("none") : Fl_ReDraw()
end sub

sub DokuCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  var WinWidth = 800
  var WinHeight = 600
  var win = Fl_Double_WindowNew2(Fl_GetW()/2-WinWidth /2, Fl_GetH()/2-WinHeight/2, _
      WinWidth,WinHeight,"Documentation")                   
  var hv  = Fl_Help_ViewNew(0,0,800,600)
  Fl_Help_ViewLoad hv,"Html/any.html"
  Fl_GroupSetResizable win,hv
  Fl_WindowShow win
end sub

sub AboutEndButtonCB cdecl (byval button as FL_WIDGET ptr, pref as any ptr)
  Fl_WindowHide pref
end sub

sub AboutCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
  var pref = Fl_WindowNew(333, 333, "About")
 
  ' show image
  var png = Fl_PNG_ImageNew("media/lin.png")
  Fl_WidgetSetImage Fl_BoxNew(100,68,128,128),png
 
  ' show text
   var box1 = Fl_BoxNew(10,140,320,130, "FastLighter by Knatterton")
   var box2 = Fl_BoxNew(10,160,320,130, "with FreeBASIC 1.06")
   var box3 = Fl_BoxNew(10,180,320,130, " and Fltk 1.3.3")
   
   var Btn2 = Fl_ButtonNew(230,290,60,22,"OK")
   Fl_WidgetSetCallbackArg Btn2,@AboutEndButtonCB, pref
   Fl_WindowShow pref
  'flMessage("FastLighter by Knatterton")
end sub

sub ButtonCB cdecl (byval button as FL_WIDGET ptr,byval userdata as any ptr)
  ? "Button pushed"
end sub

' tabs
sub TabsCB cdecl (byval tabs as FL_WIDGET ptr,byval parent as any ptr)
  'print "TabCB: " & *Fl_WidgetGetLabel(Fl_TabsGetValue(parent))
end sub

' mainwindow
' Overwrite default colors
Fl_Background(202,163,54)
Fl_Background2(255,250,244)
Fl_Foreground(30,50,54)
dim as Fl_Window ptr win = Fl_WindowNew(1024,768, "FastLighter")

const ICONSIZE = 32' try 8,16,24,32 also
Fl_Register_Images
Fl_File_IconLoadSystemIcons

' Note: you must copy the subfolder "media"  to your FastLighter folder to load the icons
var Icon01 = Fl_File_IconNew() : Fl_File_IconLoad Icon01,"media/new-2_32x32.png"                       
var Icon02 = Fl_File_IconNew() : Fl_File_IconLoad Icon02,"media/open-2_32x32.png"
var Icon03 = Fl_File_IconNew() : Fl_File_IconLoad Icon03,"media/save-2_32x32.png"
var Icon04 = Fl_File_IconNew() : Fl_File_IconLoad Icon04,"media/save-as-2_32x32.png"

var Icon05 = Fl_File_IconNew() : Fl_File_IconLoad Icon05,"media/open-recent-2_32x32.png"
var Icon06 = Fl_File_IconNew() : Fl_File_IconLoad Icon06,"media/properties-2_24x24.png"
var Icon07 = Fl_File_IconNew() : Fl_File_IconLoad Icon07,"media/lin.png"
var Icon08 = Fl_File_IconNew() : Fl_File_IconLoad Icon08,"media/win.png"

var Icon09 = Fl_File_IconNew() : Fl_File_IconLoad Icon09,"media/accessories-calculator-3_48x48.png"
var Icon10 = Fl_File_IconNew() : Fl_File_IconLoad Icon10,"media/properties-2_24x24.png"       
var Icon11 = Fl_File_IconNew() : Fl_File_IconLoad Icon11,"media/close-2_24x24.png"
var Icon12 = Fl_File_IconNew() : Fl_File_IconLoad Icon12,"media/exit-2_32x32.png"

' toolbar
var toolbar = Fl_GroupNew(0,32,Fl_WidgetGetW(win),ICONSIZE)
    Fl_WidgetSetBox toolbar,Boxtype(FL_UP_BOX)
 
    ' create buttons
    var btn01 = Fl_ButtonNew(0*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon01,btn01
    var btn02 = Fl_ButtonNew(1*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon02,btn02
    var btn03 = Fl_ButtonNew(2*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon03,btn03
    var btn04 = Fl_ButtonNew(3*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon04,btn04
   
    var btn05 = Fl_ButtonNew(5*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon05,btn05
    var btn06 = Fl_ButtonNew(6*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon06,btn06
    var btn07 = Fl_ButtonNew(7*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon07,btn07
    var btn08 = Fl_ButtonNew(8*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon08,btn08
   
    var btn09 = Fl_ButtonNew(10*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon09,btn09
    var btn10 = Fl_ButtonNew(11*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon10,btn10
    var btn11 = Fl_ButtonNew(12*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon11,btn11
    var btn12 = Fl_ButtonNew(13*ICONSIZE,32,ICONSIZE,ICONSIZE):Fl_File_IconLabel Icon12,btn12
   
    ' connect callbacks
    Fl_WidgetSetCallbackArg btn01,@NewCB,btn01
    Fl_WidgetSetCallbackArg btn02,@OpenCB,btn02
    Fl_WidgetSetCallbackArg btn03,@SaveCB,btn03
    Fl_WidgetSetCallbackArg btn04,@SaveAsCB,btn04
    Fl_WidgetSetCallbackArg btn05,@ButtonCB,btn05
    Fl_WidgetSetCallbackArg btn06,@ButtonCB,btn06
    Fl_WidgetSetCallbackArg btn07,@ButtonCB,btn07
    Fl_WidgetSetCallbackArg btn08,@ButtonCB,btn08
    Fl_WidgetSetCallbackArg btn09,@ButtonCB,btn09
    Fl_WidgetSetCallbackArg btn10,@ButtonCB,btn10
    Fl_WidgetSetCallbackArg btn11,@ButtonCB,btn11
    Fl_WidgetSetCallbackArg btn12,@ButtonCB,btn12
   
Fl_GroupEnd toolbar

' menu bar
var mnb = Fl_Menu_BarNew(0,0,1024,30)
Fl_Menu_SetTextFont(mnb,Fl_HELVETICA)

Fl_Menu_Add(mnb,"File/New"        , FL_CTRL+asc("n"),     @NewCB)
Fl_Menu_Add(mnb,"File/Open..."    , FL_CTRL+asc("o"),     @OpenCB)
Fl_Menu_Add(mnb,"File/Save"       , FL_CTRL+asc("s"),     @SaveCB)
Fl_Menu_Add(mnb,"File/Save &As...", FL_CTRL+asc("a"),     @SaveAsCB)
Fl_Menu_Add(mnb,"File/Print"      , FL_CTRL+asc("p"),     @PrintCB)
Fl_Menu_Add(mnb,"File/Quit"       , FL_CTRL+asc("q"),     @QuitCB)

Fl_Menu_Add(mnb,"Edit/Undo"       , FL_CTRL+asc("u"),     @UndoCB)
Fl_Menu_Add(mnb,"Edit/Cut"        , FL_CTRL+asc("x"),     @CutCB)
Fl_Menu_Add(mnb,"Edit/Copy"       , FL_CTRL+asc("v"),     @CopyCB)
Fl_Menu_Add(mnb,"Edit/Paste"      , FL_CTRL+asc("x"),     @PasteCB)
Fl_Menu_Add(mnb,"Edit/Delete"     , FL_CTRL+asc("x"),     @DeleteCB)
Fl_Menu_Add(mnb,"Edit/Search"     , FL_CTRL+asc("v"),     @AboutCB)

Fl_Menu_Add(mnb,"Search/Find..."   ,FL_CTRL+asc("x"),     @FindCB)
Fl_Menu_Add(mnb,"Search/Replace...",FL_CTRL+asc("x"),     @ReplaceCB)
Fl_Menu_Add(mnb,"Search/Extended",  FL_CTRL+asc("x"),     @AboutCB)

Fl_Menu_Add(mnb,"Compile/Compile",     FL_CTRL+asc("c"),  @CompileCB)
Fl_Menu_Add(mnb,"Compile/Options",     FL_CTRL+asc("p"),  @OptionsCB)
Fl_Menu_Add(mnb,"Compile/Preferences", FL_CTRL+asc("p"),  @PrefCB)

Fl_Menu_Add(mnb,"View/Gtk+",                          ,  @GtkCB)
Fl_Menu_Add(mnb,"View/Plastic",                        ,  @PlasticCB)
Fl_Menu_Add(mnb,"View/Gleam",                          ,  @GleamCB)
Fl_Menu_Add(mnb,"View/None",                           ,  @NoneCB)
Fl_Menu_Add(mnb,"View/Back Color" , FL_CTRL+asc("z")   ,  @ColorBackCB)
Fl_Menu_Add(mnb,"View/Back Color2", FL_CTRL+asc("z")   ,  @ColorBack2CB)
Fl_Menu_Add(mnb,"View/Back Color3", FL_CTRL+asc("z")   ,  @ColorBack3CB)
Fl_Menu_Add(mnb,"View/Fore Color" , FL_CTRL+asc("z")   ,  @ColorForeCB)

Fl_Menu_Add(mnb,"Help/Documentation"  ,FL_CTRL+asc("d"),  @DokuCB)
Fl_Menu_Add(mnb,"Help/About",,                            @AboutCB)

Fl_Menu_Add3(mnb,"Help/Help/Item 1")
Fl_Menu_Add3(mnb,"Help/Help/Item 2")
Fl_Menu_Add3(mnb,"Help/Help/Item 3")

' tabs
dim as fl_tabs ptr tabs = Fl_TabsNew(5,80,Fl_WidgetGetW(Win)-5,Fl_WidgetGetH(Win)-40)
Fl_WidgetSetCallbackArg tabs,@TabsCB,tabs

with tabarray(0)
  .fname = "FastLighter_21.bas"
  .ftab = Fl_TabNew(10,90,Fl_WidgetGetW(tabs)-5,Fl_WidgetGetH(tabs)-5,.fname)
  .edt = Fl_Text_EditorNew(5,95,Fl_WidgetGetW(tabs)-5,Fl_WidgetGetH(tabs)-60)
  'Fl_WidgetSetCallbackArg .edt,@TabsCB,.edt
  .TextBuffer = 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,.fname)<>0 then
    Fl_Text_BufferSetText(.TextBuffer,!"print \"type your stuff\"")
  end if
  Fl_TabEnd .ftab
end with

Fl_GroupSetResizable win,win 'edt
Fl_WindowShow win
Fl_Run

' end FastLighter.bas


Code: Select all

' fltk_edit.bi

#include once "fltk-c.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_COURIER       ,FONTSIZE), _ ' PLAIN    style 'A'
 (FL_BLUE         ,Fl_COURIER_BOLD  ,FONTSIZE), _ ' KEYWORD  style 'B'
 (FL_DARK_YELLOW  ,Fl_COURIER       ,FONTSIZE), _ ' STRING   style 'C'
 (Fl_RED          ,Fl_COURIER_ITALIC,FONTSIZE), _ ' COMMENT  style 'D'
 (FL_DARK_YELLOW  ,Fl_COURIER_BOLD  ,FONTSIZE), _ ' NUMBER   style 'E'
 (FL_DARK_GREEN    ,Fl_COURIER      ,FONTSIZE), _' PREPROC  style 'F'
 (FL_LIGHT3       ,Fl_COURIER       ,FONTSIZE), _ ' DATATYPE style 'G'
 (FL_LIGHT2       ,Fl_COURIER_BOLD  ,FONTSIZE), _ ' OTHER    style 'H'
 (FL_DARK_GREEN   ,Fl_COURIER_BOLD  ,FONTSIZE)}   ' USERLIB  style 'I'
 
 type ttab
  as string fname
  as any ptr ftab,edt,TextBuffer
end type 
dim shared as ttab tabarray(8)
dim shared as any ptr StyleBuffer
StyleBuffer = Fl_Text_BufferNew()

' 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) & ","
 
  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)
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)
end function

' preprocessor
function IsPreproc(byval s as string) as long
  dim as string search = "," & ucase(s) & ","
  dim as string char=left(search,1)
  select case char
    case "#" : return instr(",#ASSERT,#DEFINE,#ELSE,#ELSEIF,#ENDIF,#ENDMACRO,#ERROR,#IF,#IFDEF,#IFNDEF,#INCLIB,#INCLUDE," & _
                            "#LANG,#LIBPATH,#LINE,#MACRO,#PRAGMA,#PRINT,#UNDEF,", search)
    case "_" : 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 (simplified, users must care for spelling)
function IsUserlib(byval s as string) as long
  if len(s)<5 then return 0
  dim as string searchw = left(lcase(s),3)
  if searchw = "fl_" then return 1
  return 0
end function

' 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

' end fltk_edit.bi


Now your advice comes handy. Callbacks are used twice from menuitems and buttons. I read everything you write carefully, Joshy.
bcohio2001
Posts: 546
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby bcohio2001 » Aug 08, 2019 20:04

D.J.Peters wrote:Question why not looking at the test files ?

I have been. But it also helps to know WHAT you are looking for!
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 09, 2019 18:16

Here i have experimented with pixmaps:

Code: Select all

' xpm_icons.bas

#include once "fltk-c.bi"

dim as zstring ptr terminal_xpm(...) => { _
@"32 32 485 2", _
@"     c None", _
@".    c #A4A79F", _
@"+    c #A2A69D", _
@"@    c #A1A59C", _
@"#    c #A0A49B", _
@"$    c #9DA198", _
@"%    c #9B9F96", _
@"&    c #999D94", _
@"*    c #979B92", _
@"=    c #94988F", _
@"-    c #92968D", _
@";    c #90948B", _
@">    c #8E9289", _
@"_    c #8B8F87", _
@"'    c #898D84", _
@")    c #878B82", _
@"!    c #858980", _
@"~    c #848880", _
@"{    c #A6AAA1", _
@"]    c #D8DAD7", _
@"^    c #EEEFEE", _
@"/    c #F2F3F2", _
@"(    c #F1F2F1", _
@"_    c #F0F1F0", _
@":    c #EAEBEA", _
@"<    c #CDD0CC", _
@"[    c #82857C", _
@"}    c #A5A7A0", _
@"|    c #D6D8D5", _
@"1    c #E6E7E5", _
@"2    c #CED0CD", _
@"3    c #CACCC9", _
@"4    c #E2E3E2", _
@"5    c #C9CAC7", _
@"6    c #7A7E76", _
@"7    c #A1A79C", _
@"8    c #939590", _
@"9    c #616261", _
@"0    c #606060", _
@"a    c #616161", _
@"b    c #636363", _
@"c    c #656565", _
@"d    c #686868", _
@"e    c #6A6A6A", _
@"f    c #6C6C6C", _
@"g    c #6E6E6E", _
@"h    c #707070", _
@"i    c #727272", _
@"j    c #757575", _
@"k    c #777777", _
@"l    c #797979", _
@"m    c #7B7B7B", _
@"n    c #7D7D7D", _
@"o    c #7F7F7F", _
@"p    c #828282", _
@"q    c #858584", _
@"r    c #A8AAA6", _
@"s    c #CDCFCC", _
@"t    c #E6E7E6", _
@"u    c #71756E", _
@"v    c #C7C9C6", _
@"w    c #626361", _
@"x    c #303428", _
@"y    c #33382D", _
@"z    c #33372C", _
@"A    c #32372C", _
@"B    c #32372B", _
@"C    c #32362B", _
@"D    c #32362A", _
@"E    c #31362A", _
@"F    c #303529", _
@"G    c #2F3427", _
@"H    c #2E3426", _
@"I    c #2E3326", _
@"J    c #2C3123", _
@"K    c #8A8A89", _
@"L    c #C9CBC8", _
@"M    c #E9E9E8", _
@"N    c #6B6F67", _
@"O    c #C4C6C3", _
@"P    c #636462", _
@"Q    c #31352A", _
@"R    c #ADBC95", _
@"S    c #ACBC95", _
@"T    c #ABBB93", _
@"U    c #AABB92", _
@"V    c #AABA91", _
@"W    c #A9B990", _
@"X    c #A8B98F", _
@"Y    c #A7B88E", _
@"Z    c #A6B78C", _
@"`    c #A5B78A", _
@" .   c #A4B689", _
@"..   c #A3B588", _
@"+.   c #A3B587", _
@"@.   c #A2B486", _
@"#.   c #A1B485", _
@"$.   c #A1B384", _
@"%.   c #A0B384", _
@"&.   c #9FB282", _
@"*.   c #9EB281", _
@"=.   c #2D3224", _
@"-.   c #8C8C8C", _
@";.   c #C2C4C1", _
@">.   c #E5E5E4", _
@"_.   c #676B63", _
@"'.   c #2C3126", _
@").   c #99A586", _
@"!.   c #98A485", _
@"~.   c #97A383", _
@"{.   c #96A283", _
@"].   c #95A281", _
@"^.   c #94A180", _
@"/.   c #93A07F", _
@"(.   c #929F7E", _
@"_.   c #919E7D", _
@":.   c #909E7C", _
@"<.   c #8F9D7B", _
@"[.   c #8E9D7A", _
@"}.   c #8D9B78", _
@"|.   c #8D9B77", _
@"1.   c #8B9A76", _
@"2.   c #8B9975", _
@"3.   c #899873", _
@"4.   c #899773", _
@"5.   c #879671", _
@"6.   c #86956F", _
@"7.   c #292E21", _
@"8.   c #8F8F8F", _
@"9.   c #BCBEBA", _
@"0.   c #E0E1E0", _
@"a.   c #63675F", _
@"b.   c #2C3125", _
@"c.   c #9DAD86", _
@"d.   c #9CAC84", _
@"e.   c #9BAB84", _
@"f.   c #9AAB82", _
@"g.   c #9AAA81", _
@"h.   c #99A980", _
@"i.   c #98A97F", _
@"j.   c #97A87D", _
@"k.   c #96A87D", _
@"l.   c #95A77B", _
@"m.   c #95A67B", _
@"n.   c #94A57A", _
@"o.   c #93A579", _
@"p.   c #92A577", _
@"q.   c #92A477", _
@"r.   c #90A375", _
@"s.   c #90A374", _
@"t.   c #90A274", _
@"u.   c #8FA272", _
@"v.   c #8EA171", _
@"w.   c #8DA070", _
@"x.   c #282D1F", _
@"y.   c #929292", _
@"z.   c #B5B7B3", _
@"A.   c #DCDCDB", _
@"B.   c #5F635B", _
@"C.   c #9EA299", _
@"D.   c #646462", _
@"E.   c #282C22", _
@"F.   c #889475", _
@"G.   c #8BA07C", _
@"H.   c #869374", _
@"I.   c #859272", _
@"J.   c #849071", _
@"K.   c #839070", _
@"L.   c #828F6E", _
@"M.   c #818E6E", _
@"N.   c #808D6C", _
@"O.   c #7F8D6B", _
@"P.   c #7E8C6A", _
@"Q.   c #7D8B69", _
@"R.   c #7D8B68", _
@"S.   c #7C8A66", _
@"T.   c #7B8966", _
@"U.   c #798864", _
@"V.   c #798763", _
@"W.   c #73835D", _
@"X.   c #6A7B51", _
@"Y.   c #607244", _
@"Z.   c #586A3A", _
@"`.   c #1A2010", _
@" +   c #959595", _
@".+   c #AEB0AC", _
@"++   c #D7D8D6", _
@"@+   c #5B5F57", _
@"#+   c #9A9E95", _
@"$+   c #666765", _
@"%+   c #272C20", _
@"&+   c #8B9B74", _
@"*+   c #AECAA5", _
@"=+   c #B1CAA7", _
@"-+   c #8BA176", _
@";+   c #889970", _
@">+   c #87986F", _
@"_+   c #86976E", _
@"'+   c #85966D", _
@")+   c #84956B", _
@"!+   c #84946B", _
@"~+   c #839469", _
@"{+   c #829368", _
@"]+   c #819267", _
@"^+   c #809266", _
@"/+   c #7D9061", _
@"(+   c #728654", _
@"_+   c #657B44", _
@":+   c #5D743A", _
@"<+   c #5D753A", _
@"[+   c #1B2111", _
@"}+   c #989898", _
@"|+   c #A8A9A5", _
@"1+   c #D2D2D0", _
@"2+   c #575B52", _
@"3+   c #969A91", _
@"4+   c #696A68", _
@"5+   c #23271D", _
@"6+   c #768364", _
@"7+   c #ABC6A5", _
@"8+   c #F5FBF6", _
@"9+   c #D3E5D1", _
@"0+   c #94AD8A", _
@"a+   c #748562", _
@"b+   c #717E5E", _
@"c+   c #6F7C5C", _
@"d+   c #6E7C5B", _
@"e+   c #6D7A5A", _
@"f+   c #6C7A59", _
@"g+   c #6B7857", _
@"h+   c #677452", _
@"i+   c #55653D", _
@"j+   c #48592D", _
@"k+   c #47582C", _
@"l+   c #47582D", _
@"m+   c #171D0E", _
@"n+   c #9B9B9B", _
@"o+   c #A1A29E", _
@"p+   c #CCCDCB", _
@"q+   c #53574F", _
@"r+   c #6C6D6B", _
@"s+   c #22261C", _
@"t+   c #778762", _
@"u+   c #80996F", _
@"v+   c #A9C4A0", _
@"w+   c #DCECDA", _
@"x+   c #EDF9EE", _
@"y+   c #BED6B9", _
@"z+   c #849F73", _
@"A+   c #72855C", _
@"B+   c #718159", _
@"C+   c #708059", _
@"D+   c #6D7E55", _
@"E+   c #5E7143", _
@"F+   c #526734", _
@"G+   c #516633", _
@"H+   c #526633", _
@"I+   c #526733", _
@"J+   c #181D0F", _
@"K+   c #9E9E9E", _
@"L+   c #9A9C98", _
@"M+   c #C6C7C5", _
@"N+   c #BEC0BD", _
@"O+   c #6F6F6E", _
@"P+   c #1D2118", _
@"Q+   c #647053", _
@"R+   c #626E51", _
@"S+   c #626F51", _
@"T+   c #657B58", _
@"U+   c #90AC88", _
@"V+   c #C2DCC0", _
@"W+   c #DEF2DE", _
@"X+   c #8FAE88", _
@"Y+   c #5B6849", _
@"Z+   c #515E3D", _
@"`+   c #41512A", _
@" @   c #3F4E28", _
@".@   c #3F4F28", _
@"+@   c #14190D", _
@"@@   c #9F9F9F", _
@"#@   c #949591", _
@"$@   c #C1C1BF", _
@"%@   c #8A8E85", _
@"&@   c #F0F0EF", _
@"*@   c #B8BAB6", _
@"=@   c #707170", _
@"-@   c #1B2016", _
@";@   c #637250", _
@">@   c #63714E", _
@"_@   c #63724F", _
@"'@   c #667E54", _
@")@   c #8FAD85", _
@"!@   c #C1DDBF", _
@"~@   c #DCF1DD", _
@"{@   c #8BAD81", _
@"]@   c #4D5E33", _
@"^@   c #46582C", _
@"/@   c #46592D", _
@"(@   c #47592D", _
@"_@   c #475A2D", _
@":@   c #151A0D", _
@"<@   c #8D8E8A", _
@"[@   c #BABAB8", _
@"}@   c #868A81", _
@"|@   c #EEEEEE", _
@"1@   c #B2B4B0", _
@"2@   c #737472", _
@"3@   c #171B13", _
@"4@   c #505B40", _
@"5@   c #5E7552", _
@"6@   c #94B08E", _
@"7@   c #D5E6D4", _
@"8@   c #EBF9EC", _
@"9@   c #AFC9AB", _
@"0@   c #59744D", _
@"a@   c #384826", _
@"b@   c #364323", _
@"c@   c #364423", _
@"d@   c #374523", _
@"e@   c #11160B", _
@"f@   c #868783", _
@"g@   c #B3B4B1", _
@"h@   c #82867D", _
@"i@   c #ECEDEC", _
@"j@   c #ACAEAB", _
@"k@   c #767675", _
@"l@   c #151910", _
@"m@   c #4B5839", _
@"n@   c #92B38C", _
@"o@   c #F4FBF4", _
@"p@   c #C4DCC3", _
@"q@   c #6C8D60", _
@"r@   c #3E542A", _
@"s@   c #3A4A26", _
@"t@   c #3B4A26", _
@"u@   c #3B4B26", _
@"v@   c #3C4B26", _
@"w@   c #3C4C26", _
@"x@   c #3C4C27", _
@"y@   c #3D4D27", _
@"z@   c #7F817C", _
@"A@   c #ADADAA", _
@"B@   c #7D8179", _
@"C@   c #EBEBEA", _
@"D@   c #A6A7A4", _
@"E@   c #787978", _
@"F@   c #0E1109", _
@"G@   c #2D381D", _
@"H@   c #7A9C73", _
@"I@   c #7E9D77", _
@"J@   c #364E29", _
@"K@   c #2D3A1D", _
@"L@   c #2D391D", _
@"M@   c #2D3A1E", _
@"N@   c #2E3A1E", _
@"O@   c #2F3A1E", _
@"P@   c #2F3B1E", _
@"Q@   c #2F3B1F", _
@"R@   c #0F120A", _
@"S@   c #797A75", _
@"T@   c #A5A6A3", _
@"U@   c #797D75", _
@"V@   c #E9E9E9", _
@"W@   c #9FA19E", _
@"X@   c #7B7B7A", _
@"Y@   c #0D1109", _
@"Z@   c #39542C", _
@"`@   c #303F20", _
@" #   c #2F3C1F", _
@".#   c #303D1F", _
@"+#   c #303E20", _
@"@#   c #313E20", _
@"##   c #313F20", _
@"$#   c #323F20", _
@"%#   c #0E1209", _
@"&#   c #777873", _
@"*#   c #A2A39F", _
@"=#   c #757971", _
@"-#   c #E8E8E7", _
@";#   c #999B97", _
@">#   c #7E7E7D", _
@"_#   c #0B0E07", _
@"'#   c #252E18", _
@")#   c #252E19", _
@"!#   c #252F19", _
@"~#   c #5B7E55", _
@"{#   c #82A37D", _
@"]#   c #82A47D", _
@"^#   c #82A47E", _
@"/#   c #60825A", _
@"(#   c #26311A", _
@"_#   c #27311A", _
@":#   c #0C0F08", _
@"<#   c #A0A09D", _
@"[#   c #71756D", _
@"}#   c #E6E6E5", _
@"|#   c #7F807F", _
@"1#   c #0A0D07", _
@"2#   c #242E18", _
@"3#   c #242F18", _
@"4#   c #242F19", _
@"5#   c #83A47E", _
@"6#   c #FFFFFF", _
@"7#   c #8CAD88", _
@"8#   c #27321A", _
@"9#   c #9C9D99", _
@"0#   c #6D7169", _
@"a#   c #E4E5E4", _
@"b#   c #8E8F8B", _
@"c#   c #828281", _
@"d#   c #080B06", _
@"e#   c #1C2414", _
@"f#   c #1C2514", _
@"g#   c #1D2514", _
@"h#   c #5C7D57", _
@"i#   c #8AAA87", _
@"j#   c #62825C", _
@"k#   c #1F2614", _
@"l#   c #1F2714", _
@"m#   c #1F2715", _
@"n#   c #090C06", _
@"o#   c #999A96", _
@"p#   c #696D65", _
@"q#   c #E3E3E2", _
@"r#   c #878984", _
@"s#   c #868686", _
@"t#   c #0A0D08", _
@"u#   c #090B06", _
@"v#   c #0B0D09", _
@"w#   c #9C9C9B", _
@"x#   c #969793", _
@"y#   c #656961", _
@"z#   c #E1E2E0", _
@"A#   c #81827D", _
@"B#   c #81827F", _
@"C#   c #909090", _
@"D#   c #949494", _
@"E#   c #969696", _
@"F#   c #999999", _
@"G#   c #9D9D9D", _
@"H#   c #878785", _
@"I#   c #939490", _
@"J#   c #62665E", _
@"K#   c #D6D6D4", _
@"L#   c #838480", _
@"M#   c #787974", _
@"N#   c #C5E6A3", _
@"O#   c #97D359", _
@"P#   c #676863", _
@"Q#   c #7A7B76", _
@"R#   c #8C8D89", _
@"S#   c #545850", _
@"T#   c #5F625A", _
@"U#   c #A4A5A1", _
@"V#   c #90D04F", _
@"W#   c #747570", _
@"X#   c #898985", _
@"Y#   c #777974", _
@"Z#   c #535650", _
@"`#   c #5A5E57", _
@" $   c #A5A5A2", _
@".$   c #C9C9C7", _
@"+$   c #D0D0CE", _
@"@$   c #CDCDCB", _
@"#$   c #CACBC9", _
@"$$   c #C8C8C6", _
@"%$   c #C5C5C3", _
@"&$   c #C2C2C0", _
@"*$   c #BFBFBD", _
@"=$   c #BCBDBA", _
@"-$   c #B7B8B5", _
@";$   c #B4B5B2", _
@">$   c #B1B2AF", _
@"_$   c #AEAFAC", _
@"'$   c #ACACA9", _
@")$   c #A9AAA7", _
@"!$   c #A3A4A1", _
@"~$   c #A1A19E", _
@"{$   c #9E9F9B", _
@"]$   c #9B9C98", _
@"^$   c #999996", _
@"/$   c #555851", _
@"($   c #51554E", _
@"_$   c #535750", _
@":$   c #4F524B", _
@"                                                                ", _
@"                                                                ", _
@"    . + @ @ @ @ @ @ @ @ @ @ # $ % & * = - ; > , ' ) ! ~ !       ", _
@"  { ] ^ / / / / / / / / / / / / / / / / / / / / / ( _ : < [     ", _
@"} | 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 5 6   ", _
@"7 ^ 2 8 9 0 0 0 0 0 a b c d e f g h i j k l m n o p q r s t u   ", _
@"@ / v w x y z z z A B C C D E E E F F F x G H H I I J K L M N   ", _
@"@ / O P Q R S T U V W X X Y Z Z `  ...+.@.#.$.%.&.*.=.-.;.>.,.  ", _
@"@ / O P '.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.5.6.7.8.9.0.a.  ", _
@"@ / O P b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.  ", _
@"C./ O D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+  ", _
@"#+/ O $+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+:+:+<+[+}+|+1+2+  ", _
@"3+/ O 4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+k+l+j+j+j+m+n+o+p+q+  ", _
@"- / O r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+G+H+H+I+I+F+F+J+K+L+M+q+  ", _
@"> ( N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @ @ @ @.@.@.@.@.@.@+@@@#@$@q+  ", _
@"%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@^@^@^@/@(@(@(@(@(@_@_@:@@@<@[@q+  ", _
@"}@|@1@2@3@4@5@6@7@8@9@0@a@b@b@b@c@c@c@c@c@c@d@d@d@d@e@@@f@g@q+  ", _
@"h@i@j@k@l@m@n@o@p@q@r@s@t@t@t@u@u@u@v@v@w@w@x@x@x@y@e@@@z@A@q+  ", _
@"B@C@D@E@F@G@H@I@J@K@L@L@L@K@M@N@N@N@N@N@N@O@O@O@P@Q@R@@@S@T@q+  ", _
@"U@V@W@X@Y@Q@Z@`@ # # #.#.#.#.#.#+#+#@#@#@#@#####$#$#%#@@&#*#q+  ", _
@"=#-#;#>#,#'#'#)#)#!#!#~#{#{#{#]#]#]#^#/#(#_#_#_#_#_#:#@@&#<#q+  ", _
@"[#}##@|#1#2#2#2#3#4#4#5#6#6#6#6#6#6#6#7#(#(#(#(#8#8#,#@@&#9#q+  ", _
@"0#a#b#c#d#e#f#g#g#g#g#h#i#i#i#i#i#i#i#j#k#k#l#m#m#m#n#@@&#o#q+  ", _
@"p#q#r#s#t#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#u#v#w#&#x#q+  ", _
@"y#z#A#B#-.C#y.D#E#F#n+G#@@@@@@@@@@@@@@@@@@@@@@@@@@@@w#H#&#I#q+  ", _
@"J#K#L#M#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#N#O#&#P#P#P#&#Q#R#S#  ", _
@"T#U#[@A#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#V#V#&#P#W#L#Q#X#Y#Z#  ", _
@"  `# $.$+$@$#$$$%$&$*$=$[@-$;$>$,$'$)$D@!$~${$]$^$x#I#R#M#/$    ", _
@"    ($_$q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+q+_$:$      ", _
@"                                                                ", _
@"                                                                ", _
@"                                                                "}

dim as zstring ptr user_trash_xpm(...) => { _
@"32 32 532 2", _
@"     c None", _
@".    c #586016", _
@"+    c #51580B", _
@"@    c #4D5506", _
@"#    c #51590C", _
@"$    c #565D13", _
@"%    c #9CA27A", _
@"&    c #E8EDE9", _
@"*    c #EFF3F4", _
@"=    c #E0E5DF", _
@"-    c #697130", _
@";    c #525A0E", _
@">    c #E3E7E4", _
@"_    c #535756", _
@"'    c #646662", _
@")    c #656763", _
@"!    c #676964", _
@"~    c #686A66", _
@"{    c #696B67", _
@"]    c #6B6C68", _
@"^    c #6B6D6A", _
@"/    c #6D6F6B", _
@"(    c #6E706B", _
@"_    c #6F706D", _
@":    c #686A65", _
@"<    c #696B66", _
@"[    c #6A6C68", _
@"}    c #6C6E69", _
@"|    c #6D6F6A", _
@"1    c #6E706C", _
@"2    c #70726D", _
@"3    c #71736E", _
@"4    c #737570", _
@"5    c #747671", _
@"6    c #757772", _
@"7    c #838580", _
@"8    c #BDC1BD", _
@"9    c #C3C8B4", _
@"0    c #575E14", _
@"a    c #848A56", _
@"b    c #A0A4A5", _
@"c    c #404443", _
@"d    c #5A5C58", _
@"e    c #5B5D59", _
@"f    c #5D5F5A", _
@"g    c #5E605C", _
@"h    c #5F615D", _
@"i    c #61635E", _
@"j    c #626460", _
@"k    c #646661", _
@"l    c #656762", _
@"m    c #666864", _
@"n    c #868883", _
@"o    c #B9BCB5", _
@"p    c #EDF1F2", _
@"q    c #5E661E", _
@"r    c #575F15", _
@"s    c #C4C9B5", _
@"t    c #5C6161", _
@"u    c #3E4342", _
@"v    c #878984", _
@"w    c #C0C4BC", _
@"x    c #CFD2D0", _
@"y    c #A6AC8A", _
@"z    c #575E15", _
@"A    c #5A6117", _
@"B    c #EDF1F1", _
@"C    c #353B3C", _
@"D    c #3D4241", _
@"E    c #8B8D88", _
@"F    c #C3C6C0", _
@"G    c #E4E9E4", _
@"H    c #535B0E", _
@"I    c #535A0E", _
@"J    c #979D72", _
@"K    c #B2B5B5", _
@"L    c #2E3436", _
@"M    c #3B3F40", _
@"N    c #8C8E89", _
@"O    c #D2D5CE", _
@"P    c #E3E7E6", _
@"Q    c #878E5C", _
@"R    c #565E13", _
@"S    c #D3D7CA", _
@"T    c #838888", _
@"U    c #2F3537", _
@"V    c #3B3F3F", _
@"W    c #8F918B", _
@"X    c #D2D5D1", _
@"Y    c #CCD1BF", _
@"Z    c #50580B", _
@"`    c #E8ECE9", _
@" .   c #585F16", _
@"..   c #A5A98D", _
@"+.   c #D5D8D9", _
@"@.   c #D4D8D9", _
@"#.   c #D4D7D8", _
@"$.   c #D3D7D8", _
@"%.   c #D3D6D7", _
@"&.   c #D2D6D7", _
@"*.   c #D2D5D6", _
@"=.   c #D1D5D6", _
@"-.   c #D1D4D5", _
@";.   c #D0D4D5", _
@">.   c #D0D3D4", _
@"_.   c #CFD3D4", _
@"'.   c #CFD2D3", _
@").   c #CED1D2", _
@"!.   c #CDD1D2", _
@"~.   c #9DA386", _
@"{.   c #565E14", _
@"].   c #76821B", _
@"^.   c #B5C051", _
@"/.   c #AFBA4F", _
@"(.   c #A8B24C", _
@"_.   c #A1AB49", _
@":.   c #9BA445", _
@"<.   c #949D42", _
@"[.   c #8C963F", _
@"}.   c #848C3C", _
@"|.   c #7B8338", _
@"1.   c #747C35", _
@"2.   c #6B7231", _
@"3.   c #666C2F", _
@"4.   c #646B2E", _
@"5.   c #62692E", _
@"6.   c #60672D", _
@"7.   c #5E652C", _
@"8.   c #5D632C", _
@"9.   c #5B612B", _
@"0.   c #5C622C", _
@"a.   c #5E6612", _
@"b.   c #707A16", _
@"c.   c #B7C155", _
@"d.   c #B4BF50", _
@"e.   c #B2BC4F", _
@"f.   c #AFB94E", _
@"g.   c #ACB74D", _
@"h.   c #A9B34C", _
@"i.   c #A6B04B", _
@"j.   c #A3AE4A", _
@"k.   c #A0AB49", _
@"l.   c #9DA748", _
@"m.   c #9BA547", _
@"n.   c #98A246", _
@"o.   c #919B43", _
@"p.   c #899340", _
@"q.   c #80893C", _
@"r.   c #778037", _
@"s.   c #6F7633", _
@"t.   c #697031", _
@"u.   c #686F31", _
@"v.   c #6C7337", _
@"w.   c #636D12", _
@"x.   c #687312", _
@"y.   c #B9C35A", _
@"z.   c #B1BB4F", _
@"A.   c #AEB84E", _
@"B.   c #ACB74F", _
@"C.   c #B0BA5D", _
@"D.   c #ADB65A", _
@"E.   c #CCD29C", _
@"F.   c #CDD29F", _
@"G.   c #BCC381", _
@"H.   c #9AA446", _
@"I.   c #97A145", _
@"J.   c #959F46", _
@"K.   c #8E9842", _
@"L.   c #8B9541", _
@"M.   c #899240", _
@"N.   c #848D3E", _
@"O.   c #80893E", _
@"P.   c #8C9351", _
@"Q.   c #646D10", _
@"R.   c #626D0D", _
@"S.   c #BBC560", _
@"T.   c #B3BE50", _
@"U.   c #B0BA4F", _
@"V.   c #ADB74F", _
@"W.   c #BDC675", _
@"X.   c #C0C87F", _
@"Y.   c #B6BF6D", _
@"Z.   c #B2BB69", _
@"`.   c #CFD4A4", _
@" +   c #CED3A3", _
@".+   c #A9B163", _
@"++   c #B5BC7C", _
@"@+   c #9AA450", _
@"#+   c #909A43", _
@"$+   c #8D9742", _
@"%+   c #8B9441", _
@"&+   c #8B9445", _
@"*+   c #909850", _
@"=+   c #989F5C", _
@"-+   c #A1A96C", _
@";+   c #5F6A0B", _
@">+   c #5D6709", _
@"_+   c #BDC666", _
@"'+   c #B2BD4F", _
@")+   c #AFBA4E", _
@"!+   c #B4BE5E", _
@"~+   c #C2C97F", _
@"{+   c #BFC77F", _
@"]+   c #B6BF6F", _
@"^+   c #A0AB4A", _
@"/+   c #C6CC93", _
@"(+   c #CDD2A3", _
@"_+   c #CBD0A2", _
@":+   c #C0C690", _
@"<+   c #929C45", _
@"[+   c #939D4A", _
@"}+   c #979F52", _
@"|+   c #9AA25A", _
@"1+   c #9AA25E", _
@"2+   c #98A05D", _
@"3+   c #A1A76C", _
@"4+   c #5D6609", _
@"5+   c #5E680A", _
@"6+   c #B9C266", _
@"7+   c #B6C153", _
@"8+   c #B1BC4F", _
@"9+   c #AEB94E", _
@"0+   c #ABB64D", _
@"a+   c #B1BB5E", _
@"b+   c #BCC47A", _
@"c+   c #A9B255", _
@"d+   c #A8B259", _
@"e+   c #C6CC95", _
@"f+   c #D0D4A9", _
@"g+   c #D0D4AA", _
@"h+   c #B8BF83", _
@"i+   c #A2AA60", _
@"j+   c #A0A860", _
@"k+   c #9EA55E", _
@"l+   c #9BA25C", _
@"m+   c #989F5B", _
@"n+   c #969E5A", _
@"o+   c #979F5B", _
@"p+   c #9FA668", _
@"q+   c #5C660A", _
@"r+   c #5E670B", _
@"s+   c #B4BE63", _
@"t+   c #B7C256", _
@"u+   c #C2CB74", _
@"v+   c #CFD593", _
@"w+   c #D3D9A0", _
@"x+   c #D8DDAE", _
@"y+   c #B9C271", _
@"z+   c #B4BD6B", _
@"A+   c #B2BA68", _
@"B+   c #BDC481", _
@"C+   c #C3C990", _
@"D+   c #C9CE9D", _
@"E+   c #CFD4A9", _
@"F+   c #ABB36D", _
@"G+   c #A0A95E", _
@"H+   c #9EA65D", _
@"I+   c #9BA35B", _
@"J+   c #98A059", _
@"K+   c #959D58", _
@"L+   c #949C57", _
@"M+   c #9AA164", _
@"N+   c #5C660C", _
@"O+   c #5F690C", _
@"P+   c #AEB75F", _
@"Q+   c #BAC45C", _
@"R+   c #B5C052", _
@"S+   c #BAC45D", _
@"T+   c #BDC668", _
@"U+   c #D6DBA3", _
@"V+   c #DDE1B5", _
@"W+   c #DBE0B4", _
@"X+   c #C2CA84", _
@"Y+   c #B1BB66", _
@"Z+   c #AFB865", _
@"`+   c #ACB563", _
@" @   c #AAB262", _
@".@   c #A7AF60", _
@"+@   c #A4AC5F", _
@"@@   c #A1A95E", _
@"#@   c #A8AF6C", _
@"$@   c #9FA660", _
@"%@   c #98A057", _
@"&@   c #959D56", _
@"*@   c #939B55", _
@"=@   c #929A54", _
@"-@   c #99A05E", _
@";@   c #969D5D", _
@">@   c #5B650C", _
@"_@   c #5D670E", _
@"'@   c #A8B15B", _
@")@   c #BCC661", _
@"!@   c #BBC55F", _
@"~@   c #C0CA6C", _
@"{@   c #C0CA6D", _
@"]@   c #C1CA73", _
@"^@   c #DCE1B2", _
@"/@   c #DCE0B4", _
@"(@   c #D3D9A6", _
@"_@   c #CBD196", _
@":@   c #B0B964", _
@"<@   c #ADB662", _
@"[@   c #AAB360", _
@"}@   c #A7B05F", _
@"|@   c #A4AD5D", _
@"1@   c #ABB36C", _
@"2@   c #B7BD83", _
@"3@   c #B8BE87", _
@"4@   c #ACB275", _
@"5@   c #959E54", _
@"6@   c #929A53", _
@"7@   c #919952", _
@"8@   c #909951", _
@"9@   c #9AA260", _
@"0@   c #919857", _
@"a@   c #58620A", _
@"b@   c #5A640B", _
@"c@   c #A1A955", _
@"d@   c #C4CC73", _
@"e@   c #C0C96B", _
@"f@   c #C1CA6C", _
@"g@   c #BEC86A", _
@"h@   c #C7CF83", _
@"i@   c #DCE1B3", _
@"j@   c #D4D9A4", _
@"k@   c #B4BD65", _
@"l@   c #B8C071", _
@"m@   c #AEB660", _
@"n@   c #ABB35E", _
@"o@   c #A7B05C", _
@"p@   c #A4AD5A", _
@"q@   c #A3AC5C", _
@"r@   c #A4AD62", _
@"s@   c #B8BE85", _
@"t@   c #B6BC85", _
@"u@   c #B2B981", _
@"v@   c #929A50", _
@"w@   c #8F974F", _
@"x@   c #8F974E", _
@"y@   c #8E964D", _
@"z@   c #9CA363", _
@"A@   c #8A904E", _
@"B@   c #545F07", _
@"C@   c #565E08", _
@"D@   c #9DA656", _
@"E@   c #CAD182", _
@"F@   c #C0C96A", _
@"G@   c #BFC96A", _
@"H@   c #BFC969", _
@"I@   c #BCC667", _
@"J@   c #BDC66D", _
@"K@   c #DADFB0", _
@"L@   c #BCC574", _
@"M@   c #B0BA5F", _
@"N@   c #AEB75E", _
@"O@   c #ABB45C", _
@"P@   c #A5AE59", _
@"Q@   c #B5BC7A", _
@"R@   c #AFB672", _
@"S@   c #9CA554", _
@"T@   c #A7AE6A", _
@"U@   c #ADB377", _
@"V@   c #A0A764", _
@"W@   c #8F984D", _
@"X@   c #8D964C", _
@"Y@   c #8D954B", _
@"Z@   c #8C954A", _
@"`@   c #9EA566", _
@" #   c #818841", _
@".#   c #909947", _
@"+#   c #CBD283", _
@"@#   c #BEC867", _
@"##   c #BEC866", _
@"$#   c #BDC765", _
@"%#   c #BAC463", _
@"&#   c #B7C161", _
@"*#   c #C7CE87", _
@"=#   c #B8C16B", _
@"-#   c #C6CC8B", _
@";#   c #C4CA8A", _
@">#   c #A9B259", _
@"_#   c #A5AF58", _
@"'#   c #B0B870", _
@")#   c #CED3A9", _
@"!#   c #BAC187", _
@"~#   c #ABB26E", _
@"{#   c #A8AF6D", _
@"]#   c #A6AE6D", _
@"^#   c #969D54", _
@"/#   c #8D954A", _
@"(#   c #8B9449", _
@"_#   c #8B9348", _
@":#   c #8A9347", _
@"<#   c #777E36", _
@"[#   c #818B39", _
@"}#   c #CBD385", _
@"|#   c #BDC764", _
@"1#   c #BDC763", _
@"2#   c #BBC562", _
@"3#   c #B8C260", _
@"4#   c #B5BF5F", _
@"5#   c #B4BE62", _
@"6#   c #BEC577", _
@"7#   c #C4CB89", _
@"8#   c #C2C987", _
@"9#   c #A6AF56", _
@"0#   c #ADB567", _
@"a#   c #CED2A5", _
@"b#   c #CED3A8", _
@"c#   c #CDD1A7", _
@"d#   c #CBD0A6", _
@"e#   c #CACEA6", _
@"f#   c #AAB175", _
@"g#   c #8D9648", _
@"h#   c #8A9247", _
@"i#   c #899246", _
@"j#   c #899245", _
@"k#   c #889144", _
@"l#   c #A1A86B", _
@"m#   c #6B7328", _
@"n#   c #727A29", _
@"o#   c #CCD387", _
@"p#   c #B9C35F", _
@"q#   c #B6C05D", _
@"r#   c #B3BD5B", _
@"s#   c #AFBA59", _
@"t#   c #B2BC63", _
@"u#   c #BFC57F", _
@"v#   c #C0C785", _
@"w#   c #A4AD53", _
@"x#   c #A9B261", _
@"y#   c #CACFA0", _
@"z#   c #CDD2A7", _
@"A#   c #CCD0A6", _
@"B#   c #C9CDA3", _
@"C#   c #B2B880", _
@"D#   c #8E9648", _
@"E#   c #8A9344", _
@"F#   c #879043", _
@"G#   c #879042", _
@"H#   c #868F41", _
@"I#   c #A2A96E", _
@"J#   c #61681C", _
@"K#   c #636C1C", _
@"L#   c #CDD489", _
@"M#   c #B7C15B", _
@"N#   c #B3BE5A", _
@"O#   c #B1BB58", _
@"P#   c #AEB757", _
@"Q#   c #ABB455", _
@"R#   c #A8B153", _
@"S#   c #A4AE51", _
@"T#   c #A1AA4F", _
@"U#   c #9EA74D", _
@"V#   c #A5AE60", _
@"W#   c #CACEA1", _
@"X#   c #A1A95D", _
@"Y#   c #919A46", _
@"Z#   c #8E9744", _
@"`#   c #8A9342", _
@" $   c #879041", _
@".$   c #858E40", _
@"+$   c #858E3F", _
@"@$   c #A5AC71", _
@"#$   c #565F12", _
@"$$   c #56600F", _
@"%$   c #CDD58B", _
@"&$   c #B9C45C", _
@"*$   c #B7C25A", _
@"=$   c #B4BE58", _
@"-$   c #B1BB56", _
@";$   c #AFB855", _
@">$   c #ABB553", _
@"_$   c #A8B251", _
@"'$   c #A5AF50", _
@")$   c #A2AB4D", _
@"!$   c #9EA84B", _
@"~$   c #9BA54A", _
@"{$   c #99A148", _
@"]$   c #A4AC60", _
@"^$   c #9CA456", _
@"/$   c #8E9743", _
@"($   c #889140", _
@"_$   c #A7AE75", _
@":$   c #4E5508", _
@"<$   c #4D5408", _
@"[$   c #C7D080", _
@"}$   c #B5C057", _
@"|$   c #B2BC55", _
@"1$   c #AFB953", _
@"2$   c #ACB651", _
@"3$   c #A9B34F", _
@"4$   c #A6B04E", _
@"5$   c #A2AC4C", _
@"6$   c #9FA94A", _
@"7$   c #9CA648", _
@"8$   c #99A247", _
@"9$   c #969F45", _
@"0$   c #939C44", _
@"a$   c #909943", _
@"b$   c #8D9642", _
@"c$   c #8A9341", _
@"d$   c #879040", _
@"e$   c #9EA569", _
@"f$   c #4C5407", _
@"g$   c #4B520A", _
@"h$   c #939C4D", _
@"i$   c #C8D182", _
@"j$   c #C9D184", _
@"k$   c #C7CE83", _
@"l$   c #C4CC82", _
@"m$   c #C2C981", _
@"n$   c #C0C77F", _
@"o$   c #BDC47F", _
@"p$   c #BBC27D", _
@"q$   c #B9C07C", _
@"r$   c #B7BE7C", _
@"s$   c #B5BC7B", _
@"t$   c #B3BA7A", _
@"u$   c #B1B879", _
@"v$   c #AFB578", _
@"w$   c #ADB477", _
@"x$   c #ABB277", _
@"y$   c #A9AF76", _
@"z$   c #A8AE76", _
@"A$   c #A0A76C", _
@"B$   c #6D7531", _
@"C$   c #404607", _
@"D$   c #4C540A", _
@"E$   c #495106", _
@"F$   c #4A5308", _
@"G$   c #474D09", _
@"                                                                ", _
@"      . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # $       ", _
@"    . % & * * * * * * * * * * * * * * * * * * * * * * = -       ", _
@"    ; > , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 0     ", _
@"    a b c d e f g h i j k l m : < [ } | 1 2 3 4 5 6 n o p q     ", _
@"  r s t u d e f g h i j k l m : < [ } | 1 2 3 4 5 6 v w x y z   ", _
@"  A B C D d e f g h i j k l m : < [ } | 1 2 3 4 5 6 E w F G H   ", _
@"I J K L M d e f g h i j k l m : < [ } | 1 2 3 4 5 6 N w O P Q   ", _
@"R S T U V d e f g h i j k l m : < [ } | 1 2 3 4 5 6 W w O X Y 0 ", _
@"Z ` * * * * * * * * * * * * * * * * * * * * * * * * * * * * ` Z ", _
@" ...+.@.@.#.#.$.$.%.&.*.*.*.=.=.-.-.;.;.>.>.,.,.'.'.).).).!.~.{.", _
@"  I @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ I   ", _
@"    ].^.^.^.^.^.^.^.^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.    ", _
@"    b.c.^.^.^.^.^.^.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.    ", _
@"    x.y.^.^.^.^.^.^.d.z.A.B.C.D.E.F.G.H.I.J.o.K.L.M.N.O.P.Q.    ", _
@"    R.S.^.^.^.^.^.^.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+    ", _
@"    >+,+^.^.^.^.^.^.'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+=+3+4+    ", _
@"    5+6+7+^.^.^.^.d.8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+    ", _
@"    r+s+t+^.^.^.^.u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+o+M+N+    ", _
@"    O+P+Q+^.^.R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@    ", _
@"    ,@'@)@7+!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@    ", _
@"    b@c@d@e@f@~@g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@    ", _
@"    C@D@E@F@G@H@I@J@K@L@M@N@O@'@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #      ", _
@"      .#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#p+<#      ", _
@"      [#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#      ", _
@"      n#o#)@)@p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#k#F#G#H#I#J#      ", _
@"      K#L#!@S+M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$+$+$@$#$      ", _
@"      $$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$/$%+($+$+$+$+$.$_$:$      ", _
@"      <$[$S.}$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$+$+$+$.$y@e$f$      ", _
@"      g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$z$z$_$A$B$C$      ", _
@"        D$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$E$F$G$        ", _
@"                                                                "}

dim as zstring ptr video_display_xpm(...) => { _
@"32 32 295 2", _
@"     c None", _
@".    c #959595", _
@"+    c #949494", _
@"@    c #939393", _
@"#    c #919191", _
@"$    c #8F8F8F", _
@"%    c #8E8E8E", _
@"&    c #8C8C8C", _
@"*    c #8B8B8A", _
@"=    c #888888", _
@"-    c #878787", _
@";    c #858585", _
@">    c #838383", _
@"_    c #828282", _
@"'    c #808180", _
@")    c #7F7F7F", _
@"!    c #7D7D7D", _
@"~    c #7E7E7E", _
@"{    c #C1C2C0", _
@"]    c #E3E4E0", _
@"^    c #E2E4E0", _
@"/    c #E2E4DF", _
@"(    c #E2E3DF", _
@"_    c #E1E3DF", _
@":    c #E1E3DE", _
@"<    c #E1E3DD", _
@"[    c #E0E3DD", _
@"}    c #E0E2DD", _
@"|    c #E0E1DD", _
@"1    c #DFE1DD", _
@"2    c #DFE1DC", _
@"3    c #D6D8D4", _
@"4    c #757575", _
@"5    c #D4D6D2", _
@"6    c #A3A6C3", _
@"7    c #434C90", _
@"8    c #4A5392", _
@"9    c #4B5393", _
@"0    c #4C5494", _
@"a    c #4C5393", _
@"b    c #4D5494", _
@"c    c #4D5595", _
@"d    c #4C5395", _
@"e    c #4C5495", _
@"f    c #4D5596", _
@"g    c #4E5595", _
@"h    c #4A5293", _
@"i    c #9093B9", _
@"j    c #E7E9E4", _
@"k    c #E9EBE7", _
@"l    c #797979", _
@"m    c #D9DAD7", _
@"n    c #797DAD", _
@"o    c #617294", _
@"p    c #677A95", _
@"q    c #576C8A", _
@"r    c #5C609E", _
@"s    c #BBBCBA", _
@"t    c #E7E9E6", _
@"u    c #DEDEDB", _
@"v    c #676BA3", _
@"w    c #5E7190", _
@"x    c #5F7390", _
@"y    c #546988", _
@"z    c #545898", _
@"A    c #E4E6E0", _
@"B    c #E8EAE4", _
@"C    c #848584", _
@"D    c #939392", _
@"E    c #565B9C", _
@"F    c #596F8F", _
@"G    c #526889", _
@"H    c #4D5295", _
@"I    c #BDBEBB", _
@"J    c #DFE0DE", _
@"K    c #E5E7E3", _
@"L    c #515799", _
@"M    c #556D8E", _
@"N    c #4A6387", _
@"O    c #37537A", _
@"P    c #23426D", _
@"Q    c #454D91", _
@"R    c #E5E8E2", _
@"S    c #929492", _
@"T    c #929292", _
@"U    c #E8EAE5", _
@"V    c #4C5397", _
@"W    c #506B8F", _
@"X    c #436087", _
@"Y    c #32527D", _
@"Z    c #224472", _
@"`    c #1C3F6E", _
@" .   c #3E488E", _
@"..   c #C6C8C3", _
@"+.   c #D6D7D5", _
@"@.   c #9C9D9A", _
@"#.   c #E7E9E5", _
@"$.   c #485096", _
@"%.   c #4C6991", _
@"&.   c #3F5E88", _
@"*.   c #264979", _
@"=.   c #1F4375", _
@"-.   c #39438D", _
@";.   c #DDE0DA", _
@">.   c #E3E5E0", _
@"_.   c #A4A5A3", _
@"'.   c #969695", _
@").   c #E6E8E4", _
@"!.   c #444D95", _
@"~.   c #476791", _
@"{.   c #40618E", _
@"].   c #2C5181", _
@"^.   c #22487B", _
@"/.   c #333F8C", _
@"(.   c #C4C5C1", _
@"_.   c #D5D6D4", _
@":.   c #ACAEAB", _
@"<.   c #9B9C9B", _
@"[.   c #E6E7E3", _
@"}.   c #3F4A93", _
@"|.   c #436594", _
@"1.   c #416492", _
@"2.   c #315689", _
@"3.   c #254D82", _
@"4.   c #2E3C8B", _
@"5.   c #DADCD6", _
@"6.   c #B5B6B3", _
@"7.   c #5E5E5E", _
@"8.   c #A0A0A0", _
@"9.   c #E4E7E2", _
@"0.   c #394793", _
@"a.   c #406496", _
@"b.   c #355C90", _
@"c.   c #2A528A", _
@"d.   c #285189", _
@"e.   c #293B8A", _
@"f.   c #D5D8D3", _
@"g.   c #DEE0DB", _
@"h.   c #BCBEBB", _
@"i.   c #5E605E", _
@"j.   c #A6A7A6", _
@"k.   c #E4E5E1", _
@"l.   c #344191", _
@"m.   c #3C6398", _
@"n.   c #386196", _
@"o.   c #2E5991", _
@"p.   c #2B568F", _
@"q.   c #293D8C", _
@"r.   c #C8CACD", _
@"s.   c #DCDED9", _
@"t.   c #C4C5C3", _
@"u.   c #5D5D5D", _
@"v.   c #ACADAC", _
@"w.   c #2F3F91", _
@"x.   c #39639B", _
@"y.   c #38629B", _
@"z.   c #35619A", _
@"A.   c #315E98", _
@"B.   c #2E5B96", _
@"C.   c #294290", _
@"D.   c #B9BBC5", _
@"E.   c #DADDD6", _
@"F.   c #CCCDCA", _
@"G.   c #5C5C5C", _
@"H.   c #B3B4B2", _
@"I.   c #D8DADC", _
@"J.   c #2D4192", _
@"K.   c #34629F", _
@"L.   c #33619E", _
@"M.   c #31609D", _
@"N.   c #274793", _
@"O.   c #AAACBF", _
@"P.   c #D8DAD5", _
@"Q.   c #D3D4D1", _
@"R.   c #595958", _
@"S.   c #BABAB9", _
@"T.   c #CECFD5", _
@"U.   c #2B4595", _
@"V.   c #3364A3", _
@"W.   c #264B98", _
@"X.   c #9A9CB7", _
@"Y.   c #D5D8D2", _
@"Z.   c #DADCD8", _
@"`.   c #565656", _
@" +   c #C3C4D0", _
@".+   c #2B4897", _
@"++   c #3465A4", _
@"@+   c #2A529C", _
@"#+   c #8589AF", _
@"$+   c #D2D5CF", _
@"%+   c #E1E2E0", _
@"&+   c #515151", _
@"*+   c #7B7B7B", _
@"=+   c #C8C8C7", _
@"-+   c #CFD0D3", _
@";+   c #51589C", _
@">+   c #51599D", _
@"_+   c #51599C", _
@"'+   c #50589C", _
@")+   c #A9ADBC", _
@"!+   c #D0D3CC", _
@"~+   c #E8E9E6", _
@"{+   c #4E4E4E", _
@"]+   c #7B7B7A", _
@"^+   c #CBCCCA", _
@"/+   c #DBDDD8", _
@"(+   c #CED1CA", _
@"_+   c #CCCEC8", _
@":+   c #C5C5C3", _
@"<+   c #C6C6C5", _
@"[+   c #C7C8C6", _
@"}+   c #CDD0CA", _
@"|+   c #CDD0C9", _
@"1+   c #CFD1CB", _
@"2+   c #EBECE9", _
@"3+   c #4D4D4D", _
@"4+   c #AEAFAD", _
@"5+   c #E5E6E4", _
@"6+   c #DEDFDD", _
@"7+   c #E1E2DF", _
@"8+   c #D3D3D1", _
@"9+   c #737373", _
@"0+   c #767675", _
@"a+   c #7C7D7C", _
@"b+   c #777777", _
@"c+   c #767676", _
@"d+   c #747474", _
@"e+   c #717271", _
@"f+   c #70706F", _
@"g+   c #6E6E6E", _
@"h+   c #6C6C6C", _
@"i+   c #6B6B6B", _
@"j+   c #696969", _
@"k+   c #676867", _
@"l+   c #676766", _
@"m+   c #666665", _
@"n+   c #646464", _
@"o+   c #626262", _
@"p+   c #606060", _
@"q+   c #5F5F5F", _
@"r+   c #5A5A5A", _
@"s+   c #535552", _
@"t+   c #585956", _
@"u+   c #575955", _
@"v+   c #50514F", _
@"w+   c #4C4F4C", _
@"x+   c #4E504D", _
@"y+   c #5D5F5B", _
@"z+   c #91948F", _
@"A+   c #878A84", _
@"B+   c #5D5E5B", _
@"C+   c #999C96", _
@"D+   c #757773", _
@"E+   c #4D4F4C", _
@"F+   c #5A5D5A", _
@"G+   c #A0A39E", _
@"H+   c #ADB0AA", _
@"I+   c #9C9F99", _
@"J+   c #80817D", _
@"K+   c #838480", _
@"L+   c #A6AAA4", _
@"M+   c #7C807A", _
@"N+   c #474A47", _
@"O+   c #4F514E", _
@"P+   c #888C86", _
@"Q+   c #A7AAA5", _
@"R+   c #C9CBC8", _
@"S+   c #DADCD9", _
@"T+   c #EAEBE9", _
@"U+   c #F2F3F2", _
@"V+   c #EEEFEE", _
@"W+   c #CED0CD", _
@"X+   c #B6B8B4", _
@"Y+   c #8B8F8A", _
@"Z+   c #666866", _
@"`+   c #363736", _
@" @   c #2F302F", _
@".@   c #6B6D68", _
@"+@   c #797D78", _
@"@@   c #80847F", _
@"#@   c #818480", _
@"$@   c #80847E", _
@"%@   c #828580", _
@"&@   c #7D817C", _
@"*@   c #727571", _
@"=@   c #535553", _
@"-@   c #3F403E", _
@";@   c #282A28", _
@">@   c #333532", _
@"_@   c #444642", _
@"'@   c #4C4E4B", _
@")@   c #4B4D4A", _
@"!@   c #484947", _
@"~@   c #393A37", _
@"{@   c #2A2B2A", _
@"                                                                ", _
@"                                                                ", _
@"      . + + + + + + + + + @ # $ % & * = - ; > , ' ) ! ~         ", _
@"    . { ] ] ] ] ] ] ] ] ^ / / / ( _ _ : < [ } | 1 1 2 3 4       ", _
@"    . 5 6 7 8 9 9 0 a 0 a b c b d e c e f f c g h i j k l       ", _
@"    . m n o p p p p p p p p p p p p p p p p p p q r s t ~       ", _
@"    + u v w x x x x x x x x x x x x x x x x x x y z A B C       ", _
@"    D ( E F F F F F F F F F F F F F F F F F F F G H I J *       ", _
@"    # K L M M M M M M M M M M M M M M M M M N O P Q [ R S       ", _
@"    T U V W W W W W W W W W W W W W W X Y Z ` ` `  ...+.@.      ", _
@"    @ #.$.%.%.%.%.%.%.%.%.%.%.%.%.&.*.=.=.=.=.=.=.-.;.>.,.      ", _
@"    '.).!.~.~.~.~.~.~.~.~.~.~.{.].^.^.^.^.^.^.^.^./.(._.:.      ", _
@"    <.[.}.|.|.|.|.|.|.|.|.1.2.3.3.3.3.3.3.3.3.3.3.4.5.} 6.7.    ", _
@"    8.9.0.a.a.a.a.a.a.a.b.c.d.d.d.d.d.d.d.d.d.d.d.e.f.g.h.i.    ", _
@"    j.k.l.m.m.m.m.m.n.o.p.p.p.p.p.p.p.p.p.p.p.p.p.q.r.s.t.u.    ", _
@"    v./ w.x.x.y.z.A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C.D.E.F.G.    ", _
@"    H.I.J.K.L.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.N.O.P.Q.R.    ", _
@"    S.T.U.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.V.W.X.Y.Z.`.    ", _
@"    {  +.+++++++++++++++++++++++++++++++++++++++++@+#+$+%+&+    ", _
@"  *+=+-+;+>+>+>+>+>+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+'+)+!+~+{+    ", _
@"  ]+^+/+(+(+(+(+(+(+(+(+(+_+:+<+[+}+}+}+|+|+|+|+|+|+|+1+2+3+    ", _
@"  4 4+5+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+6+7+8+{+    ", _
@"    9+0+! a+]+l b+c+d+9+e+f+g+h+i+j+k+l+m+n+o+p+q+q+q+r+3+      ", _
@"                      s+s+t+t+t+t+t+u+v+w+                      ", _
@"                  x+y+z+A+t+t+t+t+t+B+C+D+E+                    ", _
@"                  F+G+H+I+J+J+J+J+J+K+H+L+M+N+                  ", _
@"                  O+P+Q+R+S+T+U+V+J W+X+Y+Z+`+                  ", _
@"                   @E+.@+@@@#@@@$@%@&@*@=@-@                    ", _
@"                      ;@>@,@'@)@'@!@~@{@                        ", _
@"                                                                ", _
@"                                                                ", _
@"                                                                "}

var w = Fl_GetW()*0.2
var h = Fl_GetH()*0.2

var terminal = Fl_PixmapNew(@terminal_xpm(0))
var user_trash = Fl_PixmapNew(@user_trash_xpm(0))
var video_display = Fl_PixmapNew(@video_display_xpm(0))

var win = Fl_Double_WindowNew(w,h,"XPM Pixmaps")

  var box1 = Fl_BoxExNew(50,32,32,32)
  Fl_WidgetSetImage box1,terminal
  var box2 = Fl_BoxExNew(50+44*1,32,32,32)
  Fl_WidgetSetImage box2,user_trash
  var box3 = Fl_BoxExNew(50+44*2,32,32,32)
  Fl_WidgetSetImage box3,video_display
 
Fl_WindowShow win
Fl_Run
]

Short explanation how i have done this: With Gimp you can export any 32 x 32 image to .xpm. Xpm is actually a textfile and can be loaded in Geany. There it can be changed from C form to FB and brought to screen like in Joshys testfile "dragable boxes.bas". The first tries had many mistakes, but in the latter there is often only one or few pixels, that maybe can be manually corrected.
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 09, 2019 21:42

Before export it is a good idea to do what was called once "color reduction/dither". There are many ways to achieve a similar result. In my german Gimp version there is "Bild/Modus/indiziert" where the number of colors can be set to 16 for such a small pixmap. Export as .xpm:

Code: Select all

/* XPM */
static char * system_monitor_16colors_xpm[] = {
"32 32 17 1",
"    c None",
".   c #02245C",
"+   c #22488E",
"@   c #535959",
"#   c #3062AD",
"$   c #40679B",
"%   c #3C75C7",
"&   c #737873",
"*   c #5D80B3",
"=   c #6D96B7",
"-   c #9B9E98",
";   c #7EA5AB",
">   c #ADC3B3",
",   c #D2D4CF",
"'   c #C1DFBF",
")   c #F0F5ED",
"!   c #E5FFC7",
"  ----------&&&&&&&&&&&&&&&&&   ",
" -,))))))))))))))))))))))))),&  ",
"-,)))))))))))))))))))),,,,',)-& ",
"-))*.......................=',@ ",
"-)).+$$$$$$$$$$$$$$$$$$$$$+.,)@ ",
"-)).$=====;=======******==$.')@ ",
"-)).$=====>===********====$.')@ ",
"-)).$****>'=***********===$.',@ ",
"-)).$***=''=**=********=$#+.,,@ ",
"-)).$***='';*=;******#$#+++.,,@ ",
"-)).+#$$;'!;*=>*##$###$++++.,,@ ",
"-)).+++$>''>$>';##$$$$$#$$$.,,@ ",
"-)).$$$=''''=''>$=>>>>>>>>'@,,@ ",
"-))@'>>>'>>';'>!;'!!!!!!!!!@,,@ ",
"-))@''''';;'>';!''>;;;;;;==@,,@ ",
"-)).##$$$$;'''*>'>*########.,,@ ",
"-)).######*'!;#=>*#########.,'@ ",
"-)).#######>';%%*%%%#######.,'@ ",
"-)).#######='%%%%%%%#######.,,@ ",
"-)).#######=>%%%%%%%#######.,,@ ",
"-)).#######*;%%%%%%%#######.,,@ ",
"-)).########*%%%%%%%#######.,,@ ",
"-))=.......................=,,@ ",
"-)))))),,,,,,,,,,,,,,,,,,)),,,@ ",
"-))),,,',,,>>>-->>>-->>-->>>>,@ ",
"-)),,,',,,>>>---->--->----->>,@ ",
"-)),,',,,>>>>>>,->-,,->-,-->>-@ ",
"-,),,',,,,,,,>--->>-->>--->>,-@ ",
" -,)))))))))),,,,,,,,,,,-,,>-&  ",
"  ----------&&&&&&&&&&&&&&&&@   ",
"                                ",
"                                "};


Now we can bring it in FB form.
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 10, 2019 23:36

And what can we do with these pixmaps now? Pixmap buttons without the need to load files.

Code: Select all

' Fltk_Pixmap_Button.bas

#include once "fltk-c.bi"

dim as zstring ptr linux_xpm(...) => {@"32 32 24 1", _
@"    c None",@".   c #020500",@"+   c #1D1B18",@"@   c #2D2F2C",@"#   c #41423F",@"$   c #5A4022",@"%   c #53534F",@"&   c #814F19", _
@"*   c #646460",@"=   c #8A643F",@"-   c #85847E",@";   c #C37D2F",@">   c #D47F18",@",   c #A9A8A3",@"'   c #CFA36F",@")   c #F6AF3B", _
@"!   c #F9BB5D",@"~   c #FAC545",@"{   c #E6C48A",@"]   c #FAC679",@"^   c #CDCECA",@"/   c #FBD79D",@"(   c #E3E5E1",@"_   c #EEF0EC", _
@"                                ", _
@"              %%%#@             ", _
@"             #%%%%@@            ", _
@"            @@#####.#           ", _
@"            @-#@-,@.@           ", _
@"            *(*@_^*.@           ", _
@"            -*;;'*-.+           ", _
@"            =))))!=..           ", _
@"            ;)))));..           ", _
@"           #$))))!,..@          ", _
@"           @%(]]{_^..*          ", _
@"          #.-_____(@.#*         ", _
@"          %.,______-..*%        ", _
@"         *@*_______^+.+*        ", _
@"        %%.,________-..%#       ", _
@"        %+*(((((((((^..#%#      ", _
@"       #%.,((((_(((((*.@##      ", _
@"       ##+^((______((,.@#@      ", _
@"       @@%((________(^@@@+      ", _
@"      #@@*(_________(^*%#+      ", _
@"      &;;$^_________^;++@#      ", _
@"      !/];+,((((((((']%.$>>     ", _
@"    >!]]]!&.,(((((((']]']))     ", _
@"    )]]]]];+#^((((((;]]]!))>    ", _
@"    ))]]]!!;*^^^^^^^)!!!~~~)    ", _
@"    )))!!!!);^^^^^^')!!~~~~~>   ", _
@"   >))))~~~~)=,,,,-;~~~~~~)>    ", _
@"   >)~~~~~~~~&.+++.>~~~~~>      ", _
@"     >>>)~~~)$@   @>~~~~>       ", _
@"         >>>       ;))>         ", _
@"                                ", _
@"                                "}

dim as zstring ptr windows_xpm(...) => {@"32 32 24 1", _
@"    c None",@".   c #224B87",@"+   c #315B94",@"@   c #2F65A7",@"#   c #3E669C",@"$   c #3D6CA9",@"%   c #4A6FA1",@"&   c #567DB2", _
@"*   c #617FAD",@"=   c #6184B8",@"-   c #5C8ABC",@";   c #678AB7",@">   c #6B8CB4",@",   c #6C93C0",@"'   c #7495BD",@")   c #7D9DC5", _
@"!   c #8DA9CC",@"~   c #9DB4D2",@"{   c #ABBFD9",@"]   c #B7C9DF",@"^   c #C8D6E6",@"/   c #D4E0EE",@"(   c #EAF0F5",@"_   c #FDFFFC", _
@"            ........            ", _
@"         ...#&;''>*#...         ", _
@"       ..+>~{~~!!~~{~'+..       ", _
@"      ..;~~)-=====-,)~{'..      ", _
@"     .+~~)===-===---;;!{~+.     ", _
@"    .%{~-===---;;;;,,,,,{{%.    ", _
@"   .+{!=--;;;;,,,,,,,,,,'~]#.   ", _
@"  ..~~;;;,,,,,,,,,,,'))))){{..  ", _
@"  .'{,,,,,,,,,'')!~{^/(^'')]'.  ", _
@" .+{!,,,,'!~{~](_______^,,,!{+. ", _
@" .){''!/(____]^________^,,,,{'. ", _
@" .{~))~______]^________^,,;;!{. ", _
@".#]),'!______]^________^;;;;,{#.", _
@".;{,,,!______]^________^----={*.", _
@".'{,,,!______]^________^=====~>.", _
@".)~,,,){{{{{{!!{{{{{{{{!=====!'.", _
@".)~;;;)//////~{////////{=====!'.", _
@".>~;--!______]^________^=&&&&~;.", _
@".*{===!______{^________]$$&&&~*.", _
@".#{,==)______{]________]@@@$%~+.", _
@" .~)==)______~]________]@@@@-!. ", _
@" .'~==-~]/(__~]________]@@@@!*. ", _
@" .+~,&$$@@@$-&)]/______]@@@=~.. ", _
@"  .*!$@@@@@@@@@@@@&;!{^~@@$!*.  ", _
@"  ..!)@@@@@@@@@@@@@@@@@@@$)!.   ", _
@"   .+!,@@@@@@@@@@@@@@@@@$,!+.   ", _
@"    .#!)$@@@@@@@@@@@@@@$)!#.    ", _
@"     .+!!=@@@@@@@@@@@@=!)+.     ", _
@"      ..*~!-$@@@@@@$-!~*..      ", _
@"       ...*!~!))))!~!*..        ", _
@"         ...+%*;;*%+...         ", _
@"            ........            "}

dim as zstring ptr peace_sign_xpm(...) => {@"32 32 24 1", _
@"    c None", @".   c #11171B", @"+   c #1B2835", @"@   c #233753", @"#   c #303F4F", @"$   c #224473", @"%   c #29436D", @"&   c #2D496E", _
@"*   c #234A85", @"=   c #3B4D61", @"-   c #375072", @";   c #2F5790", @">   c #345C8C", @",   c #4A5B6F", @"'   c #435C7C", @")   c #42659A", _
@"!   c #56697F", @"~   c #536A89", @"{   c #4C6B97", @"]   c #547097", @"^   c #5274A4", @"/   c #5C7696", @"(   c #607EA5", @"_   c #6F8BAD", _
@"                 =#             ", _
@"                !)/#            ", _
@"               #^*]             ", _
@"               !;*~             ", _
@"               /*;!    ,,       ", _
@"              ,)*{#   !)^=      ", _
@"              ~**~   ={*^#      ", _
@"             #{**!  #]*),       ", _
@"             !**)=  /**/        ", _
@"             ]**]  ~;*/#        ", _
@"            ,;**~ ,{*{,         ", _
@"            /***/!{**!          ", _
@"           ,>&***;**]#          ", _
@"           '~{~&***),           ", _
@"          ={***{/$%~!~/#        ", _
@"         ={*****^_];**;,        ", _
@"         ~***{~{)_>***^#        ", _
@"         ~***'*=~]]'='==        ", _
@"         ~**)&**$-(^^{)/        ", _
@"         ]***]$**(^);))/        ", _
@"         {***;'**-~~~',         ", _
@"         {****)-****;!          ", _
@"        #)****;'****/           ", _
@"        ,*****^****{#           ", _
@"        ~)***))***),            ", _
@"        @;)/^****;~.            ", _
@"         #*$~]))^~+             ", _
@"          +@$$--&+              ", _
@"            .++++               ", _
@"                                ", _
@"                                ", _
@"                                "}

sub ButtonCB cdecl (byval button as FL_WIDGET ptr)
  ? "Button pushed"
end sub

  const ICONSIZE = 48' can be set flexible
 
  var linux = Fl_PixmapNew(@linux_xpm(0))
  var windows = Fl_PixmapNew(@windows_xpm(0))
  var peace = Fl_PixmapNew(@peace_sign_xpm(0))

  ' mainwindow
  var win  = Fl_Double_WindowNew(320,200,"Fltk_Pixmap_Button.bas")
 
  var btn1 = Fl_ButtonNew( 70,80,ICONSIZE,ICONSIZE)
  Fl_WidgetSetImage btn1,linux
  var btn2 = Fl_ButtonNew(140,80,ICONSIZE,ICONSIZE)
  Fl_WidgetSetImage btn2,windows
  var btn3 = Fl_ButtonNew(210,80,ICONSIZE,ICONSIZE)
  Fl_WidgetSetImage btn3,peace
 
  ' connect callbacks
   Fl_WidgetSetCallback0 btn1, @ButtonCB
   Fl_WidgetSetCallback0 btn2, @ButtonCB
   Fl_WidgetSetCallback0 btn3, @ButtonCB
 
Fl_WindowShow win
Fl_Run


edit: changed iconsize to 48
Last edited by Knatterton on Aug 11, 2019 8:20, edited 4 times in total.
jdebord
Posts: 521
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby jdebord » Aug 11, 2019 7:25

Nice example, but I would rather set ICONSIZE at a value > 32 otherwise the picture extends outside of the button.
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 11, 2019 8:07

Right, 48 will fit better today. And to export all original colors will be no problem if we get more values in one row it occupies not to much space in the code.

We are very flexible in this case. And this is wanted because there are so much different hardware displays. 32 is already a little small.

For this the resize function is good where the whole mainwindow is resized all together. I wonder why in last version of FastLighter the menubar not becomes resized together with the toolbar.
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: FLTK-C-1.3.3 for FreeBASIC

Postby Knatterton » Aug 11, 2019 8:12

Oh yes, now i see what you really mean. With iconsize 48 there is a little distance between the picture and the edge of the button. Inserted this. ;-)
bcohio2001
Posts: 546
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Postby bcohio2001 » Aug 11, 2019 15:08

Sorry to bother you again.
Did a search through your "test" programs for Fl_BoxNew and came up with 39 files. Of the ones I looked at, none addressed the issue that I am having.

I might be using the wrong widget for it. The equivalent of a "Static" area in Win32.
Involving multi-line text.

Code: Select all

#include once "fltk-c.bi"

var Win = Fl_WindowNew(320,200)
Dim As String MLText = "Line 1" + Chr(13,10) + "Line 2" + Chr(13, 10) + "Line 3"
Var StatusArea = Fl_BoxNew(10,10,300,180,MLText)
Fl_WidgetSetAlign(StatusArea, Fl_ALIGN_TOP_LEFT)
Fl_WindowShow Win
Fl_Run

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 2 guests