Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
TMInputHelper Class Reference

List of all members.

Public Member Functions

(IBAction) - doForm:
(id) - init [implementation]
(void) - dealloc [implementation]
(void) - delayedRun [implementation]

Public Attributes

IBOutlet NSMatrix * form
IBOutlet NSWindow * dialog
aqua_tm_widget_rep * wid

Detailed Description

Definition at line 497 of file aqua_dialogues.mm.


Member Function Documentation

- (void) dealloc [implementation]

Definition at line 558 of file aqua_dialogues.mm.

{
  [dialog release];
  [form release];
  [super dealloc];
}
- (void) delayedRun [implementation]

Definition at line 577 of file aqua_dialogues.mm.

{
  int code = [NSApp runModalForWindow: dialog];
  // Dialog is up here.
  [NSApp endSheet: dialog];
  [dialog orderOut: self];
  
  
  if (code == 0) { // Ok button
    NSString *ans = [(NSComboBoxCell*)[form cellAtRow:0 column:1] stringValue];
    ((aqua_input_text_widget_rep*)wid->int_input.rep)->text = scm_quote(from_nsstring(ans));
    ((aqua_input_text_widget_rep*)wid->int_input.rep)->cmd();
  }
  else  { // Cancel button
  }
  
  
  [self release]; // autodestroy
}

Here is the call graph for this function:

- (IBAction) doForm: (id)  sender

Definition at line 565 of file aqua_dialogues.mm.

                   :(id)sender
{
  if ([sender tag] == 0)
  {
    [NSApp stopModalWithCode:0]; // OK button
  }
  else
  {
    [NSApp stopModalWithCode:1]; // Cancel button
  }
}
- (id) init [implementation]

Definition at line 508 of file aqua_dialogues.mm.

{
  self = [super init];
  if (self != nil) {
    NSRect panelRect = NSMakeRect(0, 0, 480, 360);
    dialog = [[NSWindow alloc] initWithContentRect:panelRect
                                        styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
                                          backing:NSBackingStoreBuffered defer:YES];
    form = [[[NSMatrix alloc] initWithFrame: NSMakeRect(20, 60, 440, 280) ] autorelease];
    NSButton* cancelButton = [[[NSButton alloc] initWithFrame: NSMakeRect(274, 12, 96, 32) ] autorelease];
    NSButton* okButton = [[[NSButton alloc] initWithFrame: NSMakeRect(370, 12, 96, 32) ] autorelease];
    [cancelButton setTitle:@"Cancel"];
    [okButton setTitle:@"Ok"];

    [okButton setButtonType:   NSMomentaryPushInButton];
    [cancelButton setButtonType:   NSMomentaryPushInButton];

    [okButton setBezelStyle: NSRoundedBezelStyle];
    [cancelButton setBezelStyle: NSRoundedBezelStyle];
    
    [cancelButton setTag: 1];
    [okButton setTag: 0];
    [okButton setTarget: self];
    [okButton setAction: @selector(doForm:)];
    [cancelButton setTarget: self];
    [cancelButton setAction: @selector(doForm:)];

    [okButton setKeyEquivalent:@"\r"];
    [cancelButton setKeyEquivalent:@"\E"];
 
    [form   setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
    [okButton setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin];
    [cancelButton setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin];
    
    [[dialog contentView] addSubview: form];
    [[dialog contentView] addSubview: cancelButton];
    [[dialog contentView] addSubview: okButton];
    
    [dialog makeFirstResponder: form];
    [form setNextKeyView: cancelButton];
    [cancelButton setNextKeyView: okButton];
    [okButton setNextKeyView: form];
    
    [form retain];   

    [dialog setReleasedWhenClosed:NO];
    wid = NULL;
  }
  return self;
}

Member Data Documentation

- (IBOutlet NSWindow*) dialog

Definition at line 501 of file aqua_dialogues.mm.

- (IBOutlet NSMatrix*) form

Definition at line 500 of file aqua_dialogues.mm.

- (aqua_tm_widget_rep*) wid

Definition at line 502 of file aqua_dialogues.mm.


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