Back to index

texmacs  1.0.7.15
Classes | Functions
color_picker_widget.cpp File Reference
#include "Widkit/basic_widget.hpp"
#include "Widkit/attribute_widget.hpp"
#include "Widkit/layout.hpp"
#include "file.hpp"
#include "scheme.hpp"

Go to the source code of this file.

Classes

class  color_command_rep

Functions

wk_widget color_widget (tree col)
command color_command (command cmd, tree col)
wk_widget color_button_widget (tree col, command cmd)
wk_widget tile_color_picker (array< tree > cols, command cmd, int columns)
wk_widget direct_color_picker (command cmd, bool bg, array< tree > proposals)
wk_widget color_picker_wk_widget (command cmd, bool bg, array< tree > proposals)

Function Documentation

Definition at line 43 of file color_picker_widget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

command color_command ( command  cmd,
tree  col 
)

Definition at line 38 of file color_picker_widget.cpp.

                                      {
  return tm_new<color_command_rep> (cmd, col);
}

Here is the caller graph for this function:

wk_widget color_picker_wk_widget ( command  cmd,
bool  bg,
array< tree proposals 
)

Definition at line 113 of file color_picker_widget.cpp.

                                                                     {
  return direct_color_picker (cmd, bg, proposals);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 23 of file color_picker_widget.cpp.

                        {
  return glue_wk_widget (col, false, false, 32*PIXEL, 24*PIXEL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

wk_widget direct_color_picker ( command  cmd,
bool  bg,
array< tree proposals 
)

Definition at line 63 of file color_picker_widget.cpp.

                                                                  {
  (void) proposals;
  array<wk_widget> picker (bg? 5: 3);

  array<tree> cols1;
  cols1 << tree ("dark red") << tree ("dark magenta")
       << tree ("dark blue") << tree ("dark cyan")
       << tree ("dark green") << tree ("dark yellow")
       << tree ("dark orange") << tree ("dark brown")
       << tree ("red") << tree ("magenta")
       << tree ("blue") << tree ("cyan")
       << tree ("green") << tree ("yellow")
       << tree ("orange") << tree ("brown")
       << tree ("pastel red") << tree ("pastel magenta")
       << tree ("pastel blue") << tree ("pastel cyan")
       << tree ("pastel green") << tree ("pastel yellow")
       << tree ("pastel orange") << tree ("pastel brown");
  picker[0]= tile_color_picker (cols1, cmd, 8);

  picker[1]= glue_wk_widget (true, false, 0, 5*PIXEL);

  array<tree> cols2;
  cols2 << tree ("black") << tree ("darker grey")
       << tree ("dark grey") << tree ("light grey")
       << tree ("pastel grey")     << tree ("white");
  picker[2]= tile_color_picker (cols2, cmd, 8);

  if (bg) {
    picker[3]= glue_wk_widget (true, false, 0, 5*PIXEL);

    bool dir_problem;
    url pattern_dir= "$TEXMACS_PATH/misc/patterns";
    array<string> all= read_directory (pattern_dir, dir_problem);
    array<tree> cols3;
    for (int i=0; i<N(all); i++)
      if (ends (all[i], ".png")) {
       url image= resolve (relative (pattern_dir, all[i]));
       cols3 << tree (PATTERN, as_string (pattern_dir * all[i]), "", "");
      }
    picker[4]= tile_color_picker (cols3, cmd, 8);
  }

  return vertical_list (picker);
}

Here is the call graph for this function:

Here is the caller graph for this function:

wk_widget tile_color_picker ( array< tree cols,
command  cmd,
int  columns 
)

Definition at line 54 of file color_picker_widget.cpp.

                                                               {
  int i, n= N(cols);
  array<wk_widget> ws (n);
  for (i=0; i<n; i++)
    ws[i]= color_button_widget (cols[i], cmd);
  return tile (ws, columns);
}

Here is the call graph for this function:

Here is the caller graph for this function: