Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Attributes | Friends
aqua_chooser_widget_rep Class Reference
Inheritance diagram for aqua_chooser_widget_rep:
Inheritance graph
[legend]
Collaboration diagram for aqua_chooser_widget_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

() - aqua_chooser_widget_rep
() - ~aqua_chooser_widget_rep
(virtual void) - send
(virtual blackbox- query
(virtual widget- read
(virtual void) - write
(virtual void) - notify
(virtual widget- plain_window_widget
(void) - perform_dialog
() - aqua_chooser_widget_rep
() - ~aqua_chooser_widget_rep
(void) - send
(blackbox- query
(void) - notify
(widget- read
(void) - write
(widget- plain_window_widget
(widget- file_chooser_widget
virtual widget make_popup_widget ()
virtual widget popup_window_widget (string s)
virtual TMMenuItemas_menuitem ()
virtual tm_ostreamprint (tm_ostream &out)
virtual void connect (slot s, widget w2, slot s2)
virtual void deconnect (slot s, widget w2, slot s2)

Public Attributes

int ref_count

Protected Attributes

command cmd
string type
bool save
string win_title
string directory
coord2 position
coord2 size
string file
list< widget_connectionin
list< widget_connectionout

Friends

class widget

Detailed Description

Definition at line 32 of file aqua_dialogues.mm.


Constructor & Destructor Documentation

- aqua_chooser_widget_rep: (command
(string
(bool)   
- aqua_chooser_widget_rep:
- aqua_chooser_widget_rep: (command _cmd
(string _type
(bool)  _save 

Definition at line 59 of file aqua_dialogues.mm.

: aqua_widget_rep(), cmd(_cmd), type(_type), 
  save(_save), position (coord2 (0, 0)), 
  size (coord2 (100, 100)), file ("")
{
}
- aqua_chooser_widget_rep:

Definition at line 66 of file aqua_dialogues.mm.

{  }

Member Function Documentation

TMMenuItem * aqua_widget_rep::as_menuitem ( ) [virtual, inherited]

Reimplemented in simple_widget_rep, aqua_menu_rep, aqua_balloon_widget_rep, aqua_image_widget_rep, and aqua_text_widget_rep.

Definition at line 69 of file aqua_widget.mm.

                             { 
  return [TMMenuItem alloc];  
}
void widget_rep::connect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 150 of file widget.cpp.

                                               {
  widget_connection con (this, s, w2.rep, s2);
  insert (out, con);
  insert (w2->in, con);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::deconnect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 157 of file widget.cpp.

                                                 {
  widget_connection con (this, s, w2.rep, s2);
  remove (out, con);
  remove (w2->in, con);
}
- (widget) file_chooser_widget (command cmd
(string type
(bool)  save 

Definition at line 203 of file aqua_dialogues.mm.

{
  return tm_new <aqua_chooser_widget_rep> (cmd, type, save);
}
widget aqua_widget_rep::make_popup_widget ( ) [virtual, inherited]

Reimplemented in aqua_menu_rep, and aqua_menu_rep.

Definition at line 56 of file aqua_widget.mm.

                                    {
  return this;
}
- (virtual void) notify (slot s
(blackbox new_val 

Reimplemented from widget_rep.

Here is the caller graph for this function:

- (void) notify (slot s
(blackbox new_val 

Reimplemented from widget_rep.

Definition at line 159 of file aqua_dialogues.mm.

                                                         {
  switch (s) {
  default: ;
  }
  widget_rep::notify (s, new_val);
}

Here is the call graph for this function:

- (void) perform_dialog

Definition at line 252 of file aqua_dialogues.mm.

{
  int result;
  NSArray *fileTypes = [NSArray arrayWithObject:@"tm"];
  NSSavePanel *oPanel = [TMSavePanel savePanel];
  [oPanel setTitle:to_nsstring(win_title)];
  //  [oPanel setMessage:@"Choose a file."];
  [oPanel setNameFieldLabel:@"File:"];
  [oPanel setPrompt:@"Choose"];
  [oPanel setAllowedFileTypes:fileTypes];
  // [oPanel setAllowsMultipleSelection:YES];
  NSPoint pos = to_nspoint(position);
  NSRect r = NSMakeRect(0,0,0,0);
  r.size = [oPanel frame].size;
  NSOffsetRect(r, pos.x - r.size.width/2, pos.y - r.size.height/2);
  [oPanel setFrameOrigin:r.origin];
  
  result = [oPanel runModalForDirectory:to_nsstring(directory)
                 file:nil ];
  if (result == NSOKButton) {
    file = from_nsstring([oPanel filename]);
    url u= url_system (scm_unquote (file));
    if (type == "image")
      file = "(list (url-system " * scm_quote (as_string (u)) *
             ") \"\" \"\" \"\" \"\")";
    //FIXME: fake image dimensions
    else
      file = "(url-system " * scm_quote (as_string (u)) * ")";
  } else {
    file = "#f";
  }
  cmd ();     
}

Here is the call graph for this function:

Here is the caller graph for this function:

- (virtual widget) plain_window_widget (string s

Reimplemented from aqua_widget_rep.

Reimplemented from aqua_widget_rep.

Definition at line 195 of file aqua_dialogues.mm.

{
  win_title = s;
  return this;
}
widget aqua_widget_rep::popup_window_widget ( string  s) [virtual, inherited]

Reimplemented in aqua_menu_rep, and aqua_menu_rep.

Definition at line 61 of file aqua_widget.mm.

                                              {
  (void) s;
  return widget();
}

Here is the caller graph for this function:

tm_ostream & widget_rep::print ( tm_ostream out) [virtual, inherited]

Reimplemented in wk_widget_rep.

Definition at line 207 of file widget.cpp.

                                  {
  return out << "widget";
}
- (virtual blackbox) query (slot s
(int)  type_id 

Reimplemented from widget_rep.

Here is the caller graph for this function:

- (blackbox) query (slot s
(int)  type_id 

Reimplemented from widget_rep.

Definition at line 131 of file aqua_dialogues.mm.

                                                   {
  switch (s) {
  case SLOT_POSITION:  
    {
      typedef pair<SI,SI> coord2;
      TYPE_CHECK (type_id == type_helper<coord2>::id);
      return close_box<coord2> (position);
    }
  case SLOT_SIZE:
    {
      typedef pair<SI,SI> coord2;
      TYPE_CHECK (type_id == type_helper<coord2>::id);
      return close_box<coord2> (size);
    }
                     
  case SLOT_STRING_INPUT:
    {
      TYPE_CHECK (type_id == type_helper<string>::id);
      return close_box<string> (file);
    }
    
  default:
    return aqua_widget_rep::query(s,type_id);
  }
}

Here is the call graph for this function:

- (virtual widget) read (slot s
(blackbox index 

Reimplemented from widget_rep.

Here is the caller graph for this function:

- (widget) read (slot s
(blackbox index 

Reimplemented from widget_rep.

Definition at line 167 of file aqua_dialogues.mm.

                                                     {
  switch (s) {
  case SLOT_WINDOW:
    check_type_void (index, "SLOT_WINDOW");
    return this;
  case SLOT_FORM_FIELD:
    check_type<int> (index, "SLOT_FORM_FIELD");
    return this;
  case SLOT_FILE:
    check_type_void (index, "SLOT_FILE");
    return this;
  case SLOT_DIRECTORY:
    check_type_void (index, "SLOT_DIRECTORY");
    return this;
  default:
    return aqua_widget_rep::read(s,index);
  }
}

Here is the call graph for this function:

- (virtual void) send (slot s
(blackbox val 

Reimplemented from widget_rep.

Here is the caller graph for this function:

- (void) send (slot s
(blackbox val 

Reimplemented from widget_rep.

Definition at line 71 of file aqua_dialogues.mm.

                                                   {
  switch (s) {
  case SLOT_VISIBILITY:
    {  
      check_type<bool> (val, "SLOT_VISIBILITY");
      bool flag = open_box<bool> (val);
      (void) flag;
      NOT_IMPLEMENTED
       }      
    break;
  case SLOT_SIZE:
    {
      TYPE_CHECK (type_box (val) == type_helper<coord2>::id);
      size = open_box<coord2> (val);
    }
    break;
  case SLOT_POSITION:
    {
      TYPE_CHECK (type_box (val) == type_helper<coord2>::id);
      position = open_box<coord2> (val);
    }
    break;
  case SLOT_KEYBOARD_FOCUS:
    {
      TYPE_CHECK (type_box (val) == type_helper<bool>::id);
      perform_dialog();
    }
    break;
    
  case SLOT_STRING_INPUT:
    //        send_string (THIS, "input", val);
    NOT_IMPLEMENTED 
      break;
  case SLOT_INPUT_TYPE:
    TYPE_CHECK (type_box (val) == type_helper<string>::id);
    type = open_box<string> (val);        
    // send_string (THIS, "type", val);
    break;
#if 0
  case SLOT_INPUT_PROPOSAL:
    //send_string (THIS, "default", val);
    break;
#endif
  case SLOT_FILE:
    //send_string (THIS, "file", val);
    NOT_IMPLEMENTED
      break;
  case SLOT_DIRECTORY:
    TYPE_CHECK (type_box (val) == type_helper<string>::id);
    directory = open_box<string> (val);
    directory = as_string (url_pwd () * url_system (directory));
    break;
    
  default:
    aqua_widget_rep::send(s,val);
  }
}

Here is the call graph for this function:

- (virtual void) write (slot s
(blackbox index
(widget w 

Reimplemented from widget_rep.

Here is the caller graph for this function:

- (void) write (slot s
(blackbox index
(widget w 

Reimplemented from widget_rep.

Definition at line 187 of file aqua_dialogues.mm.

                                                                {
  switch (s) {
  default:
    aqua_widget_rep::write(s,index,w);
  }
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class widget [friend, inherited]

Definition at line 59 of file widget.hpp.


Member Data Documentation

- (command) cmd [protected]

Definition at line 34 of file aqua_dialogues.mm.

- (string) directory [protected]

Definition at line 38 of file aqua_dialogues.mm.

- (string) file [protected]

Definition at line 41 of file aqua_dialogues.mm.

list<widget_connection> widget_rep::in [protected, inherited]

Definition at line 36 of file widget.hpp.

list<widget_connection> widget_rep::out [protected, inherited]

Definition at line 37 of file widget.hpp.

- (coord2) position [protected]

Definition at line 39 of file aqua_dialogues.mm.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

- (bool) save [protected]

Definition at line 36 of file aqua_dialogues.mm.

- (coord2) size [protected]

Definition at line 40 of file aqua_dialogues.mm.

- (string) type [protected]

Definition at line 35 of file aqua_dialogues.mm.

- (string) win_title [protected]

Definition at line 37 of file aqua_dialogues.mm.


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