Back to index

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

List of all members.

Public Member Functions

() - aqua_input_widget_rep
() - ~aqua_input_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
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
array< aqua_field_widgetfields
coord2 size
coord2 position
string win_title
list< widget_connectionin
list< widget_connectionout

Friends

class widget

Detailed Description

Definition at line 291 of file aqua_dialogues.mm.


Constructor & Destructor Documentation

- aqua_input_widget_rep: (command _cmd
(array< string >)  _prompts 

Definition at line 384 of file aqua_dialogues.mm.

: aqua_widget_rep(), cmd(_cmd), fields(N(_prompts)), size(coord2(100,100)), position(coord2(0,0)), win_title("") 
{
  for(int i=0; i < N(_prompts); i++) {
    fields[i] = tm_new <aqua_field_widget_rep> (this);
    fields[i]->prompt = _prompts[i];
  }
}

Here is the call graph for this function:

- aqua_input_widget_rep:

Definition at line 393 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 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;
}
- (void) notify (slot s
(blackbox new_val 

Reimplemented from widget_rep.

Definition at line 460 of file aqua_dialogues.mm.

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

Definition at line 599 of file aqua_dialogues.mm.

{
  TMInputHelper *ih = [[TMInputHelper alloc] init];
  NSMatrix *form = ih->form;
  [form renewRows:N(fields) columns:2];
  for(int i=0; i<N(fields); i++) {
    NSCell *cell = [[[NSCell alloc] initTextCell:to_nsstring(fields[i]->prompt)] autorelease];
    [form putCell:cell atRow:i column:0];
    NSComboBoxCell *cell2 = [[[NSComboBoxCell alloc] initTextCell:to_nsstring(fields[i]->input)] autorelease];
    [cell2 setEditable:YES];
    [cell2 setCompletes:YES];
    [form putCell:cell2 atRow:i column:1];
  //  [cell2 addItemWithObjectValue:to_nsstring(fields[i]->input)];
    for(int j=0; j < N(fields[i]->proposals); j++)
    {
      [cell2 addItemWithObjectValue:to_nsstring(fields[i]->proposals[j])];
    }
  }
  
  NSRect rect0 = [form frame];
  [form sizeToFit];
  NSRect rect1 = [form frame];
  [form setFrame:rect0];
  NSRect frame = [ih->dialog frame];
  frame.size.width += rect1.size.width - rect0.size.width;
  frame.size.height += rect1.size.height - rect0.size.height;
  [ih->dialog setFrame:frame display:NO];
  
  NSModalSession session = [NSApp beginModalSessionForWindow:ih->dialog];
  NSInteger code;
  for (;;) {
    code = [NSApp runModalSession:session];
    if (code != NSRunContinuesResponse)
      break;
    //   [self doSomeWork];
  }
  [NSApp endModalSession:session];
  [ih->dialog close];

  if (code == 0) { // Ok button
    
    for(int i=0; i<N(fields); i++) {
      NSString *ans = [(NSComboBoxCell*)[form cellAtRow:i column:1] stringValue];
      fields[i]->input = scm_quote(from_nsstring(ans));
    }
  }
  else  { // Cancel button
    for(int i=0; i<N(fields); i++) {
      fields[i]->input = "#f";
    }
  }
 
  
  [ih release];
  cmd();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from aqua_widget_rep.

Definition at line 490 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";
}
- (blackbox) query (slot s
(int)  type_id 

Reimplemented from widget_rep.

Definition at line 435 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:
    return fields[0]->query(s,type_id);
    
    
  default:
    return aqua_widget_rep::query(s,type_id);
  }
}
- (widget) read (slot s
(blackbox index 

Reimplemented from widget_rep.

Definition at line 468 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 (widget_rep*)(fields[open_box<int>(index)].rep);
  default:
    return aqua_widget_rep::read(s,index);
  }
}

Here is the call graph for this function:

- (void) send (slot s
(blackbox val 

Reimplemented from widget_rep.

Definition at line 398 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;
    
    
  default:
    aqua_widget_rep::send(s,val);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from widget_rep.

Definition at line 482 of file aqua_dialogues.mm.

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

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 293 of file aqua_dialogues.mm.

- (array<aqua_field_widget>) fields [protected]

Definition at line 294 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 295 of file aqua_dialogues.mm.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

- (coord2) size [protected]

Definition at line 295 of file aqua_dialogues.mm.

- (string) win_title [protected]

Definition at line 296 of file aqua_dialogues.mm.


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