Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
CHOptionSelector Class Reference
Collaboration diagram for CHOptionSelector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id- initWithSelect:
(IBAction) - selectOption:

Protected Attributes

nsIDOMHTMLSelectElementmSelectElt

Detailed Description

Definition at line 62 of file CHClickListener.mm.


Member Function Documentation

Definition at line 74 of file CHClickListener.mm.

                   :(nsIDOMHTMLSelectElement*)aSel
{
  if ( (self = [super init]) ) {
    mSelectElt = aSel;
  }
  return self;
}

Here is the call graph for this function:

- (IBAction) selectOption: (id aSender

Definition at line 82 of file CHClickListener.mm.

                       :(id)aSender
{
  nsIDOMHTMLOptionElement* optionElt = (nsIDOMHTMLOptionElement*) [aSender tag];
  optionElt->SetSelected(PR_TRUE);
  [self autorelease]; // Free up ourselves.
  [[aSender menu] autorelease]; // Free up the menu.

  // Fire a DOM event for the title change.
  nsCOMPtr<nsIDOMEvent> event;
  nsCOMPtr<nsIDOMDocument> domDocument;
  mSelectElt->GetOwnerDocument(getter_AddRefs(domDocument));
  nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(domDocument));
  
  docEvent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
  if (event) {
    event->InitEvent(NS_LITERAL_STRING("change"), PR_TRUE, PR_TRUE);
    nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mSelectElt));
    PRBool defaultActionEnabled;
    target->DispatchEvent(event, &defaultActionEnabled);
  }  
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 64 of file CHClickListener.mm.


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