Back to index

Classes | Functions
enum_widget.cpp File Reference
#include "window.hpp"
#include "Widkit/wk_widget.hpp"
#include "scheme.hpp"

Go to the source code of this file.


class  enum_command_rep


command enum_command (wk_widget in, string val, command cb)
wk_widget enum_wk_widget (command cb, array< string > vals, string val, int style, string w)

Function Documentation

command enum_command ( wk_widget  in,
string  val,
command  cb 

Definition at line 40 of file enum_widget.cpp.

  return tm_new<enum_command_rep> (in, val, cb);

Here is the caller graph for this function:

wk_widget enum_wk_widget ( command  cb,
array< string vals,
string  val,
int  style,
string  w 

Definition at line 49 of file enum_widget.cpp.

  int i, n= N(vals);
  array<string> def (1);
  def[0]= val;
  wk_widget in= input_text_wk_widget (cb, "string", def, style, w, true);
  if (n == 0) return in;
  bool editable= (val == "" || vals[n-1] == "");
  if (vals[n-1] == "") { n= n-1; vals= range (vals, 0, n); }
  array<wk_widget> entries (n);
  for (i=0; i<n; i++) {
    wk_widget txt= text_wk_widget (vals[i], style);
    command cmd= enum_command (in, vals[i], cb);
    entries[i]= command_button (txt, cmd, style);
  wk_widget menu= vertical_menu (entries);
  if (!editable)
    return pulldown_button (in, menu, style);
  wk_widget v= text_wk_widget ("v", style);
  wk_widget v_but= command_button (v, command (), style|WIDGET_STYLE_BUTTON);
  wk_widget v_pop= pulldown_button (v_but, menu, style);
  array<wk_widget> ret (2);
  ret[0]= in;
  ret[1]= v_pop;
  return horizontal_list (ret);

Here is the call graph for this function:

Here is the caller graph for this function: