Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
source/ChooserSupport.r
/* |
ChooserSupport.r - other resources needed in order for driver to work |
with the Chooser. |
Copyright © 1992-1994 Apple Computer, Inc. |
All rights reserved. |
8/26/94 dmh Updated to 1.0.1 driver sources for SDK. |
3/22/94 dmh Updated for the b4 seed. |
12/20/93 dmh Sync'd with the shipping 1.0b3 GX driver. |
*/ |
#define SystemSevenOrLater 1 |
#include "Types.r" |
#include "SysTypes.r" |
#include "GXPrintingResTypes.r" |
//-------------------------------------------------------------------------------------------- |
// THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM |
//-------------------------------------------------------------------------------------------- |
// what type of communication does this device use (this is the default, as the actual |
// value can be found in the desktop printer). |
resource 'look' (-4096, sysheap, purgeable) { |
2, // use the second in our list by default |
{ |
"AppleTalk", -4096, isAppleTalk, "ImageWriter"; |
"Serial", -4095, iconCells, "Modem Port"; |
"Servers", -4094, isAppleTalk+isPrinterShare, "ImageWriterIIIS"; |
}; |
}; |
resource 'comm' (-4096, sysheap, purgeable) { |
PAP |
{ |
1, |
"", |
0, 0, 0, 0 |
}; |
}; |
resource 'comm' (-4095, sysheap, purgeable) { |
Serial |
{ |
baud9600, /* Output baud rate */ |
noParity, /* Output parity */ |
twoStop, /* Output stop bits */ |
data8, /* Output data size */ |
0xFFFF1113, /* Output handshaking */ |
0x00000000, |
baud9600, /* Input baud rate */ |
noParity, /* Input parity */ |
twoStop, /* Input stop bits */ |
data8, /* Input data bits */ |
0xFFFF1113, /* Input handshaking */ |
0x00000000, |
1024, /* Input buffer size */ |
".AIn", /* Input driver name */ |
".AOut" /* Output driver name */ |
}; |
}; |
resource 'comm' (-4094, sysheap, purgeable) { |
PrinterShare |
{ |
"", |
0 |
}; |
}; |
//-------------------------------------------------------------------------------------------- |
// STANDARD CHOOSER PACK STUFF |
//-------------------------------------------------------------------------------------------- |
// NBP Lookup type (maxed out so resource file won't need updating) |
resource 'STR ' (-4096, sysheap, purgeable) |
{ |
"XXXXXXXXXXXXXXXXXXXXXX"; |
}; |
// NBP timeout value |
type 'GNRL' |
{ |
byte; // timeout |
byte; // retries |
}; |
resource 'GNRL' (-4096, sysheap, purgeable) |
{ |
11, |
5 |
}; |
// title string (we'll put a control here, so we don't want a title) |
resource 'STR ' (-4091, sysheap, purgeable) |
{ |
""; |
}; |
// "left" button title |
resource 'STR ' (-4093, sysheap, purgeable) |
{ |
"Create"; |
}; |
// rectangle list |
resource 'nrct' (-4096, sysheap, purgeable) { |
{ |
{112, 251, 132, 311}; // left button |
{0,0,0,0}; // right button |
{-101, 180, -101+20, 400}; // on button (location of device list - popup is placed here) |
{0,0,0,0}; // off button |
{0,0,0,0}; // button label |
}; |
}; |
// Menu used to select between direct connect, AppleTalk, and Servers |
resource 'MENU' (-4096, sysheap, purgeable) |
{ |
-4096, |
textMenuProc, |
0xFFFFFFFF, |
enabled, |
"", |
{ |
} |
}; |
// Pop-up control used to select between direct connect printers and those being shared on the network |
resource 'CNTL' (-4096, sysheap, purgeable) |
{ |
{0, 0, 20, 213}, // zero based control location |
0, // Title options 0 = Left justified |
visible, // Should we display the control? |
95, // Title Width |
-4096, // 'MENU' to display |
popupMenuCDEFproc+popupFixedWidth, // CDEF = CDEFID * 16 + varCode |
0, // refCon = ResType to append = None |
"Connect via:" // Control title |
}; |
resource 'DITL' (-4096, sysheap, purgeable) |
{ |
{ |
{3, 238, 23, 238 + 213}, |
Control {enabled, -4096}, |
}; |
}; |
resource 'DITL' (-4095, sysheap, purgeable) { |
{ /* array DITLarray: 2 elements */ |
/* [1] */ |
{143, 310, 163, 368}, |
Button { |
enabled, |
"OK" |
}, |
/* [2] */ |
{23, 87, 119, 377}, |
StaticText { |
disabled, |
"This printer driver could not be used.\n\n" |
"Quitting one or more applications and then " |
"trying again may allow you to use this " |
"printer driver." |
} |
} |
}; |
resource 'ALRT' (-4095, sysheap, purgeable) { |
{30, 30, 30+175, 30+380}, |
-4095, |
{ /* array: 4 elements */ |
/* [1] */ |
OK, visible, sound1, |
/* [2] */ |
OK, visible, sound1, |
/* [3] */ |
OK, visible, sound1, |
/* [4] */ |
OK, visible, sound1 |
}, |
alertPositionParentWindowScreen |
}; |
//----------------------------------------------------------------------------------- |
// CHOOSER PACK HELP RESOURCES |
//----------------------------------------------------------------------------------- |
/* Any Chooser package can get balloons on all items that are normally |
added to the Chooser dialog by containing a STR# resource of |
resource ID = PackResID (-5694) and following the convention below: |
resource 'STR#' (-5694, sysheap, purgeable) { |
{ "kEnabledLeftButton"; // message for button (or control) that is Enabled but not checked |
"kDisabledLeftButton"; // message for the control that is Disabled |
"kCheckedLeftButton"; // message for the control that is Checked (ie CtrlValue>0) |
"kOtherLeftButton"; // message for the control that is Other (ie CtrlValue>1) |
"kEnabledRightButton"; |
"kDisabledRightButton"; |
"kCheckedRightButton"; |
"kOtherRightButton"; |
"kEnabledOnButton"; |
"kDisabledOnButton"; |
"kCheckedOnButton"; |
"kOtherOnButton"; |
"kEnabledOffButton"; |
"kDisabledOffButton"; |
"kCheckedOffButton"; |
"kOtherOffButton"; |
"kEnabledOnOffTitle"; |
"kDisabledOnOffTitle"; |
"kCheckedOnOffTitle"; |
"kOtherOnOffTitle"; |
} |
}; |
This is a horrible Chooser hack for 7.0 - but we'll follow along in GX. |
*/ |
resource 'STR#' (-5694, sysheap, purgeable) { |
{ |
"Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked |
"You have not selected a device to create, or there is not enough memory to create a desktop printer at this time."; // message for the control that is Disabled |
""; // message for the control that is Checked (ie CtrlValue>0) |
""; // message for the control that is Other (ie CtrlValue>1) |
""; // kEnabledRightButton |
""; // kDisabledRightButton |
""; // kCheckedRightButton |
""; // kOtherRightButton |
"Use this popÐup menu to select the type of connection for the desktop printer you are creating."; |
""; // kDisabledOnButton |
""; // kCheckedOnButton |
""; // kOtherOnButton |
""; // kEnabledOffButton |
""; // kDisabledOffButton |
""; // kCheckedOffButton |
""; // kOtherOffButton |
""; // kEnabledOnOffTitle |
""; // kDisabledOnOffTitle |
""; // kCheckedOnOffTitle |
""; // kOtherOnOffTitle |
} |
}; |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14