Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Private Attributes
file_chooser_command_rep Class Reference
Inheritance diagram for file_chooser_command_rep:
Inheritance graph
[legend]
Collaboration diagram for file_chooser_command_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 file_chooser_command_rep (wk_widget w, int t)
void apply ()
tm_ostreamprint (tm_ostream &out)
virtual void apply (object args)

Public Attributes

int ref_count

Private Attributes

wk_widget_repfch
int type

Detailed Description

Definition at line 46 of file file_chooser_widget.cpp.


Constructor & Destructor Documentation

Definition at line 50 of file file_chooser_widget.cpp.

: fch(w.rep), type(t) {}

Member Function Documentation

void command_rep::apply ( object  args) [virtual, inherited]

Reimplemented in object_command_rep.

Definition at line 20 of file command.cpp.

                               {
  (void) args;
  apply ();
}

Here is the call graph for this function:

void file_chooser_command_rep::apply ( ) [virtual]

Implements command_rep.

Definition at line 57 of file file_chooser_widget.cpp.

                                 {
  wk_widget fch_wid (fch);
  switch (type) {
  case CHANGE_FILE:
    {
      string s;
      fch_wid[0]["file"]["input"] << get_string ("input", s);
      fch_wid << set_string ("return", scm_unquote (s));
      break;
    }
  case CHANGE_DIR:
    {
      string dir;
      fch_wid[0]["directory"]["input"] << get_string ("input", dir);
      if (dir == "#f") fch_wid << set_string ("return", "#f");
      else {
       dir= scm_unquote (dir);
       fch_wid << set_string ("directory", dir);
      }
      break;
    }
  case BUTTON_HOME:
    fch_wid << set_string ("directory", "~");
    break;
  case BUTTON_TEXTS:
    fch_wid << set_string ("directory",
                        as_string (url ("$TEXMACS_HOME_PATH", "texts")));
    break;
  case BUTTON_FILE_OK:
    {
      string s;
      fch_wid[0]["file"]["input"] << get_string ("input", s);
      fch_wid << set_string ("return", scm_unquote (s));
      break;
    }
  case BUTTON_DIR_OK:
    {
      string s;
      fch_wid[0]["directory"]["input"] << get_string ("input", s);
      fch_wid << set_string ("return", scm_unquote (s));
      break;
    }
  case BUTTON_CANCEL:
    fch_wid << set_string ("return", "#f");
    break;
  case CHANGE_SUFFIXES:
    {
      string sxs;
      fch_wid[0]["suffixes"]["input"] << get_string ("input", sxs);
      fch_wid << set_string ("suffixes", scm_unquote (sxs));
      break;
    }
  default:
    {
      string which, s;
      if (type == IMAGE_HSIZE) which= "hsize";
      else if (type == IMAGE_VSIZE) which= "vsize";
      else if (type == IMAGE_XPOS) which= "xpos";
      else if (type == IMAGE_YPOS) which= "ypos";
      else break;
      wk_widget inp= fch_wid[0]["image"]["parameters"][which]["input"];
      inp << get_string ("input", s);
      if (s == "#f") fch_wid << set_string ("return", "#f");
      else inp << set_string ("input", scm_unquote (s));
      break;
    }
  }
}

Here is the call graph for this function:

tm_ostream& file_chooser_command_rep::print ( tm_ostream out) [inline, virtual]

Reimplemented from command_rep.

Definition at line 52 of file file_chooser_widget.cpp.

                                      {
    return out << "File chooser command (" << type << ")"; }

Member Data Documentation

Definition at line 47 of file file_chooser_widget.cpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 48 of file file_chooser_widget.cpp.


The documentation for this class was generated from the following file: