1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* The contents of this file are subject to the Netscape Public License
3
* Version 1.1 (the "License"); you may not use this file except in
4
* compliance with the License. You may obtain a copy of the License at
5
* http://www.mozilla.org/NPL/
7
* Software distributed under the License is distributed on an "AS IS" basis,
8
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
9
* for the specific language governing rights and limitations under the
12
* The Original Code is Mozilla Communicator client code, released March
15
* The Initial Developer of the Original Code is Netscape Communications
16
* Corporation. Portions created by Netscape are Copyright (C) 1999
17
* Netscape Communications Corporation. All Rights Reserved.
20
* Samir Gehani <sgehani@netscape.com>
23
#include "CheckboxLDEF.h"
24
#include <ToolUtils.h>
27
#include <TextUtils.h>
30
main(SInt16 message,Boolean selected,Rect *cellRect,Cell theCell,
31
SInt16 dataOffset,SInt16 dataLen,ListHandle theList)
36
Draw(selected,cellRect,theCell,dataLen,theList);
40
Highlight(cellRect, selected);
46
Draw(Boolean selected,Rect *cellRect,Cell theCell,SInt16 dataLen,
55
componentName = NewPtrClear(255);
56
LGetCell(componentName, &dataLen, theCell, theList);
58
if (dataLen > 0 && componentName)
60
Highlight(cellRect, selected);
61
SetRect(&nameRect, cellRect->left+20, cellRect->top,
62
cellRect->right, cellRect->bottom);
63
TETextBox((char*)componentName, dataLen, &nameRect, teFlushDefault);
67
DisposePtr(componentName);
73
Highlight(Rect *cellRect, Boolean selected)
76
DrawCheckedCheckbox(cellRect);
78
DrawEmptyCheckbox(cellRect);
82
DrawEmptyCheckbox(Rect *cellRect)
86
SetRect(&checkbox, cellRect->left+4, cellRect->top+2,
87
cellRect->left+16, cellRect->top+14);
95
DrawCheckedCheckbox(Rect *cellRect)
97
Rect checkbox = DrawEmptyCheckbox(cellRect);
99
/* now fill in check mark */
101
MoveTo(checkbox.left+1, checkbox.top+1);
102
LineTo(checkbox.right-2, checkbox.bottom-2);
103
MoveTo(checkbox.right-2, checkbox.top+1);
104
LineTo(checkbox.left+1, checkbox.bottom-2);