Back to index

lightning-sunbird  0.9+nobinonly
Functions
CheckboxLDEF.c File Reference
#include "CheckboxLDEF.h"
#include <ToolUtils.h>
#include <Lists.h>
#include <LowMem.h>
#include <TextUtils.h>

Go to the source code of this file.

Functions

pascal void main (SInt16 message, Boolean selected, Rect *cellRect, Cell theCell, SInt16 dataOffset, SInt16 dataLen, ListHandle theList)
void Draw (Boolean selected, Rect *cellRect, Cell theCell, SInt16 dataLen, ListHandle theList)
void Highlight (Rect *cellRect, Boolean selected)
Rect DrawEmptyCheckbox (Rect *cellRect)
void DrawCheckedCheckbox (Rect *cellRect)

Function Documentation

void Draw ( Boolean  selected,
Rect *  cellRect,
Cell  theCell,
SInt16  dataLen,
ListHandle  theList 
)

Definition at line 63 of file CheckboxLDEF.c.

{
       Ptr                  componentName;
       Rect          nameRect;
       GrafPtr              oldPort;
       
       GetPort(&oldPort);
       
       componentName = NewPtrClear(255);
       LGetCell(componentName, &dataLen, theCell, theList);
       
       if (dataLen > 0 && componentName)
       {
              Highlight(cellRect, selected);
              SetRect(&nameRect, cellRect->left+20, cellRect->top,
                                                 cellRect->right, cellRect->bottom);
              TETextBox((char*)componentName, dataLen, &nameRect, teFlushDefault);
       }
       
       if (componentName)
              DisposePtr(componentName);
              
       SetPort(oldPort);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawCheckedCheckbox ( Rect *  cellRect)

Definition at line 112 of file CheckboxLDEF.c.

{
       Rect          checkbox = DrawEmptyCheckbox(cellRect);
       
       /* now fill in check mark */
       
       MoveTo(checkbox.left+1, checkbox.top+1);
       LineTo(checkbox.right-2, checkbox.bottom-2);
       MoveTo(checkbox.right-2, checkbox.top+1);
       LineTo(checkbox.left+1, checkbox.bottom-2); 

}

Here is the call graph for this function:

Here is the caller graph for this function:

Rect DrawEmptyCheckbox ( Rect *  cellRect)

Definition at line 99 of file CheckboxLDEF.c.

{
       Rect checkbox;
       
       SetRect(&checkbox, cellRect->left+4, cellRect->top+2, 
                                          cellRect->left+16, cellRect->top+14);
       EraseRect(&checkbox);
       FrameRect(&checkbox);
       
       return checkbox;
}

Here is the caller graph for this function:

void Highlight ( Rect *  cellRect,
Boolean  selected 
)

Definition at line 90 of file CheckboxLDEF.c.

{
       if (selected)
              DrawCheckedCheckbox(cellRect);
       else
              DrawEmptyCheckbox(cellRect);
}

Here is the call graph for this function:

Here is the caller graph for this function:

pascal void main ( SInt16  message,
Boolean  selected,
Rect *  cellRect,
Cell  theCell,
SInt16  dataOffset,
SInt16  dataLen,
ListHandle  theList 
)

Definition at line 47 of file CheckboxLDEF.c.

{
       switch(message)
       {
              case lDrawMsg:
                     Draw(selected,cellRect,theCell,dataLen,theList);
                     break;
                     
              case lHiliteMsg:
                     Highlight(cellRect, selected);
                     break;
       }
}

Here is the call graph for this function: