MiscKit/ 40755 1750 1750 0 6757716345 12343 5ustar sunshinesunshineMiscKit/Palettes/ 40755 1750 1750 0 6757716107 14120 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/ 40755 1750 1750 0 6757720204 17133 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/English.lproj/ 40755 1750 1750 0 6757716174 21664 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableConnInspector.nib/ 40755 1750 1750 0 6135522334 26762 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableConnInspector.nib/data.classes100444 1750 1750 361 6757716174 31346 0ustar sunshinesunshineFirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscTableScroll = {SUPERCLASS = ScrollView; }; MiscTableConnInspector = { OUTLETS = {actionScroll = actionScroll; outletScroll = outletScroll; }; SUPERCLASS = IBInspector; }; MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableConnInspector.nib/data.nib100444 1750 1750 1102 6757716174 30473 0ustar sunshinesunshine typedstream¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„MiscTableConnInspector…†„@@„„„WindowTemplate”„ffffû‡ l„ iiii***@s@‚ï„„ Inspector„„View„„Panel„„ž„„ Responder”’…„f› l› l’…’…„@ss@„„„List”„i„[2@]„„„ CustomViewž’¡›…m›…m’’…¢…@…—„„MiscTableScroll…†„£’¡›‡…m›…m’’…¢…@…—„§…††@…†@x…„c¨†•™¢™˜™¥¤„@*˜„„Inspector Window©•„„ File's Owner¤’„¡¤„[4@]„„„IBOutletConnector„„ IBConnector”„@@*•˜„„window†„«¯˜•„„delegate†„«¯•¥„„ actionScroll†„«¯•¢„„ outletScroll††’…†MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScroll.nib/ 40755 1750 1750 0 6110254335 25430 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScroll.nib/data.classes100444 1750 1750 517 6757716175 30024 0ustar sunshinesunshineMiscTableScrollPalette = {OUTLETS = {tableScroll = tableScroll; }; SUPERCLASS = IBPalette; }; FirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscTableScroll = { OUTLETS = { dataDelegate = dataDelegate; delegate = delegate; doubleTarget = doubleTarget; nextText = nextText; }; SUPERCLASS = ScrollView; }; MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScroll.nib/data.nib100444 1750 1750 765 6757716175 27144 0ustar sunshinesunshine typedstream¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„MiscTableScrollPalette…†„@@„„„View„„ Responder”’…„f„ffff ž ž’…’…„@ss@„„„List”„i„[1@]„„„ CustomView™’˜œ îî’˜’…ž…H…—„„MiscTableScroll…††@…†„„„WindowTemplate”Rt ž„ iiii***@s@‚ï„„ Palette View„š„„Panel˜`x…„c¨†™˜™ • „@*•„„ File's Owner© „„Palette Window ’„œ „[2@]„„„IBOutletConnector„„ IBConnector”„@@*• „„originalWindow†„©¯•„„ tableScroll††’…†MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/ 40755 1750 1750 0 6757716176 27346 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/GoDown.tiff100444 1750 1750 3016 6735516233 31474 0ustar sunshinesunshineII*øU_"/2?#?2?#/2?"/"?ÿÿ2O#?3O#?2O#?2?#?ÿÿ3?2O3?2O3?2O#?2?ÿÿ3O#O3O4O3O#?3O#?ÿÿ3?CO3O3O3O3O3?3Oÿÿ3_4_D_4O3_4O3O3Oÿÿ4OC_4OC_4OC_4OCOÿÿD_4_Do4_D_4_4_4OÿÿE_DoD_DoD_D_D_C_ÿÿDoEoDoEoDoE_D_4_3_U_4ODoEoToEoToEoToEoDoD_C_4O3O3?2?ÿÿE_EEoUEoUEoEoE_Do4_D_4O3OÿÿUoUVoUUoUEoToD_D_4OCOÿÿFUVUEoUEoDo4_D_ÿÿVUVUEoToD_C_ÿÿVUFUEoDoÿÿUUEoDoÿÿEoDoÿÿÿÿ šð¢ª(R@€ü '€ü '€ P8$ €J¥xL. B¢”>-‡F"p¢¤"UŒÈ ¥ÈV@pd ÔG Ê `Yd À@€ P!ü AAï÷ü$ †Â¡è„R'ˆÃâñ¨ÌV1 ˆ?ãø„0~†?ßYK ?†0#ðYCò¼&ãö܃à îUöþ(R²ôBL€ü '€ü 'MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/GoUp.tiff100444 1750 1750 3022 6735516233 31146 0ustar sunshinesunshineII*øÿÿ#?"?ÿÿ#?2?#?2?ÿÿ#?3O#?3O#?3Oÿÿ3?3O3?3O3?3O3?2Oÿÿ4O3O4O3_4O3O#O3O#O3Oÿÿ3O3O4OC_4OC_4OCO3O3O3?2?ÿÿ4O3_4OD_4_D_4_C_4_3_4O3O#O3Oÿÿ3OC_4OC_D_D_D_D_D_C_4OC_3O3O#?2?ÿÿU_ÿÿÿÿÿÿ5_DoE_DoE_Do4_D_4_ÿÿÿÿÿÿÿÿÿÿE_ToE_DoE_D_D_C_ÿÿUEoUoEoDoEoDo4_ÿÿUoUEoToEoDoD_C_ÿÿUFUEoUoEoDo4_ÿÿVUUUEoToD_D_ÿÿVVUEUEoDo4_ÿÿVeVUEoDoD_C_ÿÿfVUFoEoE_Do4_ÿÿVUUoUoE_DoD_C_ÿÿU_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ šð¢ª(RD€ü '€ü '€ P8$° S„ª\€J¥xªU…±xh/D¢ñ@;Æ&ÿD¢’˜œF[,•Èeó)Œª]5™ßòˆ,ö€ P!ü ÁÀö.ÿxC€o÷ä8ÿÇñ†1ÄãÁü^?%yÉÀh´b[‚Ë&2éœÂW4›Í¦S˜t >€€òUú (R²úHJ€ü '€ü 'MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/data.classes100444 1750 1750 3776 6757716175 31745 0ustar sunshinesunshineFirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscTableScroll = {SUPERCLASS = ScrollView; }; MiscTableScrollInspector = { ACTIONS = { "doAlign:" = "doAlign:"; "doAutoSort:" = "doAutoSort:"; "doAutosize:" = "doAutosize:"; "doBorder:" = "doBorder:"; "doCellClass:" = "doCellClass:"; "doColorBack:" = "doColorBack:"; "doColorBackHighlighted:" = "doColorBackHighlighted:"; "doColorText:" = "doColorText:"; "doColorTextHighlighted:" = "doColorTextHighlighted:"; "doDelete:" = "doDelete:"; "doDown:" = "doDown:"; "doDraggable:" = "doDraggable:"; "doEnabled:" = "doEnabled:"; "doLazy:" = "doLazy:"; "doMode:" = "doMode:"; "doNew:" = "doNew:"; "doSizable:" = "doSizable:"; "doSizing:" = "doSizing:"; "doSlot:" = "doSlot:"; "doSortDirection:" = "doSortDirection:"; "doSortType:" = "doSortType:"; "doTitleMode:" = "doTitleMode:"; "doTitles:" = "doTitles:"; "doUp:" = "doUp:"; "doUserSizeable:" = "doUserSizeable:"; }; OUTLETS = { alignMatrix = alignMatrix; alignTitle = alignTitle; autoSortSwitch = autoSortSwitch; autosizeSwitch = autosizeSwitch; borderPopUp = borderPopUp; cellClassPopUp = cellClassPopUp; colorBack = colorBack; colorBackHighlight = colorBackHighlight; colorText = colorText; colorTextHighlight = colorTextHighlight; deleteButton = deleteButton; downButton = downButton; draggableSwitch = draggableSwitch; enabledSwitch = enabledSwitch; lazySwitch = lazySwitch; modePopUp = modePopUp; sampleTextHighlight = sampleTextHighlight; sampleTextNormal = sampleTextNormal; sizableSwitch = sizableSwitch; sizeField = sizeField; sizeMaxField = sizeMaxField; sizeMinField = sizeMinField; slotScroll = slotScroll; sortDirectionPopUp = sortDirectionPopUp; sortTypePopUp = sortTypePopUp; titleField = titleField; titleModePopUp = titleModePopUp; titlesSwitch = titlesSwitch; uniformSizeField = uniformSizeField; upButton = upButton; userSizeableSwitch = userSizeableSwitch; }; SUPERCLASS = IBInspector; }; MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/data.nib100444 1750 1750 16445 6757716175 31075 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„MiscTableScrollInspector…†T„@@„„„Button„„Control„„View„„ Responder”’„›’…„f„ffff mŸ m’…’…„@ss@„„„List”„i&„[38@]„™’žŸj(EŸE’’… …ˆ…„i@s„„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„Titles„„„Font”„%fss„ Helvetica €††’…„i:…„ssȨ……<È™„„„NXImage”„s*p„„NXswitch†„©°p„„ NXswitchH††Ð†„™’žŸjEŸE’’… …ˆ…¤„¢¨„„Sizable¦†’…­…®È¨……<È™¨«†Ð†„™’žŸ±(WŸW’’… …ˆ…¤„¢¨„„ Draggable¦†’…­…®È¨……<È™¨«†Ð†„™’žŸ›WhŸh’’… …‰…¤„¢¨„¡¦@’„„„ MenuTemplate”’…„ff'„*@*@ccc„„ OtherViews„„„Matrixš’…žŸh<Ÿh<’…’… …@…¤…È’…’…’…’…„@:@iiii„Ÿ¢„[3@]„„„MenuCell¢¨„¡¦’…­…®È¨……©„@f¦’…„:…†„½¨„„Radio¦’…­…®È¨……©½¦’…¾…†„½¨„„ Highlight¦’…­…®È¨……©½¦’…¾…††……ÿÿ¶h¶„ff@@#::sÿÿ……½……„c†„„ PopUpList³†­„popUp:®È¨……¨™„©°p„„NXpopup†…†Ð†„™’žŸXMŸM’’… …ˆ…¤„¢¨„„Enabled¦†’…­…®È¨……<È™¨«†Ð†„„„ TextFieldš’žŸ$zߟߒ’… … …¤„„„ TextFieldCell£¨„„¦8–’…­…¶Â†À’…’…’…¾…†„Ê’žŸ}!Ÿ!’’… … …¤„̨„„Title¦€’…­…¶ÿÂ†В…’…’…¾…†„™’žŸLaŸa’’… …‰…¤„¢¨„„Text¦@’„·’…¶'·„¸„º’…žŸaPŸaP’…’… …@…¤…È’…’…’…’…º„Ÿ¢„[4@]„½¨„˦’…­…®È¨……©½¦’…¾…†„½¨„„Icon¦’…­…®È¨……©½¦’…¾…†„½¨„𦒅­…®È¨……©½¦’…¾…†„½¨„„ Call-Back¦’…­…®È¨……©½¦’…¾…††……ÿÿ¶a¶Áÿÿ……½……†„Ãц­Ä®È¨……¨™Ä…†Ð†„Ê’žŸ¬4VŸV’’… … …¤„̨„„80¦8–’…­…¶Â†À’…’…’…¾…†„Ê’žŸ‡#Ÿ#’’… … …¤„̨„„Min¦€’…­…¶ÿ†À’…’…’…¾…†„Ê’žŸ¬VŸV’’… … …¤„̨„„10¦8–’…­…¶Â†À’…’…’…¾…†„Ê’žŸ‡#Ÿ#’’… … …¤„̨„„Max¦€’…­…¶ÿ†À’…’…’…¾…†„Ê’žŸ¬VŸV’’… … …¤„̨„„ 1234567890¦8–’…­…¶Â†À’…’…’…¾…†„Ê’žŸ‡7#Ÿ#’’… … …¤„̨„„Size¦€’…­…¶ÿ†À’…’…’…¾…†„™’žŸÂ’BŸB’’… …‰…¤„¢¨„„Delete¦’…­…®È¨……†½¦†À†„™’žŸÂªBŸB’’… …‰…¤„¢¨„„New¦’…­…®È¨……†½¦†À†„™’žŸÂÝBŸB’’… …‰…¤„¢¨„ɦ’…­…®È¨……ȇ™„©°b@„„GoUp†…†Ð†„™’žŸÂÂBŸB’’… …‰…¤„¢¨„ɦ’…­…®È¨……ȇ™„©°b@„„GoDown†…†Ð†„™’žŸZX9Ÿ9’’… …ˆ…¤„¢¨„„Lazy¦’…­…®È¨……8È™¨«†Ð†„™’žŸcŸc’’… …ˆ…¤„¢¨„„ User-Sizable¦’…­…®È¨……8È™¨«†À†˜„™’žŸ`Ÿ`’’… …‰…¤„¢¨„„Columns¦@’„·’…¶'·„¸„º’…žŸ`(Ÿ`(’…’… …@…¤…È’…’…’…’…º„Ÿ¢„[2@]„½¨„Û¦’…­…®È¨……©½¦’…¾…†„½¨„„Rows¦’…­…®È¨……©½¦’…¾…††……ÿÿ¶`¶Áÿÿ……½……†„à †­Ä®È¨……¨™Ä…†Ð†„™’žŸ+ý`Ÿ`’’… …‰…¤„¢¨„„String¦@’„·’…¶'·„¸„º’…žŸYdŸYd’…’… …@…¤…È’…’…’…’…º„Ÿ¢„[5@]„½¨„„Blank¦’…­…®È¨……©½¦’…¾…†„½¨„„ 1, 2, 3, ...¦’…­…®È¨……©½¦’…¾…†„½¨„„ A, B, C, ...¦’…­…®È¨……©½¦’…¾…†„½¨„Þ¦’…­…®È¨……©½¦’…¾…†„½¨„„Delegate¦’…­…®È¨……©½¦’…¾…††……ÿÿ¶Y¶Áÿÿ……½……†„ƭĮȨ……¨™Ä…†Ð†„Ê’žŸ&Ÿ&’’… … …¤„̨„©¦€’…­…¶ÿ†À’…’…’…¾…†„Ê’žŸäüŸ’’… … …¤„̨„„0¦8–’…­…¶Â†À’…’…’…¾…†„Ê’žŸÿTŸT’’… … …¤„̨„„ Uniform Size¦€’…­…¶ÿ†À’…’…’…¾…†„™’žŸ±WŸW’’… …ˆ…¤„¢¨„„AutoSort¦†’…­…®È¨……<È™¨«†Ð†„™’žŸLuŸu’’… …‰…¤„¢¨„„ Ascending¦@’„·’…¶'·„¸„º’…žŸa(Ÿa(’…’… …@…¤…È’…’…’…’…º„Ÿ¢Ü„½¨„禒…­…®È¨……©½¦’…¾…†„½¨„„ Descending¦’…­…®È¨……©½¦’…¾…††……ÿÿ¶a¶Áÿÿ……½……†„Ã3†­Ä®È¨……¨™Ä…†Ð†„™’žŸcþŸþ’’… …‰…¤„¢¨„„string case insensitive¦@’„·’…¶'·„¸„º’…žŸ›Ÿ›’…’… ……¤…È’…’…’…’…º„Ÿ¢ „[13@]„½¨„馒…­…®È¨……¨™Ä„©°p„„NXpopupH†’…¾…†„½¨„„string case sensitive¦’…­…®È¨……©½¦’…¾…†„½¨„„int¦’…­…®È¨……©½¦’…¾…†„½¨„„ unsigned int¦’…­…®È¨……©½¦’…¾…†„½¨„„tag¦’…­…®È¨……©½¦’…¾…†„½¨„„ unsigned tag¦’…­…®È¨……©½¦’…¾…†„½¨„„float¦’…­…®È¨……©½¦’…¾…†„½¨„„double¦’…­…®È¨……©½¦’…¾…†„½¨„„skip¦’…­…®È¨……©½¦’…¾…†„½¨„„title case insensitive¦’…­ …®È¨……©½¦’…¾…†„½¨„„title case sensitive¦’…­ …®È¨……©½¦’…¾…†„½¨„„state¦’…­ …®È¨……©½¦’…¾…†„½¨„„unsigned state¦’…­ …®È¨……©½¦’…¾…††……ÿÿ ¶›¶Áÿÿ……½……†„Ã?†­Ä®È¨……¨™Ä…†Ð†„„„ NXColorWellš’žŸ=Ÿ’’… ……¤…ÐÂÁ„s„cc†„d’žŸ#=Ÿ’’… ……¤…ÐÂÁù¬ªú†„Ê’žŸA?<Ÿ<’’… … …¤„̨„„Normal¦@’…­…¶ÿ†À’…’…’…¾…†„d’žŸ…=Ÿ’’… ……¤…ÐÂÁùú†„d’žŸ£=Ÿ’’… ……¤…ÐÂÁùþú†„Ê’žŸÀ?CŸC’’… … …¤„̨„„Selected¦@’…­…¶Â†À’…’…’…¾…†„º’žŸ46Ÿ6’’… ……¤…À’…’…’…’…º„Ÿ¢»„¢¨„ɦ‹’…­…®È¨……Ä6™„©°b@„„ MiscAlignLeft†…†„¢¨„ɦ ’…­…®È¨……À6™„©°b@„„MiscAlignCenter†…†„¢¨„ɦ ’…­…®È¨……À6™„©°b@„„MiscAlignRight†…††…p¶¶Áÿÿ…„¢¨„ɦ ’…­…®È¨……À6™r…†£……B†„Ê’žŸ=6>Ÿ>’’… … …¤„̨„„ Alignment¦’…­…¶ÿ†À’…’…’…¾…†„„„ CustomView›’žŸ’¹fŸ¹f’’… ……—„„MiscTableScroll…††…†žŸ cŸc’’… …ˆ…¤„¢¨„„ Auto-Size¦’…­…®È¨……8È™¨«†À†™3™n™„„„WindowTemplate”Ÿl  m„ iiii***@s@‚ï„„ Inspector„œ„„Panelx@…Ÿ¼†•™ÞÖ™¶³™ZD™ÔÑ™³™ð™ ™f™ÖÔ™~™á™'™pn™86™þ™É™ä™¼¹™k™ND™j™™^D™RD™<8™xn™ç™"™tn™™™TD™ ™¿¹™?™ù™c™­™e™0™ê™Á¹™63™™B?™$™VD™ó™í™DB™`D™\D™ØÖ™*™™†™JD™ö™Î™¹¶™Æ™ ™-™™PD™:8™ÚÖ™ ™i™ÜÖ™™XD™™FD™™Ñ™™°™ ™LD¢„@*•„„ File's OwnerB„à ŒÔŒ¶Œ6ŒŒ†„„Inspector Window¢’„Ÿ¢[„[91@]„„„IBOutletConnector„„ IBConnector”„@@*•†„„window†„†•„„delegate†„Éá„„nextText†„áç–†„çí–†„•Ñ„„cellClassPopUp†„•ó„„ deleteButton†„•þ„„ downButton†„•°„„draggableSwitch†„•Æ„„ enabledSwitch†„•³„„ modePopUp†„•­„„ sizableSwitch†„•á„„ sizeField†„•í„„ sizeMaxField†„•ç„„ sizeMinField†„•É„„ titleField†„• „„ titlesSwitch†„•ù„„upButton†„„„IBControlConnector‘ •„„ doTitles:†„´°•„„ doDraggable:†„´¼•„„doMode:†„´¿•¹†„´Á•¹†„´ù•„„doUp:†„´þ•„„doDown:†„´ö•„„doNew:†„´ó•„„ doDelete:†„É•„„ textDelegate†„´Ø•„„ doCellClass:†„´ڕdž„´ܕdž„´ޕdž„á•ņ„ç•ņ„í•ņ„´Æ•„„ doEnabled:†„´­•„„ doSizable:†„•„„ lazySwitch†„´•„„doLazy:†„•„„userSizeableSwitch†„´•„„doUserSizeable:†„*É–†„*•ņ„• „„ borderPopUp†„•„„titleModePopUp†„•*„„uniformSizeField†„´•„„ doBorder:†„´•ㆄ´•„„ doTitleMode:†„´•憄´ •憄´"•憄´$•憄•0„„autoSortSwitch†„•3„„sortDirectionPopUp†„•?„„ sortTypePopUp†„´F•„„ doSortType:†„´J•ò†„´L•ò†„´N•ò†„´P•ò†„´R•ò†„´T•ò†„´V•ò†„´X•ò†„´:•„„doSortDirection:†„´<•ü†„´0•„„ doAutoSort:†„•c„„ colorText†„•e„„ colorBack†„•i„„colorTextHighlight†„•j„„colorBackHighlight†„´c•„„ doColorText:†„´e•„„ doColorBack:†„´i•„„doColorTextHighlighted:†„´j•„„doColorBackHighlighted:†„´Z•ò†„´\•ò†„´^•ò†„´`•ò†„í*–†„•˜„„autosizeSwitch†„´˜•„„ doAutosize:†„´p•„„doAlign:†„´t•†„´x•†„•n„„ alignMatrix†„•~„„ alignTitle†„•„„ slotScroll†„•f„„sampleTextNormal†„•k„„sampleTextHighlight††’…†MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/MiscAlignLeft.tiff100444 1750 1750 352 6735516233 32740 0ustar sunshinesunshineII*Dªªª«ªªª«ªªª«ªªª«ª¢ª«ª‚ª«ªª«¨+ªª«ª‚ª«ª¢ª«ªªª«ªªª«ªªª«ªªª« <Úâ(€ü '€ü 'MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/MiscAlignRight.tiff100444 1750 1750 352 6735516233 33123 0ustar sunshinesunshineII*Dªªª«ªªª«ªªª«ªªª«ªª*«ªª «ªª« «ªª«ªª «ªª*«ªªª«ªªª«ªªª«ªªª« <Úâ(€ü '€ü 'MiscKit/Palettes/MiscTableScroll/English.lproj/MiscTableScrollInspector.nib/MiscAlignCenter.tiff100444 1750 1750 352 6735516233 33266 0ustar sunshinesunshineII*Dªªª«ªªª«ªªª«ªªª«¨ª¨«¨* «¨ €«¨ €«¨* «¨ª¨«ªªª«ªªª«ªªª«ªªª« <Úâ(€ü '€ü 'MiscKit/Palettes/MiscTableScroll/MiscAssert.h100444 1750 1750 2441 6757716145 21466 0ustar sunshinesunshine#ifndef __MiscAssert_h #define __MiscAssert_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: MiscAssert.h,v 1.1 97/06/10 05:21:21 sunshine Exp $ // $Log: MiscAssert.h,v $ // Revision 1.1 97/06/10 05:21:21 sunshine // v127: Assertion facility which raises exception rather than calling abort() // //----------------------------------------------------------------------------- extern void MiscTableScrollAssert( char const*, char const*, int ); #define MiscAssert(expr) \ ((void)((expr) ? 0 : MiscTableScrollAssert( #expr, __FILE__, __LINE__ ))) #endif // __MiscAssert_h MiscKit/Palettes/MiscTableScroll/BUGS.txt100444 1750 1750 13112 6757716170 20554 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll BUGS // $Id: BUGS.txt,v 1.50 99/06/29 07:12:08 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - MiscTableScroll's -sizeToFit does not correctly compute sizes for larger or non-standard fonts (probably fonts and sizes which do not have bitmap representations). The size that it computes is usually too short and sometimes too narrow. When it is too narrow, characters get clipped from the right edge of the text. When it is too short the line isn't drawn at all on account of the fact that, by default, TableScroll does not draw partial lines. This is a particularly serious problem. It affects both the NextStep and OpenStep TableScrolls, though the OpenStep version is even more seriously affected since the size returned by -[NSCell cellSize] has even less tolerance than that returned by NextStep's -[Cell calcCellSize:]. This problem essentially makes -sizeToFit a complete washout in any application where the user has control over the font. - When cell editing is in progress in an autosized column, if the window is resized then the column may change size along with it, but the field editor remains at the old size. We forgot to handle this case even though we correctly handle the case where the column is resized manually by the user during editing. - While editing is in progress, if you drag the column being edited, the behavior is inconsistent: 1) If the column was entirely on-screen when the dragging commenced, then the column which you drag around displays the "new" value. 2) If the column was only partially visible when dragging commenced, then the column which you drag around displays the "old" value. This is a consequence of the dragging code which grabs the on-screen image if the column was wholly visible, else draws the slot into the drag cache if it wasn't wholly visible. I (Eric) am not sure as to the correct way to fix this problem. It would be nicest if the "new" value was displayed in the dragged column, however the architecture of TableScroll makes this pretty difficult to achieve. It is also worth noting that the OPENSTEP version has this problem (dragging the "old" value around) in both cases (at least in eager mode). - Text on row titles is still getting clipped when dragged if the row wasn't entirely visible when dragging was initiated. - Incorrect coordinate transformations draw_view() in MiscTableView is *not* transforming the PostScript graphics state. It is doing the appropriate transformation calculations, but never actually applies them to the gstate. Eric took a different approach to drawing a slot for the drag-cache than Pawl's draw_view(). Eric tried using -copyPSCodeInside:to: to create the drag cache. It automatically includes all the subviews (good) and doesn't have the problem with row title-cell text being clipped which draw_view() has (good). However, it thinks it is creating PostScript code for a printer, so it uses printer fonts instead of screen fonts (bad), and it doesn't draw images with alpha (transparency) because it thinks it's going to a printer (bad). - Problems with dragging columns zarnuk says: Dropping a column in the same location that it was dragged out of causes the column to be re-drawn, but does not draw the subviews. - Auto-scrolling broken. Eric broke auto-scrolling during mouse tracking by giving the cell a chance to track the mouse first. Apparently one should be clipping the tracking rect to the visible rect so that the cell's tracking loop exits if the mouse is dragged past the edge of the visible rect. This way TableView will be able to scroll the view as appropriate. (I have noticed this same bug in other classes in the AppKit.) - Resizing 'autosize' slots generates truly bizarre behavior. Needs to be fixed. - TableCell's "extra" data may have alignment problems on HPPA and Sparc. FIXED: ----- v140 - As implemented, MiscTableBorder::clearCursor() is ineffectual. It sends -1 to setCursor() which ignores the invalid (-1) value. v139 - Fixed v1 bug: MiscTableBorder.cc:1094: failed assertion `0 <= x' - Fixed v1 bug: MiscTableBorder.cc:1094: failed assertion `x < num_slots' The AppKit supports up to 3 pixels of slop on a mouseDown event when deciding whether to make it a multi-click event -- even when that is outside the bounds of the receiving view. Our code assumed that a mouseDown event had to be inside the bounds of the view. This bug corrupted the selection set by placing out-of-range values in the selection set. v138 - Calling -lockFocus inappropriately: TableScroll calls -lockFocus in a number of places without first checking -canDraw. This is a bug. My (Eric) very brief inspection located three instances (-drawCellAt::, drawRow:, drawCol:). I suspect that there are more. We need to examine each case individually and fix the broken ones. This is a crasher. - Error "lockFocus sent to a view which is not in a window". Very simple to reproduce: 1) Inspect a table scroll in IB. 2) Type in a column/row title and press tab/enter. Eric sez: This is also caused by using -lockFocus without checking -canDraw. v135 - Fixed v130 bug: The up/down arrow buttons on the inspector were broken. v134 - Current editing updates are lost if the user resizes or drags a column while editing is in progress. MiscKit/Palettes/MiscTableScroll/misckit/ 40755 1750 1750 0 6757716177 20614 5ustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/misckit/MiscTableScroll.h100444 1750 1750 76722 6757716156 24135 0ustar sunshinesunshine#ifndef __MiscTableScroll_h #define __MiscTableScroll_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // // // ScrollView class that displays a 2-D table of cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScroll.h,v 1.27 99/06/29 07:41:33 sunshine Exp $ // $Log: MiscTableScroll.h,v $ // Revision 1.27 99/06/29 07:41:33 sunshine // v140: Added new methods: didBecomeFirstResponder, didResignFirstResponder. // Added delegate methods: tableScrollDidBecomeFirstResponder, // tableScrollDidResignFirstResponder. // // Revision 1.26 98/03/24 04:48:10 sunshine // v138: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // // Revision 1.25 97/12/22 21:54:42 zarnuk // v134: Added suspendEditing, resumeEditing. //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END MISC_TS_CLASS_DEF( MiscTableBorder ); MISC_TS_CLASS_DEF( MiscDelegateFlags ); @class MiscTableScroll, MiscTableView, MiscBorderView, MiscCornerView; @class MiscIntList; @class ClipView, Font, Storage, Text; typedef struct MiscCellEditInfo { BOOL editing; // Is editing in progress? MiscCoord_P row; // Coords of edited cell. MiscCoord_P col; Text* editor; // Field editor. id cell; // Temporary editing cell. int suspended; // Suspend/resume counter. } MiscCellEditInfo; typedef struct MiscBorderInfo { MiscTableBorder* border; MiscBorderView* view; ClipView* clip; int sort_vector_len; int* sort_vector; BOOL isOn; BOOL autoSort; } MiscBorderInfo; @interface MiscTableScroll : ScrollView { @private MiscTableView* tableView; MiscBorderInfo* info[2]; // { &colInfo, &rowInfo } MiscBorderInfo colInfo; MiscBorderInfo rowInfo; MiscCornerView* cornerView; Font* font; NXColor textColor; NXColor backgroundColor; NXColor highlightTextColor; NXColor highlightBackgroundColor; id nextText; id previousText; id delegate; id dataDelegate; MiscDelegateFlags* delegateFlags; MiscDelegateFlags* dataDelegateFlags; id target; id doubleTarget; SEL action; SEL doubleAction; int tag; MiscCompareEntryFunc sort_entry_func; MiscCompareSlotFunc sort_slot_func; MiscSelectionMode mode; int num_cols; // Currently active number of int num_rows; // columns and rows. int max_rows; // Highwater mark for Cell allocations. int max_cells; id* cells; id pageHeader; id pageFooter; MiscCellEditInfo editInfo; BOOL tracking; BOOL enabled; BOOL lazy; BOOL drawClippedText; } - (id)initFrame:(NXRect const*)frameRect; - (id)free; // DELEGATE / TAG ------------------------------------------------------------- - (id)delegate; - (id)setDelegate:(id)obj; - (id)dataDelegate; - (id)setDataDelegate:(id)obj; - (int)tag; - (id)setTag:(int)x; // TARGET / ACTION ------------------------------------------------------------ - (id)target; - (id)setTarget:(id)obj; - (id)doubleTarget; - (id)setDoubleTarget:(id)obj; - (SEL)action; - (id)setAction:(SEL)new_sel; - (SEL)doubleAction; - (id)setDoubleAction:(SEL)new_sel; - (id)sendAction:(SEL)theAction to:(id)theTarget; - (id)sendAction; - (id)sendActionIfEnabled; - (id)sendDoubleAction; - (id)sendDoubleActionIfEnabled; // FONT ----------------------------------------------------------------------- - (id)font; - (id)setFont:(id)newFont; - (id)changeFont:(id)sender; + (Font*)defaultFont; // COLOR ---------------------------------------------------------------------- - (NXColor)backgroundColor; - (id)setBackgroundColor:(NXColor)value; // Sent to all cells. - (NXColor)textColor; - (id)setTextColor:(NXColor)value; // Sent to all cells. - (NXColor)highlightBackgroundColor; - (id)setHighlightBackgroundColor:(NXColor)val; //Send to all cells. - (NXColor)highlightTextColor; - (id)setHighlightTextColor:(NXColor)value; // Sent to all cells. - (float)backgroundGray; // Gray values are converted - (id)setBackgroundGray:(float)value; // to/from color values. - (float)textGray; - (id)setTextGray:(float)value; - (float)highlightBackgroundGray; - (id)setHighlightBackgroundGray:(float)value; - (float)highlightTextGray; - (id)setHighlightTextGray:(float)value; - (id)setColor:(NXColor)value; // Alias for -setBackgroundColor: - (NXColor)color; // Alias for -backgroundColor + (NXColor)defaultBackgroundColor; + (NXColor)defaultTextColor; + (NXColor)defaultHighlightBackgroundColor; + (NXColor)defaultHighlightTextColor; // SLOT ORDER ----------------------------------------------------------------- - (id)border:(MiscBorderType)b slotOrder:(MiscIntList*)list; - (id)colOrder:(MiscIntList*)list; - (id)rowOrder:(MiscIntList*)list; - (id)border:(MiscBorderType)b setSlotOrder:(MiscIntList*)list; - (id)setColOrder:(MiscIntList*)list; - (id)setRowOrder:(MiscIntList*)list; - (char*)border:(MiscBorderType)b slotOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (char*)colOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (char*)rowOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (id)border:(MiscBorderType)b setSlotOrderFromString:(char const*)s; - (id)setColOrderFromString:(char const*)s; - (id)setRowOrderFromString:(char const*)s; // SLOT SIZES ----------------------------------------------------------------- - (id)border:(MiscBorderType)b slotSizes:(MiscIntList*)list; - (id)colSizes:(MiscIntList*)list; - (id)rowSizes:(MiscIntList*)list; - (id)border:(MiscBorderType)b setSlotSizes:(MiscIntList*)list; - (id)setColSizes:(MiscIntList*)list; - (id)setRowSizes:(MiscIntList*)list; - (char*)border:(MiscBorderType)b slotSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (char*)colSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (char*)rowSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand; - (id)border:(MiscBorderType)b setSlotSizesFromString:(char const*)s; - (id)setColSizesFromString:(char const*)s; - (id)setRowSizesFromString:(char const*)s; // MULTICAST MESSAGES --------------------------------------------------------- - (id)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag; - (int)makeCellsPerform:(SEL)aSel selectedOnly:(BOOL)flag; - (int)makeCellsPerform:(SEL)aSel with:(id)arg1 selectedOnly:(BOOL)flag; - (int)makeCellsPerform:(SEL)aSel with:(id)arg1 with:(id)arg2 selectedOnly:(BOOL)flag; - (int)makeCellsPerform:(SEL)aSel; - (int)makeCellsPerform:(SEL)aSel with:(id)arg1; - (int)makeCellsPerform:(SEL)aSel with:(id)arg1 with:(id)arg2; // FINDING CELLS -------------------------------------------------------------- - (int)border:(MiscBorderType)b findSlotWithTag:(int)x; - (int)findColWithTag:(int)x; - (int)findRowWithTag:(int)x; - (id)findCellWithTag:(int)x; - (id)findCellWithTag:(int)x row:(int*)row col:(int*)col; - (id)findCell:(id)cell row:(int*)row col:(int*)col; // TOTAL SIZE ----------------------------------------------------------------- - (NXCoord)totalSize:(MiscBorderType)b; - (NXCoord)totalWidth; - (NXCoord)totalHeight; - (void)constrainSize; // Applies constraints, updates views. // CORNER VIEW ---------------------------------------------------------------- - (char const*)cornerTitle; - (void)setCornerTitle:(char const*)s; // SLOTS ---------------------------------------------------------------------- - (MiscTableBorder*)border:(MiscBorderType)b; - (BOOL)borderTitlesOn:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b setTitlesOn:(BOOL)on_off; // -border:setTitlesOn: Returns YES if changed. - (MiscTableTitleMode)borderTitleMode:(MiscBorderType)b; - (void)border:(MiscBorderType)b setTitleMode:(MiscTableTitleMode)x; - (NXCoord)borderTitlesSize:(MiscBorderType)b; - (void)border:(MiscBorderType)b setTitlesSize:(NXCoord)x; - (id)border:(MiscBorderType)b moveSlotFrom:(int)from to:(int)to; - (int)border:(MiscBorderType)b slotPosition:(int)slot; - (int)border:(MiscBorderType)b slotAtPosition:(int)pos; - (void)border:(MiscBorderType)b physicalToVisual:(MiscIntList*)list; - (void)border:(MiscBorderType)b visualToPhysical:(MiscIntList*)list; - (BOOL)sizeableSlots:(MiscBorderType)b; - (BOOL)draggableSlots:(MiscBorderType)b; - (BOOL)modifierDragSlots:(MiscBorderType)b; - (NXCoord)uniformSizeSlots:(MiscBorderType)b; - (NXCoord)minUniformSizeSlots:(MiscBorderType)b; - (NXCoord)maxUniformSizeSlots:(MiscBorderType)b; - (NXCoord)border:(MiscBorderType)b slotAdjustedSize:(int)slot; - (NXCoord)border:(MiscBorderType)b slotSize:(int)slot; - (NXCoord)border:(MiscBorderType)b slotMinSize:(int)slot; - (NXCoord)border:(MiscBorderType)b slotMaxSize:(int)slot; - (BOOL)border:(MiscBorderType)b slotIsSizeable:(int)slot; - (BOOL)border:(MiscBorderType)b slotIsAutosize:(int)slot; - (char const*)border:(MiscBorderType)b slotTitle:(int)slot; - (int)border:(MiscBorderType)b slotTag:(int)slot; - (MiscTableCellStyle)border:(MiscBorderType)b slotCellType:(int)slot; - (id)border:(MiscBorderType)b slotCellPrototype:(int)slot; - (void)border:(MiscBorderType)b setSizeableSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setDraggableSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setModifierDragSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setUniformSizeSlots:(NXCoord)uniform_size; - (void)border:(MiscBorderType)b setMinUniformSizeSlots:(NXCoord)size; - (void)border:(MiscBorderType)b setMaxUniformSizeSlots:(NXCoord)size; - (void)border:(MiscBorderType)b setSlot:(int)n size:(NXCoord)size; - (void)border:(MiscBorderType)b setSlot:(int)n minSize:(NXCoord)size; - (void)border:(MiscBorderType)b setSlot:(int)n maxSize:(NXCoord)size; - (void)border:(MiscBorderType)b setSlot:(int)n sizeable:(BOOL)flag; - (void)border:(MiscBorderType)b setSlot:(int)n autosize:(BOOL)flag; - (void)border:(MiscBorderType)b setSlot:(int)n title:(char const*)title; - (void)border:(MiscBorderType)b setSlot:(int)n tag:(int)tag; - (void)border:(MiscBorderType)b setSlot:(int)n cellType:(MiscTableCellStyle)t; - (void)border:(MiscBorderType)b setSlot:(int)n cellPrototype:(id)cell; // COLS ----------------------------------------------------------------------- - (MiscTableBorder*)colBorder; - (BOOL)colTitlesOn; - (BOOL)setColTitlesOn:(BOOL)on_off; // Returns YES if changed. - (MiscTableTitleMode)colTitleMode; - (void)setColTitleMode:(MiscTableTitleMode)x; - (NXCoord)colTitlesHeight; - (void)setColTitlesHeight:(NXCoord)x; - (id)moveColFrom:(int)pos to:(int)pos; - (int)colPosition:(int)col; - (int)colAtPosition:(int)pos; - (NXCoord)uniformSizeCols; - (NXCoord)minUniformSizeCols; - (NXCoord)maxUniformSizeCols; - (BOOL)sizeableCols; - (BOOL)draggableCols; - (BOOL)modifierDragCols; - (NXCoord)colAdjustedSize:(int)col; - (NXCoord)colSize:(int)col; - (NXCoord)colMinSize:(int)col; - (NXCoord)colMaxSize:(int)col; - (BOOL)colIsSizeable:(int)col; - (BOOL)colIsAutosize:(int)col; - (char const*)colTitle:(int)col; - (int)colTag:(int)col; - (MiscTableCellStyle)colCellType:(int)col; - (id)colCellPrototype:(int)col; - (void)setSizeableCols:(BOOL)flag; - (void)setDraggableCols:(BOOL)flag; - (void)setModifierDragCols:(BOOL)flag; - (void)setUniformSizeCols:(NXCoord)uniform_size; - (void)setMinUniformSizeCols:(NXCoord)size; - (void)setMaxUniformSizeCols:(NXCoord)size; - (void)setCol:(int)col size:(NXCoord)size; - (void)setCol:(int)col minSize:(NXCoord)size; - (void)setCol:(int)col maxSize:(NXCoord)size; - (void)setCol:(int)col sizeable:(BOOL)flag; - (void)setCol:(int)col autosize:(BOOL)flag; - (void)setCol:(int)col title:(char const*)title; - (void)setCol:(int)col tag:(int)tag; - (void)setCol:(int)col cellType:(MiscTableCellStyle)type; - (void)setCol:(int)col cellPrototype:(id)cell; - (int)numVisibleCols; - (int)firstVisibleCol; - (int)lastVisibleCol; - (BOOL)colIsVisible:(int)n; - (void)setFirstVisibleCol:(int)n; - (void)setLastVisibleCol:(int)n; // ROWS ----------------------------------------------------------------------- - (MiscTableBorder*)rowBorder; - (BOOL)rowTitlesOn; - (BOOL)setRowTitlesOn:(BOOL)on_off; - (MiscTableTitleMode)rowTitleMode; - (void)setRowTitleMode:(MiscTableTitleMode)x; - (NXCoord)rowTitlesWidth; - (void)setRowTitlesWidth:(NXCoord)x; - (id)moveRowFrom:(int)fromPos to:(int)toPos; - (int)rowPosition:(int)row; - (int)rowAtPosition:(int)pos; - (BOOL)sizeableRows; - (BOOL)draggableRows; - (BOOL)modifierDragRows; - (NXCoord)uniformSizeRows; - (NXCoord)minUniformSizeRows; - (NXCoord)maxUniformSizeRows; - (NXCoord)rowAdjustedSize:(int)row; - (NXCoord)rowSize:(int)row; - (NXCoord)rowMinSize:(int)row; - (NXCoord)rowMaxSize:(int)row; - (BOOL)rowIsSizeable:(int)row; - (BOOL)rowIsAutosize:(int)row; - (char const*)rowTitle:(int)row; - (int)rowTag:(int)row; - (MiscTableCellStyle)rowCellType:(int)row; - (id)rowCellPrototype:(int)row; - (void)setSizeableRows:(BOOL)flag; - (void)setDraggableRows:(BOOL)flag; - (void)setModifierDragRows:(BOOL)flag; - (void)setUniformSizeRows:(NXCoord)uniform_size; - (void)setMinUniformSizeRows:(NXCoord)size; - (void)setMaxUniformSizeRows:(NXCoord)size; - (void)setRow:(int)row size:(NXCoord)size; - (void)setRow:(int)row minSize:(NXCoord)size; - (void)setRow:(int)row maxSize:(NXCoord)size; - (void)setRow:(int)row sizeable:(BOOL)flag; - (void)setRow:(int)row autosize:(BOOL)flag; - (void)setRow:(int)row title:(char const*)title; - (void)setRow:(int)row tag:(int)tag; - (void)setRow:(int)row cellType:(MiscTableCellStyle)type; - (void)setRow:(int)row cellPrototype:(id)cell; - (int)numVisibleRows; - (int)firstVisibleRow; - (int)lastVisibleRow; - (BOOL)rowIsVisible:(int)n; - (void)setFirstVisibleRow:(int)n; - (void)setLastVisibleRow:(int)n; // DRAWING -------------------------------------------------------------------- - (void)getDocClipFrame:(NXRect*)rect; - (id)drawCellAt:(int)row :(int)col; // Physical coords - (id)drawRow:(int)row; // Physical coords - (id)drawCol:(int)col; // Physical coords - (id)border:(MiscBorderType)b drawSlot:(int)n; - (int)numVisibleSlots:(MiscBorderType)b; - (int)firstVisibleSlot:(MiscBorderType)b; - (int)lastVisibleSlot:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n; - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n; - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n; - (void)scrollCellToVisible:(int)row :(int)col; // Physical coords - (void)scrollRowToVisible:(int)row; // Physical coord - (void)scrollColToVisible:(int)col; // Physical coord - (id)scrollSelToVisible; - (id)border:(MiscBorderType)b drawSlotTitle:(int)n; - (id)drawRowTitle:(int)n; - (id)drawColTitle:(int)n; - (id)setAutodisplay:(BOOL)x; - (id)sizeToCells; - (id)sizeToFit; - (BOOL)drawClippedText; - (void)setDrawClippedText:(BOOL)x; // INTERNAL COMMUNICATIONS ON USER-ACTIONS FOR SUBCLASSES ONLY ---------------- // Protected: BorderView -> TableScroll - (void)border:(MiscBorderType)b slotDraggedFrom:(int)fromPos to:(int)toPos; - (void)border:(MiscBorderType)b slotSortReversed:(int)n; - (void)border:(MiscBorderType)b slotResized:(int)n; // Protected: TableView -> TableScroll - (void)didBecomeFirstResponder; - (void)didResignFirstResponder; @end // SELECTION ------------------------------------------------------------------ @interface MiscTableScroll(Selection) - (MiscSelectionMode)selectionMode; - (void)setSelectionMode:(MiscSelectionMode)x; - (BOOL)borderHasSelection:(MiscBorderType)b; - (BOOL)hasRowSelection; - (BOOL)hasColSelection; - (BOOL)borderHasMultipleSelection:(MiscBorderType)b; - (BOOL)hasMultipleRowSelection; - (BOOL)hasMultipleColSelection; - (unsigned int)borderNumSelectedSlots:(MiscBorderType)b; - (unsigned int)numSelectedRows; - (unsigned int)numSelectedCols; - (BOOL)border:(MiscBorderType)b slotIsSelected:(MiscCoord_P)slot; - (BOOL)rowIsSelected:(MiscCoord_P)row; - (BOOL)colIsSelected:(MiscCoord_P)col; - (BOOL)cellIsSelected:(MiscCoord_P)row :(MiscCoord_P)col; - (MiscCoord_P)borderSelectedSlot:(MiscBorderType)b; - (MiscCoord_P)selectedRow; - (MiscCoord_P)selectedCol; - (id)selectedCell; - (void)border:(MiscBorderType)b selectedTags:(MiscIntList*)tags; - (void)selectedRowTags:(MiscIntList*)tags; - (void)selectedColTags:(MiscIntList*)tags; - (void)border:(MiscBorderType)b selectedSlots:(MiscIntList*)slots; - (void)selectedRows:(MiscIntList*)rows; - (void)selectedCols:(MiscIntList*)cols; - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)slot byExtension:(BOOL)flag; - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)slot; - (void)selectRow:(MiscCoord_P)row byExtension:(BOOL)flag; - (void)selectRow:(MiscCoord_P)row; - (void)selectCol:(MiscCoord_P)col byExtension:(BOOL)flag; - (void)selectCol:(MiscCoord_P)col; - (void)border:(MiscBorderType)b selectTags:(MiscIntList*)tags byExtension:(BOOL)flag; - (void)border:(MiscBorderType)b selectTags:(MiscIntList*)tags; - (void)selectRowTags:(MiscIntList*)tags byExtension:(BOOL)flag; - (void)selectRowTags:(MiscIntList*)tags; - (void)selectColTags:(MiscIntList*)tags byExtension:(BOOL)flag; - (void)selectColTags:(MiscIntList*)tags; - (void)border:(MiscBorderType)b selectSlots:(MiscIntList*)slots byExtension:(BOOL)flag; - (void)border:(MiscBorderType)b selectSlots:(MiscIntList*)slots; - (void)selectRows:(MiscIntList*)rows byExtension:(BOOL)flag; - (void)selectRows:(MiscIntList*)rows; - (void)selectCols:(MiscIntList*)cols byExtension:(BOOL)flag; - (void)selectCols:(MiscIntList*)cols; - (void)borderSelectAll:(MiscBorderType)b; - (void)selectAllRows; - (void)selectAllCols; - (id)selectAll:(id)sender; // -selectAllRows and sends action to target. - (void)border:(MiscBorderType)b deselectSlot:(MiscCoord_P)slot; - (void)deselectRow:(MiscCoord_P)row; - (void)deselectCol:(MiscCoord_P)col; - (void)border:(MiscBorderType)b deselectTags:(MiscIntList*)tags; - (void)deselectRowTags:(MiscIntList*)tags; - (void)deselectColTags:(MiscIntList*)tags; - (void)border:(MiscBorderType)b deselectSlots:(MiscIntList*)slots; - (void)deselectRows:(MiscIntList*)rows; - (void)deselectCols:(MiscIntList*)cols; - (void)borderClearSelection:(MiscBorderType)b; - (void)clearRowSelection; - (void)clearColSelection; - (void)clearSelection; - (id)deselectAll:(id)sender; // -clearSelection and sends action to target. - (void)selectionChanged; // Subclasses may want to override. // MOUSE & KEYBOARD TRACKING (SELECTION ORIENTATION) -------------------------- - (void)trackBy:(MiscBorderType)b; - (MiscBorderType)trackingBy; - (BOOL)tracking; - (MiscCoord_P)borderClickedSlot:(MiscBorderType)b; - (MiscCoord_P)clickedRow; - (MiscCoord_P)clickedCol; - (id)clickedCell; // KEYBOARD CURSOR ------------------------------------------------------------ - (MiscCoord_P)borderCursor:(MiscBorderType)b; - (MiscCoord_P)cursorRow; - (MiscCoord_P)cursorCol; - (void)border:(MiscBorderType)b setCursor:(MiscCoord_P)slot; - (void)setCursorRow:(MiscCoord_P)row; - (void)setCursorCol:(MiscCoord_P)col; - (void)borderClearCursor:(MiscBorderType)b; - (void)clearCursorRow; - (void)clearCursorCol; - (void)clearCursor; - (BOOL)borderHasValidCursor:(MiscBorderType)b; - (BOOL)hasValidCursorRow; - (BOOL)hasValidCursorCol; - (void)disableCursor; // Can nest. - (void)reenableCursor; - (BOOL)isCursorEnabled; // NEXT-TEXT CHAIN ------------------------------------------------------------ - (id)nextText; - (id)previousText; - (id)setNextText:(id)obj; - (id)setPreviousText:(id)obj; - (id)selectText:(id)sender; - (BOOL)isEnabled; - (id)setEnabled:(BOOL)flag; - (BOOL)isSelectable; @end // SORTING -------------------------------------------------------------------- @interface MiscTableScroll(Sort) - (MiscCompareSlotFunc)compareSlotFunc; - (void)setCompareSlotFunc:(MiscCompareSlotFunc)f; - (void)sortInfoInit:(MiscSlotSortInfo*)ip border:(MiscBorderType)b; - (void)sortInfoDone:(MiscSlotSortInfo*)ip; // Slots - (BOOL)autoSortSlots:(MiscBorderType)b; - (void)border:(MiscBorderType)b setAutoSortSlots:(BOOL)flag; - (int const*)slotSortVector:(MiscBorderType)b len:(int*)len; - (void)border:(MiscBorderType)b setSlotSortVector:(int const*)v len:(int)n; - (void)sortSlots:(MiscBorderType)b; - (BOOL)slotsAreSorted:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b sortSlot:(int)n; - (BOOL)border:(MiscBorderType)b slotIsSorted:(int)n; - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 info:(MiscSlotSortInfo*)ip; - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2; - (MiscCompareEntryFunc)border:(MiscBorderType)b slotSortFunc:(int)n; - (MiscSortDirection)border:(MiscBorderType)b slotSortDirection:(int)n; - (MiscSortType)border:(MiscBorderType)b slotSortType:(int)n; - (void)border:(MiscBorderType)b setSlot:(int)n sortFunc:(MiscCompareEntryFunc)x; - (void)border:(MiscBorderType)b setSlot:(int)n sortDirection:(MiscSortDirection)x; - (void)border:(MiscBorderType)b setSlot:(int)n sortType:(MiscSortType)x; // Cols - (BOOL)autoSortCols; - (void)setAutoSortCols:(BOOL)flag; - (int const*)colSortVectorLen:(int*)len; - (void)setColSortVector:(int const*)v len:(int)n; - (void)sortCols; - (BOOL)colsAreSorted; - (BOOL)sortCol:(int)n; - (BOOL)colIsSorted:(int)n; - (int)compareCols:(int)c1 :(int)c2 info:(MiscSlotSortInfo*)ip; - (int)compareCols:(int)c1 :(int)c2; - (MiscCompareEntryFunc)colSortFunc:(int)n; - (MiscSortDirection)colSortDirection:(int)n; - (MiscSortType)colSortType:(int)n; - (void)setCol:(int)n sortFunc:(MiscCompareEntryFunc)x; - (void)setCol:(int)n sortDirection:(MiscSortDirection)x; - (void)setCol:(int)n sortType:(MiscSortType)x; // Rows - (BOOL)autoSortRows; - (void)setAutoSortRows:(BOOL)flag; - (int const*)rowSortVectorLen:(int*)len; - (void)setRowSortVector:(int const*)v len:(int)n; - (void)sortRows; - (BOOL)rowsAreSorted; - (BOOL)sortRow:(int)n; - (BOOL)rowIsSorted:(int)n; - (int)compareRows:(int)r1 :(int)r2 info:(MiscSlotSortInfo*)ip; - (int)compareRows:(int)r1 :(int)r2; - (MiscCompareEntryFunc)rowSortFunc:(int)n; - (MiscSortDirection)rowSortDirection:(int)n; - (MiscSortType)rowSortType:(int)n; - (void)setRow:(int)n sortFunc:(MiscCompareEntryFunc)x; - (void)setRow:(int)n sortDirection:(MiscSortDirection)x; - (void)setRow:(int)n sortType:(MiscSortType)x; @end // DATA MANIPULATION ---------------------------------------------------------- @interface MiscTableScroll(Data) - (BOOL)isLazy; - (void)setLazy:(BOOL)flag; - (id)cellAt:(int)row :(int)col; // Lazy mode tables that perform multiple-buffering: - (int)buffCount; // Lazy mode asks delegate/dataDelegate first then uses cellAt:: // Eager mode goes straight to cellAt:: - (int)tagAt:(int)row :(int)col; - (int)intValueAt:(int)row :(int)col; - (float)floatValueAt:(int)row :(int)col; - (double)doubleValueAt:(int)row :(int)col; - (char const*)stringValueAt:(int)row :(int)col; // For ButtonCells. - (char const*)titleAt:(int)row :(int)col; - (int)stateAt:(int)row :(int)col; // Invoke delegate methods if possible. - (id)reviveCell:(id)cell at:(int)row :(int)col; - (id)retireCell:(id)cell at:(int)row :(int)col; // Builtin default implementation. - (id)doReviveCell:(id)cell at:(int)row:(int)col; - (id)doRetireCell:(id)cell at:(int)row:(int)col; - (id)addSlot:(MiscBorderType)b; - (id)border:(MiscBorderType)b insertSlotAt:(int)pos; - (id)border:(MiscBorderType)b deleteSlotAt:(int)pos; - (int)numSlots:(MiscBorderType)b; - (id)addCol; - (id)insertColAt:(int)pos; - (id)deleteColAt:(int)pos; - (int)numCols; - (id)addRow; - (id)insertRowAt:(int)pos; - (id)deleteRowAt:(int)pos; - (int)numRows; - (id)renewRows:(int)count; - (id)empty; // [self renewRows:0]; - (id)emptyAndFreeCells; @end // READ / WRITE --------------------------------------------------------------- @interface MiscTableScroll(IO) - (id)awakeFromNib; - (id)read:(NXTypedStream*)stream; - (id)write:(NXTypedStream*)stream; @end // PASTEBOARD SUPPORT --------------------------------------------------------- @interface MiscTableScroll(Pasteboard) - (id)copy:(id)sender; - (id)cut:(id)sender; - (id)validRequestorForSendType:(NXAtom)s andReturnType:(NXAtom)r; - (id)builtinValidRequestorForSendType:(NXAtom)s andReturnType:(NXAtom)r; - (BOOL)canWritePboardType:(NXAtom)type; - (BOOL)builtinCanWritePboardType:(NXAtom)type; - (BOOL)writeSelectionToPasteboard:(id)pboard types:(NXAtom*)types; - (BOOL)builtinWriteSelectionToPasteboard:(id)pboard types:(NXAtom*)types; - (void)writePboard:(id)pboard type:(NXAtom)type toStream:(NXStream*)stream; - (void)builtinWritePboard:(id)pb type:(NXAtom)type toStream:(NXStream*)stream; - (void)writeNXAsciiPboardTypeToStream:(NXStream*)stream; - (void)writeNXTabularTextPboardTypeToStream:(NXStream*)stream; - (id)readSelectionFromPasteboard:(id)pboard; - (id)builtinReadSelectionFromPasteboard:(id)pboard; - (void)builtinRegisterServicesTypes; - (void)registerServicesTypes; @end // INCREMENTAL SEARCH --------------------------------------------------------- @interface MiscTableScroll(IncrementalSearch) - (BOOL)incrementalSearch:(NXEvent*)p; - (BOOL)doIncrementalSearch:(NXEvent*)p col:(int)col; - (BOOL)getISearchCol:(int*)col; - (BOOL)doGetISearchCol:(int*)col; @end // KEYBOARD EVENTS ------------------------------------------------------------ @interface MiscTableScroll(Keyboard) - (id)keyDown:(NXEvent*)event; @end // EDITING -------------------------------------------------------------------- @interface MiscTableScroll(Edit) - (id)getCellFrame:(NXRect*)rect at:(int)row :(int)col; // Physical coords - (id)getRow:(int*)row andCol:(int*)col // Physical coords forPoint:(NXPoint const*)point; - (BOOL)getPreviousEditRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col; - (BOOL)getNextEditRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col; - (BOOL)getNext:(BOOL)foreward editRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col; - (BOOL)isEditing; - (BOOL)finishEditing; // Normal, conditional termination. - (void)abortEditing; // Forcibly abort the editing session. - (void)suspendEditing; // Temporary suspension while resizing. - (void)resumeEditing; // Resume editing after resizing. - (id)textDidEnd:(id)sender endChar:(unsigned short)whyEnd; - (id)textDidChange:(id)sender; - (id)textDidGetKeys:(id)sender isEmpty:(BOOL)flag; - (BOOL)textWillChange:(id)sender; - (BOOL)textWillEnd:(id)sender; - (void)edit:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col; - (BOOL)canEdit:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col; - (BOOL)editIfAble:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col; - (void)editCellAt:(MiscCoord_P)row :(MiscCoord_P)col; @end // PRINTING ------------------------------------------------------------------- @interface MiscTableScroll(Print) - (id)printPSCode:(id)sender; - (MiscTablePrintInfo const*)getPrintInfo; - (id)getPageHeader; - (id)getPageFooter; - (void)setPageHeader:(id)obj; - (void)setPageFooter:(id)obj; @end // DELEGATE PROTOCOL ---------------------------------------------------------- @interface MiscTableScroll(Delegate) - (id)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotDraggedFrom:(int)fromPos to:(int)toPos; - (id)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotSortReversed:(int)n; - (id)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotResized:(int)n; - (id)tableScroll:(MiscTableScroll*)scroll changeFont:(Font*)oldFont to:(Font*)newFont; - (id)tableScroll:(MiscTableScroll*)scroll fontChangedFrom:(Font*)oldFont to:(Font*)newFont; - (id)tableScroll:(MiscTableScroll*)scroll backgroundColorChangedTo:(NXColor)x; - (id)tableScroll:(MiscTableScroll*)scroll highlightBackgroundColorChangedTo:(NXColor)x; - (id)tableScroll:(MiscTableScroll*)scroll highlightTextColorChangedTo:(NXColor)x; - (id)tableScroll:(MiscTableScroll*)scroll textColorChangedTo:(NXColor)x; - (BOOL)tableScroll:(MiscTableScroll*)scroll getISearchCol:(int*)col; - (int)tableScrollBuffCount:(MiscTableScroll*)scroll; - (id)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotPrototype:(int)slot; - (char const*)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotTitle:(int)slot; - (id)tableScroll:(MiscTableScroll*)ts cellAt:(int)row :(int)col; - (id)tableScroll:(MiscTableScroll*)ts reviveCell:(id)cell at:(int)r :(int)c; - (id)tableScroll:(MiscTableScroll*)ts retireCell:(id)cell at:(int)r :(int)c; - (int)tableScroll:(MiscTableScroll*)scroll tagAt:(int)row :(int)col; - (int)tableScroll:(MiscTableScroll*)scroll intValueAt:(int)row :(int)col; - (float)tableScroll:(MiscTableScroll*)scroll floatValueAt:(int)row :(int)col; - (double)tableScroll:(MiscTableScroll*)scroll doubleValueAt:(int)row :(int)col; - (char const*)tableScroll:(MiscTableScroll*)scroll stringValueAt:(int)row :(int)col; - (char const*)tableScroll:(MiscTableScroll*)scroll titleAt:(int)row :(int)col; - (int)tableScroll:(MiscTableScroll*)scroll stateAt:(int)row :(int)col; - (BOOL)tableScroll:(MiscTableScroll*)scroll allowDragOperationAt:(int)row :(int)col; - (void)tableScroll:(MiscTableScroll*)scroll preparePasteboard:(Pasteboard*)pb forDragOperationAt:(int)row:(int)col; - (NXImage*)tableScroll:(MiscTableScroll*)scroll imageForDragOperationAt:(int)row :(int)col; - (NXDragOperation)tableScroll:(MiscTableScroll*)scroll draggingSourceOperationMaskForLocal:(BOOL)isLocal; - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)scroll; - (BOOL)tableScroll:(MiscTableScroll*)scroll shouldDelayWindowOrderingForEvent:(NXEvent*)event; - (void)tableScrollRegisterServicesTypes:(MiscTableScroll*)scroll; - (id)tableScroll:(MiscTableScroll*)scroll validRequestorForSendType:(NXAtom)s andReturnType:(NXAtom)r; - (BOOL)tableScroll:(MiscTableScroll*)scroll canWritePboardType:(NXAtom)type; - (void)tableScroll:(MiscTableScroll*)scroll writePboard:(id)pboard type:(NXAtom)type toStream:(NXStream*)stream; - (BOOL)tableScroll:(MiscTableScroll*)scroll writeSelectionToPasteboard:(id)pboard types:(NXAtom*)types; - (id)tableScroll:(MiscTableScroll*)scroll readSelectionFromPasteboard:(id)pboard; - (void)tableScrollWillPrint:(MiscTableScroll*)scroll; - (void)tableScroll:(MiscTableScroll*)scroll didPrint:(BOOL)flag; - (void)tableScroll:(MiscTableScroll*)scroll willPrintPageHeader:(id)pageHeader info:(MiscTablePrintInfo const*)info; - (void)tableScroll:(MiscTableScroll*)scroll willPrintPageFooter:(id)pageFooter info:(MiscTablePrintInfo const*)info; - (BOOL)tableScroll:(MiscTableScroll*)scroll canEdit:(NXEvent const*)ev at:(int)row :(int)col; - (void)tableScroll:(MiscTableScroll*)scroll edit:(NXEvent const*)ev at:(int)row :(int)col; - (BOOL)tableScroll:(MiscTableScroll*)scroll setStringValue:(char const*)s at:(int)row :(int)col; - (void)tableScroll:(MiscTableScroll*)scroll abortEditAt:(int)row :(int)col; - (void)tableScroll:(MiscTableScroll*)scroll willEditAt:(int)row :(int)col; - (void)tableScroll:(MiscTableScroll*)scroll didEdit:(BOOL)changed at:(int)row :(int)col; - (void)tableScrollDidBecomeFirstResponder:(MiscTableScroll*)scroll; - (void)tableScrollDidResignFirstResponder:(MiscTableScroll*)scroll; @end // DATA CELL PROTOCOL --------------------------------------------------------- @interface MiscTableScroll(DataCell) - (id)tableScroll:(MiscTableScroll*)scroll reviveAt:(int)row :(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireAt:(int)row :(int)col; @end #endif // __MiscTableScroll_h MiscKit/Palettes/MiscTableScroll/misckit/MiscTableCell.h100444 1750 1750 14245 6757716155 23545 0ustar sunshinesunshine#ifndef __MiscTableCell_h #define __MiscTableCell_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableCell.h // // Default cell class used by MiscTableScroll to display text. // // NOTE: // By default, new cells are initialized to useOwner... everything. // // Calling any of the -setFont:, -setTextColor:, -setBackgroundColor: // -setHighlightTextColor:, or -setHighlightBackgroundColor: // methods implicitly turns off the corresponding "useOwner" value. In // the case of colors, this also causes space to be allocated to store // the corresponding color. // // Calling any of the -setOwnerFont:, -setOwnerTextColor:, or // -setOwnerBackgroundColor: methods do *NOT* set these values in the // owner, and do not necessarily make any changes in the object. They // are primarily notification messages. They give the cell the ability // to distinguish between cell-specific -setXxx messages and ones that // are propagated globally by the owner. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableCell.h,v 1.10 97/06/10 05:42:22 sunshine Exp $ // $Log: MiscTableCell.h,v $ // Revision 1.10 97/06/10 05:42:22 sunshine // v127: Upgraded formatting. Fixed up comments. Added explicit (id). // // Revision 1.9 96/12/16 10:17:58 zarnuk // v111 -- Added table scroll retire/revive call back methods. // // Revision 1.8 96/09/25 07:17:22 sunshine // Ripped out all dragging-source support and promoted it to TableView. //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END @class NXImage, Pasteboard; @class MiscTableScroll; #define MISC_TC1_HAS_TAG (1 << 0) // Obsolete. #define MISC_TC1_SELF_FONT (1 << 1) #define MISC_TC1_SELF_TEXT_COLOR (1 << 2) #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3) #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4) #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5) #define MISC_TC1_IS_SELECTED (1 << 6) #define MISC_TC1_SELF_DRAW (1 << 7) // !ownerDraw #define MISC_TC1_LAST_BIT (1 << 7) @interface MiscTableCell : Cell { id owner; int tag; unsigned int tc1_flags; void* tc1_data; } - (id)initTextCell:(char const*)s; - (id)initIconCell:(char const*)s; - (id)free; - (id)copyFromZone:(NXZone*)zone; - (id)read:(NXTypedStream*)stream; - (id)write:(NXTypedStream*)stream; - (id)drawInside:(NXRect const*)r inView:(id)v; - (id)drawSelf: (NXRect const*)r inView:(id)v; - (id)highlight: (NXRect const*)r inView:(id)v lit:(BOOL)flag; - (BOOL)isOpaque; - (void)setSelected:(BOOL)flag; - (BOOL)isSelected; - (int)tag; - (id)setTag:(int)tag; - (id)image; - (id)setImage:(id)image; - (id)owner; - (id)setOwner:(id)obj; - (id)font; - (id)setFont:(id)obj; // Turns off -useOwnerFont - (NXColor)textColor; - (NXColor)backgroundColor; - (NXColor)highlightBackgroundColor; - (NXColor)highlightTextColor; - (id)setTextColor:(NXColor)c; // Turns off -useOwnerTextCo... - (id)setBackgroundColor:(NXColor)c; // Turns off -useOwnerBackgr... - (id)setHighlightTextColor:(NXColor)c; // Turns off -useOwnerHighli... - (id)setHighlightBackgroundColor:(NXColor)c; // Turns off -useOwnerHighli... - (float)textGray; // Gray values are translated - (float)backgroundGray; // to/from color values. - (float)highlightTextGray; - (float)highlightBackgroundGray; - (id)setTextGray:(float)g; // Calls setTextColor: - (id)setBackgroundGray:(float)g; // Calls setBackgroundColor: - (id)setHighlightTextGray:(float)g; // Calls setHighlightTextColor: - (id)setHighlightBackgroundGray:(float)g; // Calls setHighlightBack... - (BOOL)ownerDraw; - (BOOL)useOwnerFont; - (BOOL)useOwnerTextColor; - (BOOL)useOwnerBackgroundColor; - (BOOL)useOwnerHighlightTextColor; - (BOOL)useOwnerHighlightBackgroundColor; - (id)setOwnerDraw:(BOOL)flag; - (id)setUseOwnerFont:(BOOL)flag; - (id)setUseOwnerTextColor:(BOOL)flag; - (id)setUseOwnerBackgroundColor:(BOOL)flag; - (id)setUseOwnerHighlightTextColor:(BOOL)flag; - (id)setUseOwnerHighlightBackgroundColor:(BOOL)flag; - (id)setOwnerFont:(id)obj; - (id)setOwnerTextColor:(NXColor)c; - (id)setOwnerBackgroundColor:(NXColor)c; - (id)setOwnerHighlightTextColor:(NXColor)c; - (id)setOwnerHighlightBackgroundColor:(NXColor)c; - (unsigned int)tc1Flags; - (unsigned int)tc1DataSize; - (unsigned int)tc1TextColorPos; - (unsigned int)tc1BackgroundColorPos; - (unsigned int)tc1HighlightTextColorPos; - (unsigned int)tc1HighlightBackgroundColorPos; - (unsigned int)tc1TextColorLen; - (unsigned int)tc1BackgroundColorLen; - (unsigned int)tc1HighlightTextColorLen; - (unsigned int)tc1HighlightBackgroundColorLen; - (NXColor*)tc1TextColorPtr; - (NXColor*)tc1BackgroundColorPtr; - (NXColor*)tc1HighlightTextColorPtr; - (NXColor*)tc1HighlightBackgroundColorPtr; - (void*)tc1InsertData:(void const*)data pos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DeleteDataPos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DestroyData; - (void)tc1FreeData; - (NXColor)fgColor; // Returns appropriate color based upon -isSelected. - (NXColor)bgColor; // Returns appropriate color based upon -isSelected. + (id)defaultFont; + (NXColor)defaultTextColor; + (NXColor)defaultBackgroundColor; + (NXColor)defaultHighlightTextColor; + (NXColor)defaultHighlightBackgroundColor; - (id)tableScroll:(MiscTableScroll*)scroll reviveAt:(int)row :(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireAt:(int)row :(int)col; @end #endif // __MiscTableCell_h MiscKit/Palettes/MiscTableScroll/misckit/MiscTableTypes.h100444 1750 1750 37071 6757716162 23772 0ustar sunshinesunshine#ifndef __MiscTableTypes_h #define __MiscTableTypes_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // // // Common types used for the MiscTableScroll object. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableTypes.h,v 1.12 99/06/29 07:54:13 sunshine Exp $ // $Log: MiscTableTypes.h,v $ // Revision 1.12 99/06/29 07:54:13 sunshine // v140: Fixed bug: MiscDefaultCompareFunc() was not being exported with // extern "C". Thus C and Objective-C clients were unable to access it. // // Revision 1.11 97/12/19 01:13:13 zarnuk // v133: Eliminated data-sizing. // // Revision 1.10 97/07/01 10:43:14 sunshine // v128: Published and documented exceptions raised by this class. //----------------------------------------------------------------------------- #ifdef __cplusplus # define MISC_TS_EXTERN(X) extern X # define MISC_TS_EXTERN_BEGIN(X) extern X { # define MISC_TS_EXTERN_END } # define MISC_TS_CLASS_DEF(X) class X #else # define MISC_TS_EXTERN(X) extern # define MISC_TS_EXTERN_BEGIN(X) # define MISC_TS_EXTERN_END # define MISC_TS_CLASS_DEF(X) typedef struct X X #endif MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import #import MISC_TS_EXTERN_END typedef int MiscPixels; typedef int MiscCoord_V; // Visual coordinate. typedef int MiscCoord_P; // Physical coordinate. #define MISC_MIN_PIXELS_SIZE ((MiscPixels) 10) #define MISC_MAX_PIXELS_SIZE ((MiscPixels) 0x7FFF0000) #define MISC_TABLE_SCROLL_ERROR_BASE 33000 typedef enum { MISC_TABLE_SCROLL_ASSERTION = MISC_TABLE_SCROLL_ERROR_BASE } MiscTableScrollErrorTokens; #define MISC_TABLE_SCROLL_ERROR_MAX MISC_TABLE_SCROLL_ASSERTION typedef enum { MISC_COL_BORDER, MISC_ROW_BORDER } MiscBorderType; #define MISC_MAX_BORDER MISC_ROW_BORDER #define MISC_OTHER_BORDER(B) \ (B == MISC_ROW_BORDER ? MISC_COL_BORDER : MISC_ROW_BORDER) typedef struct { NXRect page_rect; // [PrintInfo paperRect] NXRect print_rect; // MiscTableView rect. MiscCoord_V first_print_row;// one's comp if started on prev page. MiscCoord_V last_print_row; // one's comp if ends on later page. MiscCoord_V first_print_col;// one's comp if started on prev page. MiscCoord_V last_print_col; // one's comp if ends on later page. int print_page; // 1 <= print_page <= num_print_pages int print_row; // 1 <= print_row <= num_print_rows int print_col; // 1 <= print_col <= num_print_cols int num_print_pages; int num_print_rows; int num_print_cols; double scale_factor; BOOL is_scaled; } MiscTablePrintInfo; typedef enum { MISC_NO_TITLE, // No titles on row/col cells. MISC_NUMBER_TITLE, // Titles are sequential numbers. MISC_ALPHA_TITLE, // Titles are sequential alphabetics... MISC_CUSTOM_TITLE, // Titles are user-supplied strings... MISC_DELEGATE_TITLE // Ask the delegate for titles. } MiscTableTitleMode; #define MISC_MAX_TITLE MISC_DELEGATE_TITLE typedef enum { MISC_LIST_MODE, MISC_RADIO_MODE, MISC_HIGHLIGHT_MODE } MiscSelectionMode; #define MISC_MAX_MODE MISC_HIGHLIGHT_MODE typedef enum { MISC_TABLE_CELL_TEXT, MISC_TABLE_CELL_ICON, MISC_TABLE_CELL_BUTTON, MISC_TABLE_CELL_CALLBACK } MiscTableCellStyle; #define MISC_TABLE_CELL_MAX MISC_TABLE_CELL_CALLBACK #define MISC_SIZING_SPRINGY_BIT (1 << 0) // Adjusts for global limits. #define MISC_SIZING_USER_BIT (1 << 1) // User can resize. typedef enum { MISC_NUSER_NSPRINGY_SIZING, MISC_NUSER_SPRINGY_SIZING, MISC_USER_NSPRINGY_SIZING, MISC_USER_SPRINGY_SIZING, } MiscTableSizing; #define MISC_MAX_SIZING MISC_USER_SPRINGY_SIZING typedef enum { MISC_SORT_ASCENDING, MISC_SORT_DESCENDING } MiscSortDirection; #define MISC_SORT_DIR_MAX MISC_SORT_DESCENDING #define MISC_OTHER_DIRECTION(D)\ ((D) == MISC_SORT_DESCENDING ? \ MISC_SORT_ASCENDING : MISC_SORT_DESCENDING) typedef enum // Selector used to get data: { MISC_SORT_STRING_CASE_INSENSITIVE, // 0 -stringValue MISC_SORT_STRING_CASE_SENSITIVE, // 1 -stringValue MISC_SORT_INT, // 2 -intValue MISC_SORT_UNSIGNED_INT, // 3 -intValue MISC_SORT_TAG, // 4 -tag MISC_SORT_UNSIGNED_TAG, // 5 -tag MISC_SORT_FLOAT, // 6 -floatValue MISC_SORT_DOUBLE, // 7 -doubleValue MISC_SORT_SKIP, // 8 Don't compare cells in this slot. MISC_SORT_TITLE_CASE_INSENSITIVE, // 9 -title MISC_SORT_TITLE_CASE_SENSITIVE, // 10 -title MISC_SORT_STATE, // 11 -state MISC_SORT_UNSIGNED_STATE, // 12 -state } MiscSortType; #define MISC_SORT_TYPE_MAX MISC_SORT_UNSIGNED_STATE #define MISC_SORT_CUSTOM ((MiscSortType)(int(MISC_SORT_TYPE_MAX) + 1)) @class MiscTableScroll; typedef struct MiscEntrySortInfo MiscEntrySortInfo; typedef struct MiscSlotSortInfo MiscSlotSortInfo; //----------------------------------------------------------------------------- // MiscCompareEntryFunc // // Compare two cells, given the coordinates of the cells, and a pointer // to the sorting information structure. This is the prototype for // custom sort functions that you write, and install with // -border:setSlot:sortFunc:, -setCol:sortFunc:, or -setRow:sortFunc:. // // Returns: // < 0 if (table[r1][c1] < table[r2][c2]) // = 0 if (table[r1][c1] = table[r2][c2]) // > 0 if (table[r1][c1] > table[r2][c2]) // // When sorting rows: // info->border_type == MISC_COL_BORDER, col1 == col2 // // When sorting columns: // info->border_type == MISC_ROW_BORDER, row1 == row2 // // Always return the result of an "ascending" comparison. The // caller is responsible for choosing the sort direction. // // WARNING: // If info->need_copy is YES, you must copy the information from // the first cell *BEFORE* accessing the second cell. (This happens // with lazy tables that provide only a single buffer.) Failure to // do so will result in catastrophic worst-case performance and will // not sort the table. //----------------------------------------------------------------------------- typedef int (*MiscCompareEntryFunc) ( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* entry_info, MiscSlotSortInfo* sort_info ); //----------------------------------------------------------------------------- // MiscCompareSlotFunc // // Compare two entire slots (usually rows) from the table. // // Returns: // < 0 if (table.b[slot1] < table.b[slot2]) // = 0 if (table.b[slot1] = table.b[slot2]) // > 0 if (table.b[slot1] > table.b[slot2]) // // The default version, MiscDefaultComareSlotFunc(), compares the // slots, one entry at a time, using the sorting information // structure. // // You can install a customized replacement via -setCompareSlotFunc: // // This routine is responsible for honoring the slot-sort-vector (order // in which columns/rows are visited), applying the sort-direction // (ascending/descending), and calling user-installed custom // slot-sort-funcs. //----------------------------------------------------------------------------- typedef int (*MiscCompareSlotFunc) ( int slot1, int slot2, MiscSlotSortInfo* ); MISC_TS_EXTERN("C") int MiscDefaultCompareSlotFunc( int slot1, int slot2, MiscSlotSortInfo* ); //----------------------------------------------------------------------------- // MiscSlotSortInfo // // This structure provides the sorting information used by the // MiscDefaultCompareSlotFunc() function. This structure is properly // intialized by the -sortInfoInit:border: method, and storage is // reclaimed by the -sortInfoDone: method. The initialization and // cleanup is handled automatically by the sorting and comparison // methods that do NOT accept an "info" argument. You are responsible // for calling -sortInfoInit:border: and -sortInfoDone: when you call // any of the methods that DO accept an 'info' argument. // // Order in which entries are visited: // If you have installed a slot-sort-vector for the "other" border, that // will determine the order in which entries are compared. If you have // not installed a slot-sort-vector, the current visual order is used. // This information is stored in num_entries and entry_info[].slot // // Sort direction: // Each entry (slot from the "other" border) has a sort direction which // is either ascending or descending. This is the basis for determining // the sort direction of an entry. In addition, if you have installed // a slot-sort-vector, and any of the elements of that slot-sort-vector // are negative, they will reverse the sort direction of that entry. // (If the sort-direction for the entry is ascending, a negative index // will cause that entry to be sorted in descending order. If the // sort-direction for the entry is descending, a negative index will // cause that entry to be sorted in ascending order.) This information // is stored in entry_info[].ascending. // // Comparison function: // If you have installed a custom comparison function for the entry // (slot from the "other" border), your custom comparison function will // be used. Otherwise, an internal comparison function will be selected // based on the "sort-type" for the entry. The address of the function // is stored in entry_info[].compare_func. // // struct MiscSlotSortInfo // // table_scroll The MiscTableScroll being used. // // zone This is [table_scroll zone]. The zone that // is used for allocation of the entry_info[] // buff[] arrays. // // border_type The "other" border. When rows are being // compared, this is MISC_COL_BORDER. When // comparing columns, this is MISC_ROW_BORDER. // // num_entries The number of entries that will be compared. // Normally, this is the number of slots in // the "border_type" border (usually, the number // of columns). This can be different if you // have installed a slot-sort-vector. // // entry_info An array of sorting information for each // entry in a slot. This information is // precomputed in -sortInfoInit:border: for // use by MiscDefaultCompareSlotFunc(). // // need_copy Flag indicating whether information from the // the first entry (cell) must be copied before // accessing the second entry (cell). This is // YES when table_scroll is lazy and supplies // only a single buffer. // // buff, buff_size Storage to hold copied information. This // buffer can grow as needed during sorting. It // is deallocated in -sortInfoDone:. You can // use this buffer in your custom sort functions, // as long as you use it properly. The buff_size // field must always be maintained to reflect // the total capacity of 'buff' in bytes. The // storage _should_ be allocated from 'zone'. // If you use the 'buff' pointer to hold something // else (like a temporary pointer to a copy of // a cell,) you MUST restore the 'buff' pointer // to its previous value. // // struct MiscEntrySortInfo // // slot The original (physical) index of the slot that // this entry corresponds to. // // ascending Sort direction: 1=ascending, 0=descending. // // value_func The address of the function that will be // value_target called to get the values for the comparison. // value_sel The function must match the argument pattern // of the -tableScroll:intValueAt:: method, but // the data-type of the return value depends on // the sort-type of the slot. The // -sortInfoInit:border: method determines which // object will supply the values for the slot // (value_target), and which message should be // used to retrieve the value (value_sel). Then // it calls [value_target methodFor:value_sel] // to get the address of the function // (value_func). The value_func is called // directly during sorting, rather than going // through the normal Objective-C dispatch. // // value_obj The object that will be passed as the // 'tableScroll:' argument to the 'value_func' // function. This is usually the table scroll // itself. // // cell_at_func Address of the tableScroll:cellAt:: function. // cell_class Last cell class seen in this slot. // cell_sel Selector to extract value (intValue,etc.) // cell_func Address of the cell's cell_sel function. // // sort_type The sort-type for this slot. // // compare_func Comparison function to use for this slot. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // MISC_TS_TYPE_AT // This macro generates a function prototype typedef that describes the // methods used to retrieve the values for comparison during sorting. // The macro is used to generate function prototypes for each data-type // that can be compared. These prototypes describe the arguments passed // to a function that has the same format as the following standard // delegate message: // - (int) tableScroll:(MiscTableScroll*)tableScroll // intValueAt:(int)row :(int)col // The data-type for the return value is different for each of the // data-types. //----------------------------------------------------------------------------- #define MISC_TS_TYPE_AT( TYPE, NAME ) \ typedef TYPE (*MISC_TS_##NAME##_AT)(id,SEL,id,int r,int c, ...); MISC_TS_TYPE_AT( int, INT ) // MISC_TS_INT_AT MISC_TS_TYPE_AT( float, FLOAT ) // MISC_TS_FLOAT_AT MISC_TS_TYPE_AT( double, DOUBLE ) // MISC_TS_DOUBLE_AT MISC_TS_TYPE_AT( char const*, STRING ) // MISC_TS_STRING_AT typedef union { MISC_TS_INT_AT i; MISC_TS_FLOAT_AT f; MISC_TS_DOUBLE_AT d; MISC_TS_STRING_AT s; } MISC_TS_VAL_AT_FUNC; //----------------------------------------------------------------------------- // MISC_TS_TYPE_VAL // This macro generates a function prototype typedef that describes // the value-access methods for a cell. They match the following // pattern: // - (int) intValue // The data-type for the return value is different for each. //----------------------------------------------------------------------------- #define MISC_TS_TYPE_VAL( TYPE, NAME ) \ typedef TYPE (*MISC_TS_##NAME##_VAL)(id,SEL); MISC_TS_TYPE_VAL( int, INT ) // MISC_TS_INT_VAL MISC_TS_TYPE_VAL( float, FLOAT ) // MISC_TS_FLOAT_VAL MISC_TS_TYPE_VAL( double, DOUBLE ) // MISC_TS_DOUBLE_VAL MISC_TS_TYPE_VAL( char const*, STRING ) // MISC_TS_STRING_VAL typedef union { MISC_TS_INT_VAL i; MISC_TS_FLOAT_VAL f; MISC_TS_DOUBLE_VAL d; MISC_TS_STRING_VAL s; } MISC_TS_VAL_FUNC; // *** WARNING *** // The sizes of these structures are likely to change between versions. // *** WARNING *** struct MiscEntrySortInfo { int slot; int ascending; MISC_TS_VAL_AT_FUNC value_func; id value_target; SEL value_sel; id value_obj; IMP cell_at_func; id cell_class; SEL cell_sel; MISC_TS_VAL_FUNC cell_func; MiscSortType sort_type; MiscCompareEntryFunc compare_func; }; struct MiscSlotSortInfo { MiscTableScroll* table_scroll; NXZone* zone; MiscBorderType border_type; int num_entries; MiscEntrySortInfo const* entry_info; BOOL need_copy; char* buff; int buff_size; }; #endif // __MiscTableTypes_h MiscKit/Palettes/MiscTableScroll/misckit/MiscIntList.h100444 1750 1750 5511 6757716152 23255 0ustar sunshinesunshine#ifndef __MiscIntList_h #define __MiscIntList_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // // // An Objective-C "List" of integers. This object works like the // the "List" class, but this object allows elements to be zero (0). // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscIntList.h,v 1.5 97/01/22 04:00:56 sunshine Exp $ // $Log: MiscIntList.h,v $ // Revision 1.5 97/01/22 04:00:56 sunshine // v0.117: Added explicit (id) return types. Updated formatting. // // Revision 1.4 96/07/16 22:00:48 zarnuk // Added searching methods. // // Revision 1.3 95/10/03 04:57:48 sunshine // Fixed -init so Storage is allocated from [self zone]. Added copyFromZone:, // initFromString:, and addIntList:. //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END @class Storage; typedef int (*MiscIntListCompareFunc)( void* userData, int x, int y ); @interface MiscIntList : Object { Storage* array; } - (id)init; // Designated initializer - (id)initFromString:(char const*)s; - (id)free; - (id)copyFromZone:(NXZone*)zone; - (id)empty; - (unsigned int)count; - (int)intAt:(unsigned int)pos; - (void)addInt:(int)value; - (void)addIntList:(MiscIntList*)list; - (void)insertInt:(int)value at:(unsigned int)pos; - (void)removeIntAt:(unsigned int)pos; - (void)replaceIntAt:(unsigned int)pos with:(int)value; - (void)sort; - (void)sortUsing:(MiscIntListCompareFunc) cmp_func data:(void*)data; - (int)lsearch:(int)x; - (int)lsearch:(int)x using:(MiscIntListCompareFunc)func data:(void*)data; - (int)bsearch:(int)x; - (int)bsearch:(int)x using:(MiscIntListCompareFunc)func data:(void*)data; - (char*)writeToString; // Automatically allocated, caller must free. - (char*)writeToString:(char*)buff size:(int)buff_size; - (char*)writeToString:(char*)buff size:(int)buff_size canExpand:(BOOL)flag; - (int)readFromString:(char const*)s; - (int const*)rawData; @end #endif // __MiscIntList_h MiscKit/Palettes/MiscTableScroll/misckit/MiscExporter.h100444 1750 1750 7712 6757716147 23510 0ustar sunshinesunshine#ifndef __MiscExporter_h #define __MiscExporter_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporter.h // // Object that exports the contents of an MiscTableScroll in // various useful formats. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporter.h,v 1.2 96/09/25 17:09:06 zarnuk Exp $ // $Log: MiscExporter.h,v $ // Revision 1.2 96/09/25 17:09:06 zarnuk // Added commonInstance. exportTableScroll:(toFilename:) methods now return // an integer success/fail code. // // Revision 1.1 96/09/25 11:53:59 zarnuk // Exports the contents of table scroll in various formats. // //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END @class MiscTableScroll; typedef enum { MISC_EXPORT_ASCII_FIXED, MISC_EXPORT_ASCII_TAB, MISC_EXPORT_ASCII_DELIMITED, MISC_EXPORT_DBF } MiscExportFormat; #define MISC_EXPORT_FORMAT_FIRST MISC_EXPORT_ASCII_FIXED #define MISC_EXPORT_FORMAT_LAST MISC_EXPORT_DBF #define MISC_EXPORT_FORMAT_DEFAULT MISC_EXPORT_ASCII_FIXED typedef enum // For ASCII formats only. { MISC_EXPORT_TITLES_OFF, // No titles. MISC_EXPORT_TITLES_ON, // Full width, expand column if needed. MISC_EXPORT_TITLES_WRAP, // Wrap titles within data width. MISC_EXPORT_TITLES_TRUNCATE, // Truncate titles to data width. } MiscExportTitleMode; #define MISC_EXPORT_TITLES_FIRST MISC_EXPORT_TITLES_OFF #define MISC_EXPORT_TITLES_LAST MISC_EXPORT_TITLES_TRUNCATE #define MISC_EXPORT_TITLES_ROW_DEFAULT MISC_EXPORT_TITLES_OFF #define MISC_EXPORT_TITLES_COL_DEFAULT MISC_EXPORT_TITLES_ON typedef enum { MISC_EXPORT_GRID_OFF, // No grid MISC_EXPORT_GRID_LINE, // Lines, col-grid='|', row-grid='-' MISC_EXPORT_GRID_SPACE, // Spaces col-grid=' ', row-grid=' ' } MiscExportGridMode; #define MISC_EXPORT_GRID_FIRST MISC_EXPORT_GRID_OFF #define MISC_EXPORT_GRID_LAST MISC_EXPORT_GRID_SPACE #define MISC_EXPORT_GRID_ROW_DEFAULT MISC_EXPORT_GRID_OFF #define MISC_EXPORT_GRID_COL_DEFAULT MISC_EXPORT_GRID_LINE @interface MiscExporter : Object { MiscTableScroll* tableScroll; // Defaults MiscExportFormat exportFormat; // MISC_EXPORT_ASCII_FIXED MiscExportTitleMode rowTitleMode; // MISC_EXPORT_TITLES_OFF MiscExportTitleMode colTitleMode; // MISC_EXPORT_TITLES_ON MiscExportGridMode rowGrid; // MISC_EXPORT_GRID_OFF MiscExportGridMode colGrid; // MISC_EXPORT_GRID_LINE } - init; - (int) exportTableScroll:(MiscTableScroll*)ts; // Run SavePanel. - (int) exportTableScroll:(MiscTableScroll*)ts toFilename:(char const*) name; - (void) setExportFormat:(MiscExportFormat)exportFormat; - (void) setRowExportTitleMode:(MiscExportTitleMode)rowTitleMode; - (void) setColExportTitleMode:(MiscExportTitleMode)colTitleMode; - (void) setRowExportGridMode:(MiscExportGridMode)rowExportGridMode; - (void) setColExportGridMode:(MiscExportGridMode)colExportGridMode; - (MiscExportFormat) getExportFormat; - (MiscExportTitleMode) getRowExportTitleMode; - (MiscExportTitleMode) getColExportTitleMode; - (MiscExportGridMode) getRowExportGridMode; - (MiscExportGridMode) getColExportGridMode; + (MiscExporter*) commonInstance; @end #endif // __MiscExporter_h MiscKit/Palettes/MiscTableScroll/misckit/Makefile100444 1750 1750 40 6757716177 22301 0ustar sunshinesunshineall: clean: install: debug: MiscKit/Palettes/MiscTableScroll/HISTORY.txt100444 1750 1750 240067 6757716170 21210 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll HISTORY // $Id: HISTORY.txt,v 1.92 99/06/29 08:00:18 sunshine Exp $ //----------------------------------------------------------------------------- v0.140 1999/06/29 04:15 EDT sunshine@sunshineco.com Synchronized with MiscTableScroll v140.1 for OpenStep. Updated copyright and contact information in README. Renamed abbreviated titles on MiscExporterAccessoryView from "Col Titles" and "Col Grid" to "Column Title" and "Column Grid", respectively. Rewrote MiscExporterAccessoryView so that layout of controls is dynamic, based upon their sizes, rather than using hard-coded coordinates. Removed unused -getWidth: from MiscTableViewPrint.M. Converted the slot list on the inspector from a matrix of buttons to a TableScroll (via CustomView). Reworked the color setting controls on the TableScroll inspector nib. Now provides user with ability to preview color selections by providing two text field which adopt the chosen colors for text and background. One text field previews selected cells, and the other unselected. This configuration also makes better use of window real-estate. Fixed bug: MiscTableBorder::clearCursor() was broken, making it a no-op. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Documentation of prototype for -reviveCell:at:: was slightly botched. Documentation for these methods was botched: -changeFont: -setColTitleMode: -setColTitlesHeight: -setRowTitleMode: -borderTitleMode: -tableScroll:highlightBackgroundColorChangedTo: -tableScroll:highlightTextColorChangedTo: -tableScroll:textColorChangedTo: The method summary for -border:slotSortReversed: in the documentation was missing. Documentation for -border:setUniformSizeSlots: made invalid claim about not being able to resize uniform size slots. This restriction was lifted in v133. Explained the for-all-cells portion of -sendAction:to:forAllCells: in documentation. The meaning of "forAllCells" is not clear by itself. Added new "Delegates" section to documentation. Fixed bug: -[MiscTableScroll changeFont:] was sending -convertFont: directly to the shared FontManager rather than "sender" as documented. Now sends the message to "sender", which is assumed to be a FontManager or similarly capable object. Fixed bug: -[MiscTableScroll sizeToFit] wasn't taking intercell grid into account when computing slot sizes. Added facility which informs TableScroll when the TableView changes first responder status. Added methods -didBecomeFirstResponder and -didResignFirstResponder which subclasses may override as needed. TableView sends these messages to TableScroll at the appropriate times. Added delegate methods -tableScrollDidBecomeFirstResponder: and -tableScrollDidResignFirstResponder: Documented new methods. Fixed bug: MiscTableTypes.h was incorrectly exporting MiscDefaultCompareSlotFunc(). It failed to use extern "C" which meant that the name was mangled and inaccessible to Objective-C clients. Significant updates to mcgh2misc scripts. Now filters output of Emacs batch processing so that only important messages are displayed instead of spewing an enormous amount of output. Source and target directories can now be specified on the command line and default to sane values if omitted. Removed requirement that script be run from within MiscTableScroll source directory. No longer copies RCS directories to target. Now files are checked out from source RCS directories directly into target locations. Added usage statement and -help option. Now optionally copies MiscKit license files, if present, into target. Simplified EXPAND() which was doing unnecessary work. WHATS_LOCKED() now takes the directory as an argument instead of assuming the current working directory. Simplified save and rename logic in lisp code. Now disables Emacs auto-save and backup-file creation. Renamed lisp functions and variables to better reflect their actual meaning. Added copyright notice. No longer converts tabs from 8 to 4 characters. This change was motivated by a personal desire to distribute code formatted in a fashion which I prefer. Thus this project will no longer adhere to the MiscKit guideline for 4-character tabs. Created an English.lproj directory and moved the nib files into it. Updated GNUmakefile to handle English.lproj via SRCDIRS. Cleaned up IBConnector.h and added copyright notice. Synchronized pack.sh with OpenStep pack.sh by merging in freeze.sh. Ported back to NextStep 3.2. Had to add -I. directive to OTHER_CFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize the -I directives which are specified via Project Builder in NextStep 3.3. Textually re-ordered inline functions in MiscTableBorder.h to appease compiler which could not deal with isSortable() calling getSortFunc() and getSortType() before they were declared. Compiler complained about signed vs. unsigned comparisons and assignments in MiscExporterDBF.M, MiscSparseSet.cc, MiscTableBorderSel.cc, MiscTableScrollISearch.M, MiscTableScrollSort.M. Changed Files: - freeze.sh * GNUmakefile * IBConnector.h * Makefile * Makefile.{preamble|postamble} * MiscDelegateFlags.{h|cc} * MiscExporterAccessoryView.M * MiscExporterDBF.M * MiscSparseSet.cc * MiscTableBorder.h * MiscTableBorderSel.cc * MiscTableConnector.h * MiscTableScroll.{h|M|rtf} * MiscTableScrollInspector.{h|M|nib} * MiscTableScrollISearch.M * MiscTableScrollSort.M * MiscTableTypes.h * MiscTableViewCursor.M * MiscTableViewPrint.M * MiscTableTypes.h * mcgh2misc.{el|sh} * pack.sh * PB.project * README.rtf + English.lproj > *.nib --> English.lproj/*.nib v0.139 1998/05/11 20:42 EDT zarnuk@zarnuk.com Fixed the MiscTableBorder.cc:1094: failed assertion `0 <= x' bug. Fixed the MiscTableBorder.cc:1094: failed assertion `x < num_slots' bug. These bugs were caused by the fact that the AppKit allows 0-3 pixels' worth of slop on multi-click events -- even when the new location is outside the bounds of the view that recieved the first mouse-down event. Changed Files: * MiscTableView.M * MiscBorderView.M v0.138 1998/03/31 04:07 EST sunshine@sunshineco.com Changes to MiscTableScroll.rtf: - Fixed typographical errors - Clarified -editCellAt:: - Described return value of -borderSetSlotSizes: - Fixed -getNext:editRow:andCol: to refer to -canEdit:at:: - Added missing descriptions for: canEdit:at:: editIfAble:at:: edit:at:: textDidChange: textDidEnd:endChar: textDidGetKeys:isEmpty: textWillChange: textWillEnd: MiscTableBorder::write() was declaring same variable twice. Removed junk/unused -[MiscTableScroll calcWidths:heights:maxW:maxH:]. Removed excess #import's from MiscTableScrollIO.M. MiscTableBorder's setMinUniformSize() & setMaxUniformSize() were declared as returning a value, but neglected to do so. Removed a useless 'if' statement from -[MiscTableScroll border:setSlotOrder:]. Fixed bugs: Methods failed to check -canDraw before sending -lockFocus: -[MiscTableScroll drawCellAt::] -[MiscTableScroll drawCol:] -[MiscTableScroll drawRow:] -[MiscTableScroll drawSlotTitle:] Added -[MiscTableView shouldDelayWindowOrderingForEvent:] to control window ordering during dragging-source operations. Added delegate method -tableScroll:shouldDelayWindowOrderingForEvent: and documented it. README modifications: - Updated email address. - Updated copyright notice. Fixed #import ("..." vs. <...>) in MiscTableViewCursor.M so that it compiles as part of the MiscKit distribution. Fixed v134 bug: -[MiscBorderView mouseDown:] was calling -suspendEditing when border view was used to change selection. This allowed the slot selection to change while allowing editing to continue. This resulted in a high "surprise factor" and was inconsistent in these ways: a) slot selection via MiscTableView always ends editing, b) broke the relation where the slot containing the edit session is the one *and* only selected slot, c) potentially broke the relationship where -clicked{Row|Col} return the slot containing the edit session (for instance, [Lazy]ScrollDir requires this relationship to be true). Fixed mcgh2misc.sh to deal correctly with new MiscAlign{Left|Center|Right} images in MiscTableScrollInspector.nib. Changed Files: * MiscBorderView.M * MiscDelegateFlags.{h|cc} * MiscTableBorder.h * MiscTableBorderIO.cc * MiscTableScroll.{h|M|rtf} * MiscTableScrollIO.M * MiscTableViewCursor.M * MiscTableViewDrag.M * mcgh2misc.sh * README.rtf v0.137 1998/02/25 13:49 EST zarnuk@zarnuk.com border:setSlotOrder: now accepts a null pointer to "unsort" the slots. Changed Files: * MiscTableScroll.{M|rtf} * MiscTableBorder.{cc|h} v0.136 1998/02/19 16:36 EST zarnuk@zarnuk.com Now uses NXOrderStrings for sorting and incremental search. Changed Files: * MiscTableScrollSort.M * MiscTableScrollISearch.M v0.135 1998/02/16 17:53 EST zarnuk@zarnuk.com Fixed v130 bug: inspector -- up/down buttons stopped working. Changed Files: * MiscTableBorder.{cc|h} * MiscTableScrollInspector.M v0.134 1997/12/22 13:50 EST zarnuk@zarnuk.com Fixed bug: current editing updates were lost if columns were dragged or resized while editing was in progress. Added suspendEditing/resumeEditing. Eliminated delegate -tableScroll:edit:at:: methods. Changed Files: * MiscBorderView.M * MiscDelegateFlags.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollEdit.M + MiscTracer.{cc|h} v0.133 1997/11/22 13:24 EST zarnuk@zarnuk.com Fixed v1 bug: bad range calculations in MiscBorderView.M Fixed v132 bug: Inspector was not calling sizeToCells after adding rows. Added -sizeToFit. Eliminated the forced requirement for scrollers. Added documentation for the printing methods. Various minor corrections to the documentation. Turned on autoSortRows in the palette. Removed obsolete declaration from MiscTableBorder.h. Combined sort-dir and sort-type in MiscTableBorder. Now passes the version to MiscTableBorder::read(). Bumped the version, new storage layout. Broke-off IO routines from massive MiscTableScroll.M file. Eliminated ill-defined and un-implemented "expands-to-data" feature. I finally implemented this, and discovered that the resulting behavior was horrible. Eliminated constrain-min methods. Functionality retained, but it is now implicit based on the presence or absence of auto-size slots. Their presence was always a requirement anyway. Eliminated constrain-max functionality and methods entirely. This was introduced for symmetry with constrain-min, but it made the resizing calculations in MiscTableBorder considerably more complicated, and could only work by making slots smaller than the sizes specified by the user, and was generally a pretty artificial feature all together. We have never used it at mcgh. Eliminated {get|set}{Min|Max}Total{Size|Height|Width} methods. Unnecessary when auto-sizing is automatic. The internal -constrainSize method, which was called from all over the place was clobbering those values with the values from the size of the frame anyway. Renamed MiscNullView.{h|M} -> MiscCornerView.{h|M} Added -cornerTitle, -setCornerTitle:. User can now resize uniform-size borders. Added -{get|set}{Min|Max}UniformSize{Slots|Rows|Cols} methods. Added -{get|set}DrawClippedText. Corner view now prints. RCS files are now tagged by pack.sh Added cell-alignment control to inspector. Changed Files: + freeze.sh * Makefile + MiscAlign{Center|Left|Right}.tiff * MiscBorderView.M + MiscCornerView.{h|M} * MiscDrawList.{cc|h} - MiscNullView.{h|M} * MiscTableBorder.{cc|h} * MiscTableBorderIO.cc * MiscTableScroll.rtf * MiscTableScroll.{h|M} * MiscTableScrollInspector.{h|M|nib} + MiscTableScrollIO.M * MiscTableScrollPalette.M * MiscTableScrollPrivate.h * MiscTableTypes.h * MiscTableUtil.h * MiscTableView.{h|M} * MiscTableViewPrint.M * pack.sh * PB.project v0.132 1997/11/16 17:58 EST zarnuk@zarnuk.com Restored call to [super tile], but using dummy content view. Renamed MiscTableBorder{_io|_sel}.cc --> *{IO|Sel}.cc Changed Files: * Makefile * MiscTableBorderIO.cc * MiscTableBorderSel.cc * MiscTableScroll.M * PB.project v0.131 1997/11/14 21:22 EST zarnuk@zarnuk.com Fixed printing problems: - orientation (landscape vs. portrait) - pagination (fit vs. auto vs. clip) - centering (horizontal and vertical) - scalingFactor Changed Files: * MiscTableViewPrint.M v0.130 1997/11/14 20:50 EST zarnuk@zarnuk.com Eric: Corrected filenames in README.rtf Restored the executable settings on the shell scripts. Fixed v123 bug -- -border:selectSlot: was infinite recursion. -isSelectable now returns NO when the table is empty. Broke up the massive MiscTableView.M file a little. Broke up the massive MiscTableBorder.cc file somewhat. No longer maintaining so many arrays in visual order in MiscTableBorder. Fixed v1 bug -- -tile was not implemented properly. Fixed v1 bug -- border views were not positioned properly when toggled on. Changed Files: * Makefile * MiscTableBorder.{cc|h} + MiscTableBorder_io.cc + MiscTableBorder_sel.cc * MiscTableScroll.M + MiscTableScrollSel.M * MiscTableView.{h|M} + MiscTableViewCursor.M + MiscTableViewDrag.M + MiscTableViewPrivate.h * MiscTableUtil.h * PB.project * README.rtf * *.sh *********************************************************************** **** MiscKit 2.0.5 Release contains v0.129.1 for OPENSTEP **** *********************************************************************** *********************************************************************** **** MiscKit 2.0.4 Release contains v0.129.1 for OPENSTEP **** *********************************************************************** *********************************************************************** **** MiscKit 1.10.0 Release contains v0.129 for NEXTSTEP **** *********************************************************************** *********************************************************************** **** Released as MiscTableScroll v129.1 for OPENSTEP on 07/13/1997 **** *********************************************************************** *********************************************************************** **** Released as MiscTableScroll v129 for NEXTSTEP on 07/13/1997 **** *********************************************************************** v0.129 1997/07/11 17:49 EDT sunshine@sunshineco.com Fixed wording of "Errors" section. Added a *FIXME* to MiscTableScroll.rtf. Synchronized mcgh2misc with version from OPENSTEP MiscTableScroll v128.1. Fixed wording in README. Changed Files: * MiscTableScroll.rtf * mcgh2misc.sh * README.rtf v0.128 1997/07/01 10:27 EDT sunshine@sunshineco.com Added a README file which details how to build & install the palette. Added missing descriptions for -borderTitlesSize:, -colTitlesHeight, and -rowTitlesWidth to documentation. Fixed bug: Delegate messages for text color and highlighted text color were reversed. Was sending one when it should have been sending other. Published and documented the exception code which MiscTableScroll raises upon an assertion failure. For publication as standalone MiscKit palette, added new targets to Makefile.postamble: install_lib, install_headers, install_docs, install_all. Added new variables to Makefile.preamble to support customization of installation locations. Fixed mcgh2misc script to handle new installation variables in Makefile.preamble. Fixed mcgh2misc script so that new README.rtf doesn't get installed as one of PUB_DOCS. Fixed a number of places in documentation where conversion via mcgh2misc results in poor wording, such as: "an MiscTableScroll" --> "an MiscTableScroll". mcgh2misc conversion script now works off of RCS directory rather than copying entire source tree. Can now convert source tree which includes subdirectories (subprojects and language projects). mcgh2misc now makes the converted files read-only. Can now run mcgh2misc in an incremental fashion. Changed Files: * Makefile.{preamble|postamble} * MiscAssert.cc * MiscDelegateFlags.{h|cc} * MiscExporter.rtf * MiscIntList.rtf * MiscTableCell.rtf * MiscTableScroll.rtf * MiscTableTypes.h * mcgh2misc.sh + README.rtf v0.127 1997/06/10 05:58 EDT sunshine@sunshineco.com MiscTableCell is now scrollable by default thus simplifying creation of editable columns. Fixed bug: -[MiscTableCell copyFromZone:] was making an allocation from the wrong zone. Fixed bug: -getRow:col:forPoint: was incorrectly returning 'self' when point was outside of bounds. Now returns 'nil' in this case to be consistent with Matrix. Updated documentation accordingly. Fixed bug: Wasn't grabbing a copy of the cell when editing was started in lazy mode. Was only latching a reference to cell. If any scrolling occurred while editing was in progress (even the scroll-to-visible which happens when editing starts), the contents of the cell could be blasted -- since typically in lazy mode, a single cell is used for all drawing in a column. The cell is now copied, so its contents are valid throughout the duration of the edit session. Fixed bug: Tabbing from cell to cell during editing wasn't adjusting the keyboard cursor -- it was lagging behind. First responder status is now returned to the TableScroll when cell editing ends via the Return key, rather than reverting uselessly to the window. Fixed bug: Keyboard cursor was being unconditionally drawn when -setCursor{Row|Col}: was called -- even if it shouldn't have been (for instance, if the MiscTableScroll was not first responder, or the cursor had been disabled). Fixed bug: Feedback from incremental-search was drawing outside of the MiscTableScroll's frame. Consequently the portion outside of the frame was not getting erased. Added MiscAssert() macro which throws an exception rather than calling abort(). Thus assertion failures can now be caught and logged, unlike the standard assert(). Modified all source code to use this new macro. Did considerable work on all documentation (MiscTableScroll, MiscTableCell, MiscExporter, MiscIntList): - Added missing -getCellFrame:at::. - Added missing -getRow:andCol:forPoint: to method-list. - Fixed broken vertical formatting in method-list (thus reducing vertical size). - Added a "Methods Implemented by Cell Subclasses" section to MiscTableScroll.rtf and moved descriptions of -tableScroll:retireAt:: and -tableScroll:reviveAt:: there from "Methods Implemented by Delegate" since they are not strictly delegate methods. - Removed many more of the really obvious "See Also" entries. - Unified formatting *throughout*. - Synchronized with OPENSTEP version of each of the MiscTableScroll documents in v125.9. The binary-file pack & unpack scripts no longer error out if tiffs or nibs are non-existent and are synchronized with MiscTableScroll v125.9 for OPENSTEP. Rewrote pack.sh script so that it knows about subprojects and lproj directories (so we can now easily localize if preferred). Now synchronized with MiscTableScroll v125.9 for OPENSTEP. Copied unpack.sh from the MiscTableScroll v125.9 for OPENSTEP whichs knows about subprojects and lproj directories and performs the RCS check-out and .uu file unpacking (so we can now easily localize if preferred). Moved build options from Makefile.preamble into PB.project. Changed Files: * Makefile * Makefile.preamble + MiscAssert.{h|cc} * MiscBorderView.M * MiscExporter.rtf * MiscIntList.rtf * MiscLineWrapper.cc * MiscSparseSet.cc * MiscTableBorder.cc * MiscTableCell.{h|M|rtf} * MiscTableScroll.{M|rtf} * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableScrollISearch.M * MiscTableScrollSort.M * MiscTableView.M * MiscTableViewPrint.M * pack.sh * pack_binaries.sh * PB.project + unpack.sh * unpack_binaries.sh v0.126 1997/05/04 18:35 EDT zarnuk@zarnuk.com Fixed several errors in the documentation. Fixed some minor compiler warnings. Changed Files: * MiscDelegateFlags.cc * MiscExporterDBF.M * MiscTableScroll.rtf * MiscTableTypes.h * MiscTableView.M v0.125 1997/03/14 01:32 EST zarnuk@zarnuk.com Fixed v121 bug: fonts were not being restored properly in the -[MiscTableCell tableScroll:reviveAt::] method. Optimized the method slightly. Changed Files: * MiscTableCell.{M|rtf} v0.124 1997/02/12 12:58 EST sunshine@sunshineco.com Added clipping back to -[MiscTableView drawSelf::] so that we don't draw outside of the update rectangles passed in. This way we don't clobber subviews. Changed Files: * MiscTableView.M v0.123 1997/02/11 19:11 EST sunshine@sunshineco.com Added selection methods: -border:selectSlot:byExtension: -selectRow:byExtension: -selectCol:byExtension: -border:selectTags:byExtension: -selectRowTags:byExtension: -selectColTags:byExtension: -border:selectSlots:byExtension: -selectRows:byExtension: -selectCols:byExtension: Following methods no longer 'extend' selection: -border:selectSlot: -selectRow: -selectCol: Added deselection methods: -border:deselectSlot: -deselectRow: -deselectCol: -border:deselectTags: -deselectRowTags: -deselectColTags: -border:deselectSlots: -deselectRows: -deselectCols: -deselectAll: Documented all the new methods. Fixed bug: -border:selectSlots: was not checking for valid slots. It was allowing *any* slot to be added to the selection even if non-existent. (Also affected -selectRows: & -selectCols:.) Fixed bug: Although MiscTableScroll was taking autoDisplay into account in -reflectSelection, neither MiscBorderView nor MiscTableView was. Got rid of -reflectSelection in favor of -selectionChanged since their functionality was identical. Updated documentation accordingly. Published and documented -selectedCell. Cleaned up documentation some more. Inlined a use-owner-font check in MiscTableCell's high-frequency -tableScroll:reviveAt:: method. Removed the unused -putImage:atPoint: method from MiscTableViewPrint.M. Removed the unused -tooSmall method in MiscTableViewPrint.M. Fixed bug: MiscTableViewPrint was leaking every single NXImage that its -getImage... methods created. Removed the unnecessary code in MiscTableView's -drawSelf:: which sets up a clipping rect if there are subviews. It was not needed at all since no drawing of subviews occurs inside of -drawSelf::. Fixed bug: MiscDrawList was using the screen-font unconditionally -- even when printing (not drawing to the screen). Fixed bug: The delegate methods for printing -tableScrollWillPrint: and -tableScroll:didPrint: were getting subverted if the -printPSCode: message was sent to the firstResponder rather than the MiscTableScroll itself. (The firstResponder is really the MiscTableView.) This can easily happen if the Print... item is connected to First Responder in IB. Changed Files: * MiscBorderView.{h|M} * MiscDrawList.cc * MiscTableBorder.{h|cc} * MiscTableCell.M * MiscTableScroll.{h|M|rtf} * MiscTableScrollKB.M * MiscTableScrollPrint.M * MiscTableView.{h|M} * MiscTableViewPrint.M v0.122 1997/02/05 07:08 EST sunshine@sunshineco.com Fixed bug: Although setting cell's highlight flag during mouse tracking is fine for eager-mode, it is insufficient for lazy-mode. Fixed by adding 'tracking' flag which is used in lazy-mode to determine when cell should be drawn highlighted. Updated documentation accordingly. Clarified misleading documentation for -trackBy: and -trackingBy. Changed Files: * MiscTableScroll.{h|M|rtf} * MiscTableData.M * MiscTableScrollPrivate.h * MiscTableView.M v0.121 1997/02/04 08:10 EST sunshine@sunshineco.com Fixed some #import/#include statements (<...> vs. "...") so that the palette once again compiles as part of the MiscKit distribution. Updated to reflect which MiscKit versions contain which MiscTableScroll versions. Changed Files: * MiscDrawList.cc * MiscTableCell.M * MiscTableView.M v0.120 1997/02/04 04:56 EST sunshine@sunshineco.com Fixed bug: -[MiscTableView mouseDown:] was not sending the tracker a -mouseUp:atPos: message if the mouse went up during tracking of the cell in which it originally went down. Thus trackers which have non-empty -mouseUp:atPos: methods were malfunctioning. For instance, this broke deselect by shift-click in MiscRadioTracker. (v113 bug) Fixed bug: When deleting the selected slot, MiscTableBorder::deleteAt() wasn't coercing selectedSlot to a valid value. Instead it was just setting it to -1. This was inconsistent with other parts of the object which ensure that selectedSlot *always* points to a selected slot unless there are none in which case it is set to -1. Fixed bug: MiscTableBorder::moveFromTo() was adjusting the selectedSlot before it ensured that said slot was indeed in the selected-slot set. Since setSelectedSlot() calls MiscSparseSet::coerce(), wasn't necessarily set to what it was presumed to be set as. (Switched the order of the statements around to fix it.) Fixed bug: MiscTableBorder::setCount() was incorrectly setting selectedSlot to -1 rather than coercing it to a valid slot in the selection set. Fixed bug: MiscTableBorder::setCount() was incorrectly clearing the selection when it should have been clearning the cursor. Changed Files: * MiscTableBorder.M * MiscTableView.M v0.119 1997/01/23 22:36 EST sunshine@sunshineco.com Combined -setClickedRow: & -setClickedCol: since they are *always* called in combination. Added -resetSelection to MiscTableScroll and published it in MiscTableScrollPrivate.h. It calls -resetSelection in the border and table views. Fixed bug: The "remembered" selection in border and table views was not being taken into account when adding/removing slots. Hence the next selection reflection via -reflectSelection was incorrect. Removed unnecessary loop in MiscSparseSet::shiftDownAt(). Fixed bug: MiscTableScroll's -border:setUniformSizeSlots: was setting the ScrollView's line-scroll amount to 0 if uniform-size was 0. (This had the effect of making the line-scroll buttons inoperable.) Fixed bug: Cell wasn't scrolled to visible when editing was initiated, so it was possible, with tab and shift-tab, to edit a cell which was not visible. Fixed bug: MiscTableView's -getCursorSlot would crash if the border had a selection but not a selected slot. (This can actually happen if the selected slot gets deleted. Maybe TableBorder should be modified so that it *always* has a selected-slot whenever it has a selection?) Changed Files: * MiscSparseSet.cc * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.M v0.118 1997/01/22 07:02 EST sunshine@sunshineco.com Fixed bug: MiscSparseSet::remove(int) was not taking into account that insertAt() may have called realloc(). This led to (1) writing to memory which had been freed() by realloc(), and (2) failure to set the 'hi' anchor correctly (it was setting 'hi' in the old freed memory rather than at its new location after realloc()). MiscSparseSet::shiftDown() now folds out newly adjacent ranges. MiscSparseSet::dump() now detects corruption. Changed Files: * MiscSparseSet.cc v0.117 1997/01/22 03:38 EST sunshine@sunshineco.com Fixed bug: MiscIntList's std_cmp() was returning 0 when (x > y). Changed Files: * MiscIntList.{h|M} v0.116 1997/01/12 12:30 EST sunshine@sunshineco.com Fixed bug: MiscTableView's mouse tracking code was not taking non-opaque cells into account when [de]highlighting. Fixed bug: Mouse tracking code was not checking for disabled cell. The icon/image is no longer cleared when retiring cells. Change Files: * MiscTableCell.M * MiscTableScrollData.M * MiscTableView.M v0.115 1997/01/10 08:15 EST sunshine@sunshineco.com Fixed bug: MiscTableCell's -tableScroll:reviveAt:: wasn't latching the owner's font in all cases. It would only latch it if the owner changed or if it was not already using owner-font, but not in the most common case where the owner was the same and it was already using owner-font. (Bug introduced in v0.111.) Changed Files: * MiscTableCell.M v0.114 1997/01/06 05:15 EST sunshine@sunshineco.com Fixed bug introduced in v0.112. MiscTableView's -drawCol: was incorrectly referring to row_border rather than col_border. This bug frequently resulted in crashes (assertion: x < num_slots) during column dragging, as well as the failure to redraw a column if it was dropped back where it started (after the "well" was removed). Fixed messed up wording in documentation from v0.113. Fixed bug: mcgh2misc.sh wasn't publishing MiscExporter.h correctly. Changed Files: * MiscTableScroll.rtf * MiscTableView.M * mcgh2misc.sh v0.113 1996/12/30 16:36 EST zarnuk@zarnuk.com Implemented text-cell editing. Added methods to set the sizes of the borders. Fixed bugs in the "clicked" stuff. Changed Files: * Makefile * MiscBorderView.{h|M} * MiscTableBorder.h * MiscTableScroll.{h|M|rtf} + MiscTableScrollEdit.M * MiscTableView.{h|M} * MiscDelegateFlags.{cc|h} * PB.project v0.112 1996/12/17 21:07 EST sunshine@sunshineco.com Added -borderClickedSlot:, -clickedRow, -clickedCol, and -clickedCell. To conform to OpenStep UI guidelines, keyboard-focuser is now drawn as a non-blinking dotted rectangle. Made physicalToVisual() and visualToPhysical() more robust by having them check for invalid slot rather than having to do so manually every place which calls either one. -drawRow:, -drawCol: no longer do any drawing if outside of visible rect. Changed Files: * Makefile * MiscBorderView.M * MiscTableBorder.{h|cc} - MiscTableFocus.{h|M} - MiscTableFocusPS.psw * MiscTableScroll.{h|M|rtf} * MiscTableScrollKB.M * MiscTableScrollPrivate.h * MiscTableView.{h|M} + MiscTableViewPS.psw * PB.project v0.111 1996/12/16 10:26 EST zarnuk@zarnuk.com Improved performance of methods that add/remove rows from the table scroll. Changed Files: * MiscTableCell.{h|M|rtf} * MiscTableScrollData.M v0.110 1996/10/24 22:50 EDT zarnuk@zarnuk.com NOTE: I tagged the RCS files for v109 with "TableScroll-v109", and the ones for v110 with "TableScroll-v110". Added rough-draft, initial version Printing. Still needs work. Fixed bug: slot resized / reversed delegate messages were sending VISUAL coordinates instead of PHYSICAL coordinates. Fixed bug: New public headers (from v109) were not added to mcgh2misc.sh. Changed Files: * Makefile * mcgh2misc.sh * MiscDelegateFlags.{cc|h} * MiscTableScroll.{h|M} + MiscTableScrollPrint.M * MiscTableScrollPrivate.h * MiscTableTypes.h * MiscTableView.{h|M} + MiscTableViewPrint.M * PB.project v0.109 1996/09/25 09:37 EDT zarnuk@zarnuk.com Added exporter. Slot dragging and resizing no longer clobber the selection. Fixed (mostly) drag-cache drawing for row-borders. (v105 bug). Changed Files: * Makefile * MiscBorderView.M + MiscExporter.{h|M|rtf} + MiscExporterAccessoryView.{h|M} + MiscExporterASCII.M + MiscExporterDBF.M + MiscExporterPrivate.h * PB.project v0.108 1996/09/25 05:06 EDT sunshine@sunshineco.com Ripped all image dragging out of TableCell and promoted it to TableView. Can now drag images from non-NX_ICONCELL cells as well. Delegate now has chance to respond to dragging protocol messages -draggingSourceOperationMaskForLocal:, and -ignoreModifierKeysWhileDragging. Updated documentation accordingly. Fixed bugs: Image origin and mouse offset for dragging were being incorrectly computed. Added *temporary* -getCellInside:at:: to avoid places where the callers of -getCellFrame:at:: had to adjust for the border lines manually. This can be removed when the whole cell-frame / intercell spacing issue is finally resolved. Removed the -scroll hack from TableView which TableCell was using during image dragging. Fixed bug: SparseSet::coerce() was accessing array[-1]. Fixed bug: pack.sh was checking in the PACKAGE_NUMBER file *before* the new version number was recorded. pack.sh no longer redundantly includes PACKAGE_NUMBER with the package since that file now exists in the RCS directory. Changed Files: * MiscDelegateFlags.{h|cc} * MiscSparseSet.cc * MiscTableCell.{h|M|rtf} * MiscTableScroll.{h|rtf} * MiscTableView.{h|M} * pack.sh v0.107 1996/09/19 06:37 EDT zarnuk@zarnuk.com Fixed v104 bug: selectTags was not setting selectedSlot. Fixed v104 bug: alignment of the cell at (0,0) was getting clobbered on a mouseDown: Fixed v105 bug: cursor rects were not getting updated when autosort changed. All access to the selection set now goes through the MiscTableBorder object. Restored pre-v104 "selectedSlot" behavior, so that selected_slot always points to a selected slot if any slots are selected. It is only -1 if there are no selected slots. Changed Files: * MiscBorderView.{h|M} * MiscHighlightTracker.M * MiscListTracker.M * MiscMouseTracker.{h|M} * MiscRadioTracker.M * MiscSparseSet.{cc|h} * MiscTableBorder.{cc|h} * MiscTableScroll.M * MiscTableScrollISearch.M * MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.{h|M} v0.106 1996/09/13 17:10 EDT zarnuk@zarnuk.com Fixed v104 bug: slot dragged delegate notification message was botched. Fixing bug: borderSelectedSlot: was not checking for a valid selection before mapping an invalid value through the visual to physical map. Changed Files: * MiscDelegateFlags.cc * MiscTableScroll.M v0.105 1996/09/07 12:00 EDT zarnuk@zarnuk.com Restored -border:slotMovedFrom:to: and -border:slotResized: to the public header so that PCSTableScroll will compile again. Added user-sort-direction-toggling. Fixed v104 bug where text was exceeding column width on some wide columns with a lot of text. New line-height calculations, completely point-size based, ignores broken NeXT font bounding box. Font-change behavior is more predictable from the user's standpoint. Fixed drag-cache drawing. Changed Files: * MiscBorderCell.h * MiscBorderView.{h|M} * MiscDelegateFlags.{h|cc} * MiscDrawList.cc * MiscLineWrapper.cc + MiscReverseCursor.tiff + MiscSort{A|De}scend{H|}.tiff * MiscTableBorder.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollPrivate.h * MiscTableTypes.h * PB.project * Makefile * Makefile.postamble v0.104 1996/08/20 15:00 EDT sunshine@sunshineco.com Removed "cursor" from SparseSet making it a simple generic (and more widely useful) class. Added notion of selected-slot to TableBorder. This was the old "cursor" from SparseSet. Implemented -selectedCell in TableScroll (for use during mouse-tracking -- see below). TableScroll now gives cells a chance to participate in mouse tracking using standard -trackMouse:inRect:ofView:. TableCell now supports dragging of images directly out of ICON-style cells during mouse tracking. Delegate/dataDelegate can allow/veto dragging, optionally supply the dragging image (vs. using the one in the cell), and provide the actual data for the dragging pasteboard. Documented support of image dragging in TableCell. Documented mouse tracking behavior in TableScroll. Documented new keyboard control added in v0.103. Documented selection modes. Fixed bug: TableConnInspector's -initScroll:numCols: was not returning a value though it had a non-void return type. Fixed bug: Two MiscGeometry were not returning a value when they should have been. Corrected a few casts. Removed deviant semi-colons from -setColSortVector:len:, -setRowSortVector:len:, and -cursorRect:forPos: implementations. Paul added searching methods to IntList. Paul made optimizations to TableBorder's selectTags() method. Fixed pack.sh so that it checks the PACKAGE_NUMBER into RCS (so that the GNUmakefile can include it in the palette). Updated GNUmakefile so that it includes MiscTableConnector.strings and PACKAGE_NUMBER in the palette. Fixed bug: TableScroll's -border:setSlotSizes: was not respecting min/max slot size. Fixed broken next-text chain in inspector nib. Fixed bug: Setting the min-size greater, or the max-size smaller than the current-size in the inspector would crash IB. Fixed bug: TableScroll's border:selectSlot was checking for selection membership using selectedSlot() rather than slotIsSelected(). Fixed bug: Using space to select from within incremental-search was not going through the normal mouse-tracker, and was therefore short- circuiting selection mode. Added cursor for display over draggable slots. Fixed bug: Cursor rectangles were not being clipped to the visible rectangle, which meant that cursor changes would occur when the cursor was not even over the TableScroll. Moved drawing of "intercell" border from TableCell into TableView. (Cells no longer draw a border around them selves.) *NOTE* This drawing code still needs to be optimized. I did nothing more than relocate the code. (Paul optimized it -- see below.) Added -setSelected and -isSelected to TableCell. TableScroll now uses these methods to indicate that cell is part of the current selection rather than overloading the meaning of state and isHighlighted which have their own use during mouse-tracking. Pulled the *private* parts of the TableScroll interface out of TableScroll.h and placed them in the new unpublished TableScrollPrivate.h. Added MiscDelegateFlags which tracks which selectors the delegates respond to. These are determined and cached *once* when the delegate are set up. Updated all code which deals with delegate and dataDeleate to use simplified MiscDelegateFlags interface. Started implementing text editing. *** Paul's changes *** Created the MiscColorList, MiscRectList and MiscRectColorList C++ classes. Eliminated the convoluted selection-update "optimizations" from MiscTableView.M which were not properly implemented; did not result in any noticable improvement in drawing performance; and which prevented the consolidation of the drawing code. Rewrote -[MiscTableView reflectSelection] to group contiguous cells into rectangles for drawing. Rewrote -[MiscTableView drawRect:] to collapse grid and background drawing into fewer operations. Modified MiscTableCell so that -useOwner[Highlight]BackgroundColor makes the cell transparent, so that the individual cells are not painting their individual backgrounds, unless they have custom background colors. Added -ownerDraw and -setOwnerDraw: to MiscTableCell. MiscTableView now checks for -ownerDraw. New drawing mechanism for table view -- way, *way*, *WAY* faster! Added dump() routine to MiscSparseSet. Now propagates -reflectSelection methods even when drawing is disabled. Eliminated a few unnecessary function calls in BorderView. Changed Files: * MiscBorderCell.M * MiscBorderView.M + MiscColorList.{h|cc} + MiscDelegateFlags.{h|cc} + MiscDrawList.{h|cc} * MiscGeometry.h * MiscHighlightTracker.M * MiscIntList.{h|M|rtf} + MiscLineWrapper.{h|cc} * MiscListTracker.M * MiscRadioTracker.M + MiscRectColorList.{h|cc} + MiscRectList.{h|cc} + MiscSlotDragCursor.tiff * MiscSparseSet.{h|cc} * MiscTableBorder.{h|cc} * MiscTableCell.{h|M|rtf} * MiscTableConnInspector.M * MiscTableScrollISearch.M * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableScrollInspector.{M|nib} + MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.{h|M} * PB.project * Makefile * GNUmakefile * pack.sh v0.103 1996/05/05 11:30 EDT sunshine@sunshineco.com Created MiscGeometry which contains geometric types (point, size, rectangle) which are used by borders and know about their orientation. Removed all of the duplicated "type variation" code from BorderView and TableView and replaced with MiscGeometry. Fixed bug: Wasn't considering border orientation during slot resizing modal loop resulting in failure to auto-scroll in many cases when resizing rows. Fixed bug: Connection inspector was leaking connector objects when breaking connections. Fixed bug: Connection inspector was allowing non-target/action connections to First Responder. Fixed bug: Was crashing when trying to archive a connector whose destination was First Responder. Now connection inspector treats First Responder as a special case. Replaced low-level Post Script drawing code with higher level NeXT drawing functions in BorderView. Replaced 8 trips to the Window Server in BorderCell's -drawSelf:inView: with 1 trip by using NXRectFillListWithGrays. Added all manner of keyboard movement commands: page-up, page-down, home, end, left, right -- for both numeric keypad and editing keypad. TableView's -firstVisibleSlot & -lastVisibleSlot now return the first and last *fully* visible slot if possible. (This results in more symmetric and intuitive page-scrolling via the new movement keys.) Fixed problem: Incremental-search was going into modal event loop even if it couldn't add the very first character. Since it couldn't add the first character, there was no feedback indicating that the modal loop was active. For OpenStep conformance, selection of slots with a keyboard event (via the space bar) is treated the same as selection with the mouse. This means that one now has to use the same modifiers with keyboard- based selection as one uses with mouse-based selection. Added alt-space (0x80) in -keyDown: methods to list of keys which perform "selection" since alt-space is now meaningful with new OpenStep conformance. Fixed bug: Was unable to shift-drag in List mode to deselect a range of slots. Changed Files: * MiscBorderCell.M * MiscBorderView.{h|M} + MiscGeometry.{h|cc} * MiscHighlightTracker.{h|M} * MiscListTracker.{h|M} * MiscMouseTracker.{h|M} * MiscRadioTracker.{h|M} * MiscTableConnInspector.M * MiscTableScrollISearch.M * MiscTableScrollKB.M * MiscTableView.M * PB.project * Makefile v0.102 1996/04/29 16:00 EDT zarnuk@zarnuk.com Moved keyDown: out of MiscTableView and into MiscScrollView. IB Connection Inspector no longer pre-selects an action if there is no existing connection. Slot dragged and resized notification messages are now sent to the dataDelegate also. Eliminated separate (DataDelegate) category, since all messages are now sent to both the delegate and the dataDelegate. Fixed bug introduced in v99 -- toggling lazy-mode in IB on non-empty table-scrolls screwed things up. Fixed some trivial bugs in incremental-search. No longer faked out by changes that leave the buff-length unchanged while drawing is disabled. Now treats case-sensitive expand properly. Changed Files: * MiscTableConnInspector.M * MiscTableScroll.{h|M} * MiscTableScrollInspector.M * MiscTableScrollISearch.M + MiscTableScrollKB.M * MiscTableView.{h|M} * PB.project * Makefile v0.101 1996/04/25 22:00 EDT sunshine@sunshineco.com Replaced low-level Post Script code with higher-level (and portable) NXImage code in BorderView which grabs pixels off the screen. Fixed incorrect prototype specification in TableScroll documentation. Added calcCellSize:inRect: to BorderCell. Added visual feedback to incremental search. Changed Files: * MiscBorderCell.M * MiscBorderView.M * MiscTableScroll.rtf * MiscTableScrollISearch.M v0.100 1996/04/25 00:00 EDT zarnuk@zarnuk.com Added incremental search. -[MiscTableView keyDown:] now forwards unrecognized key strokes to the next responder (as it always should have). Slot sort vector now uses one's complement to indicate reversed direction. Setting a slot sort vector now turns off auto-sort. Changed Files: * Makefile * MiscTableScroll.{h|rtf} * MiscTableScrollSort.M + MiscTableScrollISearch.M * MiscTableView.M * PB.project v0.99 1996/04/23 05:00 EDT zarnuk@zarnuk.com Added {get/set}{first/last}Visible{slot/row/col} routines. Cells are now "retired" before being freed in all cases. Reviewed the documentation. Cleared up many FIXME items. Changed Files: * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableView.{h|M} v0.98 1996/04/23 03:00 EDT sunshine@sunshineco.com Fixed some memory leaks in the connector and connection-inspector code. Reorganized so that all FoundationKit specific code is contained in connection-inspector object file rather than connector file. This allows nibs to be loaded on 3.2 machines (which don't have Foundation Kit). BorderView now always sends action before sending doubleAction to be consistent with TableView. Removed unused -refresh method from BorderView. Changed Files: * MiscBorderView.{h|M} * MiscTableConnector.{h|M} * MiscTableConnInspector.M v0.97 1996/04/13 05:00 EDT zarnuk@zarnuk.com Created custom IB connection inspector, so that doubleTarget and doubleAction: can be set inside of IB now. Added extern "Objective-C" declaration to MiscTableScrollPalette.h Fixed bug: was not setting cursor in MiscSparseSet::add(). This manifested itself by not setting -selectedRow when -selectRow: was called. Fixed bug: -selectRow: was not honoring radio-mode. Fixed bug: -selectRow: was not clearing the selection on the other border. Fixed bug: toggling titles on/off on IB inspector was not properly enabling/disabling slot controls. Changed Files: + IBConnector.h * MiscSparseSet.cc * MiscTableScroll.M * MiscTableScrollPalette.h * MiscTableScrollInspector.M + MiscTableScrollConnector.{h|M|strings} + MiscTableScrollConnInspector.{h|M|nib} + MiscTableRightArrow.tiff + MiscTableDimple.tiff v0.96 1996/03/30 04:00 EST zarnuk@zarnuk.com Applied Eric's changes to the mcgh -> misc conversion scripts. Fixed some comments in MiscTableBorder.cc Fixed bug in MiscSparseSet::getTotalRange() => affected MiscTableBorder::hasMultipleSelection() => affected -[MiscTableScroll borderHasMultipleSelection:] => affected -[MiscTableScroll hasMultiple{Row|Col}Selection:] Totally revamped MiscSparseSet. Operations are simpler and more efficient. Changed Files: * mcgh2misc.sh * MiscTableBorder.cc * MiscSparseSet.{h|cc} v0.95 1996/03/25 22:00 EST zarnuk@zarnuk.com Fixed bug: border:sortSlot: (sortRow:/sortCol:) was off by one position when sorting a slot from a lower-index position to a higher-index position. This was a crasher when the resulting destination index was beyond the last slot. Modified behavior (not really a bug, per se). MiscTableScroll now sends the single-action message immediately before sending the double-action message on a multi-click event. This enables clients that use the single-action message to adjust controls to reflect any changes in the selection between the first click and the second click before dealing with the double-click event. Changed Files: * MiscTableScrollSort.M * MiscTableView.M ************************************************* **** MiscKit 1.9.0 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.8.1 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.8.0 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.7.1 patch-1 contains v0.94 ******* ************************************************* v0.94 1996/02/18 02:00 EST zarnuk@zarnuk.com Fixed bug introduced in last revision. Was skipping slots that had a custom sort function. Changed Files: * MiscTableScrollSort.M v0.93 1996/02/14 06:00 EST zarnuk@zarnuk.com Created subclass of IBPalette, MiscTableScrollPalette. Removed IB-specific stuff from MiscTableScroll.M Fixed bug where reading a non-empty lazy table caused free to crash. Fixed bug where some pop-ups were inappropriately enabled on the inspector even when there were no slots. MiscIntList.h is no longer #import-ed in the MiscTableScroll header. Did another overhaul on sorting. Even faster now. Fixed bug: slotsAreSorted: (rowsAreSorted,colsAreSorted) was not working properly. It was checking the physical order of the slots, not the visual order. Changed Files: + MiscTableScrollPalette.{h|M} * MiscTableBorder.cc * MiscTableScrollInspector.M * MiscTableScroll.nib * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableScrollPB.M * MiscTableScrollSort.M * MiscTableTypes.h * palette.table * PB.project * Makefile ************************************************* **** MiscKit 1.7.1 Release contains v0.92 ******* ************************************************* v0.92 1996/02/11 23:30 EST sunshine@sunshineco.com Fixed bug where -border:setSlot:sortType: was ignoring sort types "case- sensitive title", "case-insensitive title", "state", and "unsigned state". This cause the default -stringValue variation to be used for those slots -- which is clearly incorrect. Row title width is now larger -- large enough to hold 5-digit numbers. (This still needs to be reworked so as to be sizeable and dynamic.) Changed Files: * MiscTableScrollSort.M * MiscBorderView.M v0.91 1996/01/17 05:30 EST sunshine@sunshineco.com Fixed crasher. Drag cache window was being allocated from the border- view's zone even though the cache window is allocated once and never freed (the pointer is kept in a static variable). When the zone got freed that the border-view was in, the pointer ceased to point at valid memory. Changed Files: * MiscBorderView.M v0.90 1996/01/17 02:15 EST sunshine@sunshineco.com Completely rewrote mcgh2misc conversion scripts. They now also (optionally) handle conversion of example applications. Consequently the mcgh2misc scripts were removed from the example directories. Published -changeFont: in MiscTableScroll.h. Added -changeFont: to documentation. Changed Files: * mcgh2misc.{el|sh} * MiscTableScroll.{h|rtf} v0.89 1996/01/16 21:15 EST zarnuk@zarnuk.com Added PACKAGE_NUMBER to "Other Resources" in Project Builder. -[MiscTableScroll free] now calls [self setAutodisplay:NO] at the beginning to avoid drawing while the object is being freed. Eliminated huge amounts of unnecessary drawing while dragging and dropping slots. Set up for dragging slots is much faster now. Published -selectionChanged. Increased the SLOP factor for calculating drop position when dragging. Must now have leading edge at least 4 pixels into destination slot. Changed Files: * Makefile * MiscBorderView.M * MiscTableScroll.{h|M} * PB.project v0.88 1996/01/14 01:00 EST zarnuk@zarnuk.com Fixed errors in MiscIntList documentation. Fixed bug: lazyCellAt:: was not calling the dataDelegate. Fixed bug: Now ignores "-selectAll:" in radio mode. Applied MiscKit 1.7.0 changes to Makefile.{pre|post}depend Make library target now depends on $(OFILES) so it gets rebuilt when individual files are modified. Now using allocFromZone for everything inside MiscTableScroll.M, MiscTableScrollData.M, MiscTableScrollPB.M, MiscBorderView.M, MiscTableView.M, and MiscNullView.M Fixed bug: Was letting user resize slots 10 pixels beyond max size. which resulted in failed assertion `r.size <= r.max_size'. Fixed bug: Was leaking an MiscIntList with each pasteboard copy operation. Eliminated most of the flicker during resizing. Drop location when dragging slots is now determined by the "leading edge" (left edge when dragging to the left, right edge when dragging to the right, and likewise for up/down). Fixed bug where -selectedRow:n would generate an assertion failure if n was out of range. New delegate notification message: -tableScroll:changeFont:to: is sent only in response to user-initiated font changes (-changeFont:), not programmatic changes (-setFont:). setFont: messages are no longer sent to cells when the table is in lazy mode. Revamped set...Color: methods. set...Color: messages are no longer sent to cells when the table scroll is in lazy mode. Added delegate notification messages for color changes: tableScroll:backgroundColorChangedTo:, tableScroll:highlightBackgroundColorChangedTo:, tableScroll:highlightTextColorChangedTo: tableScroll:textColorChangedTo: Fixed bug: was not freeing cells when table-scroll was freed. Renamed emptyAndFree -> emptyAndFreeCells to clarify function and eliminate ambiguity concerning freeing the table scroll itself. Fixed bug: was leaking memory in -read:cells: when the table being read was empty (which it usually is). An allocation request for zero bytes was actually allocating some memory, which never got freed. Isolated sorting support in MiscTableScroll(Sort) category. Fixed bug: was leaking an MiscTableView with every nib load. MiscBorderView now sets the name of the resize cursor images. Totally revamping sorting. Micro-optimization: does not resort if a "skip" slot is dragged. Added: intValueAt::, floatValueAt::, doubleValueAt::, stringValueAt::, tagAt::, titleAt::, stateAt::, and corresponding delegate messages. Added: buffCount, and tableScrollBuffCount:. MiscTableCell no longer allocates the tag dynamically. Finished a first draft of the MiscTableCell documentation. TODO: version for and table-scroll. Changed Files: * Makefile.{pre|post}depend * MiscBorderView.M * MiscIntList.rtf * MiscNullView.M * MiscTableBorder.{cc|h} * MiscTableCell.{h|M|rtf} * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M + MiscTableScrollSort.M * MiscTableScrollPB.M * MiscTableView.M ************************************************* **** MiscKit 1.7.0 Release contains v0.87 ******* ************************************************* v0.87 1995/12/19 23:15 EST sunshine@sunshineco.com Fixed bug which crashed IB running on Intel whenever a TableScroll was initialized (such as when displaying the palette). The bug "MiscTableBorder.cc:1107: failed assertion `0 <= min_total_size'" was caused by the contentView having -NaN for the y and height values of its frame. It turns out this was because the frame was being initialized with an argument of zero. It was just "luck" that this bug never showed up on the Motorolla. Changed Files: * MiscTableScroll.M v0.86 1995/12/17 15:30 EST zarnuk@zarnuk.com Added -border:sortSlot:, -sortCol:, -sortRow: Corrected spelling mistakes in documentation. Changed Files: * MiscTableScroll.{h|M} * MiscTableScroll.rtf v0.85 1995/11/12 23:30 EST sunshine@sunshineco.com Fixed bugs where TableBorder selection and cursor methods where not taking invalid coordinates into account, and were calling visual/physical conversion methods with bad values. This fixes a problem where selectedSlot() was returning "random" and possibly out-of-range values. Fixed bug in sample code in documentation: -setRowTag: ->> -setRow:tag:. Changed Files: * MiscTableBorder.{h|cc} * MiscTableScroll.rtf v0.84 1995/11/12 07:00 EST sunshine@sunshineco.com Fixed bug in Makefile.postamble where it was unconditionally referring to m68k_obj rather than $(OFILE_DIR). Changed Files: * Makefile.postamble * BUGS.txt v0.83 1995/10/20 13:30 EDT sunshine@sunshineco.com Fixed mcgh2misc.csh so that it creates a "dummy" Makefile in the "dummy" .subproj directory since NeXT's 'make clean' in the parent directory tries to unconditionally perform 'make clean' in the .subproj too. Changed Files: * mcgh2misc.csh v0.82 1995/10/20 04:00 EDT sunshine@sunshineco.com Modified Makefile.preamble and Makefile.postamble to work correctly in the MiscKit environment. Got rid of the scroll_lib target and added $(LIB_NAME) to OTHER_PRODUCT_DEPENDS which builds library automatically whenever the palette is built. Extended mcgh2misc script so that it goes the whole distance now and creates the entire MiscKit directory structure and deletes files which are not part of the MiscKit distribution -- in addition to converting all the files from mcgh to Misc, as it did in the past. PB.project was still referring to old Palette class. BorderView.M was using "" to include TableScroll.h instead of <>. TableBorder.cc was using "" to include TableScroll.h instead of <>. TableScroll.M was using "" to include TableScroll.h and TableCell.h instead of <>. TableScrollData.M was using "" to include TableScroll.h and TableCell.h instead of <>. TableScrollInspector.M was using "" to include TableScroll.h instead of <>. TableView.M was using "" to include TableScroll.h instead of <>. Pack script now has one-line What's Locked built into it instead of relying on external script. Changed Files: * MiscBorderView.M * MiscTableBorder.cc * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollInspector.M * MiscTableView.M * Makefile.preamble * Makefile.postamble * mcgh2misc.csh * pack.sh * PB.project * Makefile * BUGS.txt * TODO.txt v0.81 1995/10/19 03:30 EDT sunshine@sunshineco.com Fixed up FontManager messaging so that it is correctly updated whenever the TableScroll is first responder in a running application. Removed unused -startReadIB, -endReadIB, -startWriteIB, and -endWriteIB. Default slot for columns no longer has 'autosize' turned on. Default palette object now has one 'autosize' column only. Fixed inspector inter-locks and a number of bugs. Now controls are enabled/disabled at more appropriate times. Updated mcgh ->> misc conversion scripts so that they convert header inclusions of the form to . Got rid of mcgh specific installation rules from Makefile.preamble and .postamble (such as /Net/devlibhost/...) since that functionality has been moved to GNUmakefile. Changed Files: * MiscTableBorder.cc * MiscTableScroll.M * MiscTableScrollInspector.M * MiscTableView.M * mcgh2misc.{el|csh} * Makefile.preamble * Makefile.postamble * BUGS.txt * TODO.txt v0.80 1995/10/15 23:15 EDT zarnuk@zarnuk.com Made one complete pass through the documentation. Removed unnecessary "make clean" from the pack.sh script. Changed Files: * MiscTableScroll.rtf * pack.sh v0.79 1995/10/15 03:30 EDT zarnuk@zarnuk.com Filled in some more documentation. Changed Files: * MiscTableScroll.rtf v0.78 1995/10/14 17:00 EDT zarnuk@zarnuk.com Fixed bug: -renewRows: was getting cell prototype from wrong column. Added #defines for max values of enumerations in MiscTableTypes.h Added range-checking asserts on all sets/reads of enumerated values in MiscTableBorder.cc Prototype cells are now allocated from the table-scroll's zone. Fixed problem in -[MiscTableCell initTextCell:] where Cell's implementation of -initTextCell: was calling -setFont:, thus turning off "useOwnerFont". Fixed GNUmakefile to add -I. before other include directories. Changed Files: * MiscTableScrollData.M * MiscTableTypes.h * MiscTableBorder.cc * MiscTableCell.M * GNUmakefile v0.77 1995/10/10 11:00 EDT zarnuk@zarnuk.com Now checks, applies auto-sort when a new slot order is set. Changed Files: * MiscTableScroll.M v0.76 1995/10/09 00:30 EDT zarnuk@zarnuk.com Updated documentation quite a bit. Converted (Cell*) return types to (id). Added: - (int) border:(MiscBorderType)b findSlotWithTag:(int)x; - (int) findColWithTag:(int)x; - (int) findRowWithTag:(int)x; - findCellWithTag:(int)x; - findCellWithTag:(int)x row:(int*)row col:(int*)col; - findCell:cell row:(int*)row col:(int*)col; Changed Files: * MiscBorderView.M * MiscTableBorder.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableScrollPB.M * MiscTableTypes.h * MiscTableView.M + pack.sh + pack_binaries.sh + unpack_binaries.sh + PACKAGE_NUMBER v0.75 1995/10/07 15:00 EDT zarnuk@zarnuk.com Just packaged up and moved master directory to charm. v0.74 1995/10/05 07:00 EDT zarnuk@zarnuk.com Fixed: -sortSlots: now checks for count > 1 before proceeding. Fixed: MiscTableBorder::find_slot_for_offset() fixed limit-check. Fixed: MiscTableBorder::setPMap() null-checking. Fixed: -selectAll: now sends action to target. Fixed: MiscTableScroll does a flushWindow after in all public draw methods. Added: sendActionIfEnabled / sendDoubleActionIfEnabled. Changed Files: * MiscTableBorder.cc * MiscTableScroll.{h|M} v0.73 1995/10/05 06:00 EDT sunshine@sunshineco.com Fixed bugs where TableView and BorderView wouldn't always draw selection correctly. Both keep a list of cells which were drawn highlighted last time -reflectSelection was called but that "old list" was not being upkept correctly. The "old list" is used to optimize drawing of the selection in -reflectSelection by only re-drawing the cells whose selection state have changed. Specifically, the problems were: 1) -reflectSelection was updating it even if [self canDraw] returned NO and no drawing occured; whereas it should have been updating it only upon YES. 2) The other drawing methods were not updating the "old list" at all. They would draw a cell (and even if its selection state had changed -reflectSelection would think the cell was still drawn with the old state). Paul added a call to constrainSize in -border:setSlotSizes: in TableScroll. Changed Files: * MiscBorderView.M * MiscTableView.M * MiscTableScroll.M v0.72 1995/10/05 04:00 EDT sunshine@sunshineco.com Fixed bug in TableView and BorderView. Mouse tracking was asking for invalid slot when mouse was beyond extent of view This also fixed the bug where the keyboard cursor didn't jump to the correct cell if the mouseUp was off the end of the view (in either direction). Changed Files: * MiscBorderView.M * MiscTableView.M v0.71 1995/10/04 15:30 EDT zarnuk@zarnuk.com Fixed bug introduced in v0.63 where the standard method of resetting the visual / physical mapping was broken. Fixed up MiscTableBorder::setCount(). Now it always resets the visual / physical mapping, even when the new count is the same as the old count. This will make -renewRows: always reset the mapping, not just when the number of rows has changed. Fixed bug in MiscTableBorder::setVMap() -- was not remapping most of the arrays. Changed Files: * MiscTableBorder.{h|cc} * MiscTableScroll.M v0.70 1995/10/03 23:30 EDT zarnuk@zarnuk.com Fixed bug where Inspector was accessing an object IB had already (silently) freed in -textDidEnd:endChar:. Fixed bug where -scrollCellToVisible:: was screwed up. Eric added more to MiscTableCell.rtf documentation. Changed Files: * MiscTableScrollInspector.{h|M} * MiscTableView.M * MiscTableCell.rtf v0.69 1995/10/03 05:10 EDT zarnuk@zarnuk.com Fixed compile bug in MiscIntList.M Changed Files: * MiscIntList.M v0.68 1995/10/03 05:00 EDT sunshine@sunshineco.com Fixed MiscTableCell so that it implements -copyFromZone: instead of -copy. Fixed MiscTableCell so that it makes all of its own memory allocations from [self zone] instead of the default-malloc-zone. Fixed MiscIntList so that it allocates its Storage array from [self zone] instead of the default-malloc-zone. Implemented copyFromZone:, addIntList:, and initFromString: to MiscIntList. Changed Files: * MiscTableCell.{h|M|rtf} * MiscIntList.{h|M|rtf} v0.67 1995/10/03 04:20 EDT sunshine@sunshineco.com Fixed bug in -read: in MiscTableScroll. It was asking for the typed stream class version using [[self class] name] instead of the correct [[MiscTableScroll class] name]. Changed Files: * MiscTableScroll.M v0.66 1995/10/03 04:00 EDT sunshine@sunshineco.com Added MiscIntList documentation. Added preliminary MiscTableCell documentation. Reverted MiscTableScroll class version number back to zero and removed all of the version-conditional code from -read:. MiscTableScroll now archives action and doubleAction. Fixed bug where MiscIntList was unable to parse negative numbers in -readFromString:. Changed Files: + MiscIntList.rtf + MiscTableCell.rtf * MiscTableScroll.M v0.65 1995/10/03 02:30 EDT zarnuk@zarnuk.com Removed unnecessary custom IBPalette subclass. Changed Files: - MiscTableScrollPalette.{h|M} * Makefile * PB.project * palette.table * MiscTableScroll.nib v0.64 1995/10/01 15:30 EDT sunshine@sunshineco.com Fixed mcgh2misc conversion to handle *.psw files. TableCell now has optional explicit settings for highlighted text and background color rather than using the "reverse-video" scheme (which always turns out being extremely ugly). (The default background color is light-gray once again. Paul hatez it but it is much more consistent with the rest of the AppKit.) TableScroll now publishes methods for setting highlighted text and background colors. TableScroll inspector now allows setting of text, background, and highlighted text and background colors in IB. Fixed bug where color was not working in IB. Problem was lazy mode cell was not getting -setOwner:. Tested cell color settings. They work! Cells which have had colors set manually do not inherit the TableScroll's colors. Changed Files: * mcgh2misc.csh * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableScrollInspector.{h|M|nib} v0.63 1995/09/30 19:00 EDT zarnuk@zarnuk.com Added support for saving/restoring preferences... Added -readFromString: -writeToString[:size:[canExpand:]] methods to MiscIntList. Changed Files: * MiscIntList.{h|M} * MiscTableBorder.{h|cc} * MiscTableScroll.{h|M} v0.62 1995/09/29 16:00 EDT zarnuk@zarnuk.com Improved cell stuff: - lazy allocation for tags, colors. - useOwner options for font, colors. Changed Files: * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M v0.61 1995/09/29 03:00 EDT zarnuk@zarnuk.com Added preliminary color stuff. MiscTableScrollData updates the frame when rows/columns are inserted/deleted. The Misc GNUmakefile mf.{pre/post}depend files in ".." have been evolving quite a bit. The current PB Makefile is probably out of date. Moved Files: /Net/devlibhost/system/include/mcgh/RCS > MiscIntList.h > MiscTableCell.h > MiscTableScroll.h > MiscTableTypes.h Changed Files: * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M v0.60 1995/09/27 09:00 EDT zarnuk@zarnuk.com Checked-in source at Misc in: /Net/devlibhost/system/Source/Palettes/MiscTableScroll/RCS Moved Files: /Net/devlibhost/system/include/MiscTableScroll/RCS > MiscIntList.h > MiscTableCell.h > MiscTableScroll.h > MiscTableTypes.h Changed Files: - NOTES.txt <-- Out-of-date and incorrect. - ARCHITECTURE.txt <-- Out-of-date and incorrect. - MiscTableAdaptor.[hM] <-- Please make sure this doesn't come back! * PB.project This is the second time I've deleted it. * Makefile* v0.59 1995/09/27 03:30 EDT sunshine@sunshineco.com Removed the newly obsolete BorderRange class. It was only used by BorderView. SparseSet now uses (int) internally instead of MiscCoord since MiscCoord is going away. Also this makes it a more general-purpose class. Removed MiscCoord to avoid name conflict with class in GISKit. SparseSet now much a much more concerted effort to supply a meaningful "cursor" by taking an active role in manipulating it. In the past it only assured that it had a valid value. This was done so that methods called by the client of TableScroll can execute -selectRowAt:, for instance, and get a meaningful value from -selectedRow. Previously only mouse-tracking would provide a meaningful value for the selection cursor. Removed MiscTableCell protocol. Now MiscTableCell header is public so clients know what messages it responds to. Changed Files: - MiscBorderRange.{h|cc} * MiscBorderView.M * MiscSparseSet.{h|cc} * MiscTableBorder.{h|cc} * MiscTableTypes.h * mcgh2misc.el * MiscTableAdaptor.{h|M} * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableView.M v0.58 1995/09/26 08:00 EDT sunshine@sunshineco.com Compiles under NEXTSTEP 3.3 again. TableView no longer stores the keyboard-cursor. Each border now has the notion of a current keyboard-cursor. Is now much more tightly integrated with slot manipulation -- gets updated as slots are manipulated in border. Caught a few more cases in TableBorder where selection needed to get updated as slots are manipulated. Added methods to TableScroll to allow client to control keyboard cursor programatically. Mouse events now turn off flashing keyboard-cursor during tracking. This is much more aesthetically pleasing especially during dragging, sizing, and selection. Flashing keyboard-cursor now jumps to mouse-up location. Keyboard-cursor and mouse tracking in TableView can now be configured to be either row-wise or column-wise (instead of being hard-coded as row-wise only). Keyboard-cursor now draws correctly after scrolling. It is always drawn within the visibleRect of the TableView, but previously it wasn't getting updated upon scrolling (at which time the visibleRect changes). Using -setImage: in TableCell no longer leaves the 'contents' icon name with its last value. Now every effort is made to install a meaningful value or null if necessary. Changed Files: * MiscTableScrollData.M * MiscTableScroll.{h|M} * MiscBorderView.M * MiscTableBorder.{h|cc} * MiscTableView.{h|M} * MiscTableFocus.M * MiscTableCell.M v0.57 1995/09/25 02:30 EDT zarnuk@zarnuk.com Reversed sense of autoSortSlots. '-autoSortRows' now means autoSort *rows*! Likewise for cols. Fixed inspector to reflect this. Fixed -renewRows so that it actually 'retire's cells now. Fixed the -doRetireCell:at:: method to check -respondsTo: before sending messages and to avoid sending -setStringValue: to icon cells. Selection now gets cleared every time -empty or -renewRows: is called. Selection now gets updated when slots are inserted / deleted / moved. Changed Files: * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollInspector.M * MiscTableBorder.{h|cc} * MiscSparseSet.{h|cc} v0.56 1995/09/24 01:00 EDT zarnuk@zarnuk.com Selection methods now update the display if isAutodisplay, else setNeedsDisplay:YES. Added -replaceIntAt:with:, -sort, -sortUsing:data: methods to MiscIntList. Added pasteboard / services stuff... Added -border:visualToPhysical:, -border:physicalToVisual: to MiscTableScroll. Changed Files: * PB.project * MiscTableScroll.{h|M} + MiscTableScrollPB.M + MiscIntList.h * MiscIntList.M v0.55 1995/09/24 04:00 EDT sunshine@sunshineco.com Fixed *lib targets in Makefile.postamble so that they depend on the palette target. Renamed MiscTextCell to MiscTableCell. Added icon functionality to MiscTableCell and fixed MiscTableBorder to use the new icon stuff. Speeded up sorting by making a lot of high frequency functions inline. Added MiscTableCell protocol which all the cells returned by TableScroll respect since we use private cell types internally and do not otherwise specify what messages they respond to. All methods throughout have been converted. v0.54 1995/09/21 00:30 EDT zarnuk@zarnuk.com Added revive/retire methods for data-cells. Font gets fixed in revive. v0.53 1995/09/20 15:16 EDT zarnuk@zarnuk.com Fixed more font stuff... Changing the uniformSize of a border now gets the frame updated. Changing the uniformSize of rows updates the line-scroll and page-scroll values. Display is disabled while fonts are being changed. Removed obsolete MiscTableBorderOwner.* Added libMiscTableScroll.a to OTHER_GARBAGE in Makefile.preamble. v0.52 1995/09/20 06:45 EDT sunshine@sunshineco.com Got rid of abbreviations in selMode, setSelMode:, and reflectSel. They are now selectionMode, setSelectionMode:, and reflectSelection, respectively. Updated documentation. Added all manner of -scroll*ToVisible methods to TableScroll. -scrollCellToVisible::, -scrollRowToVisible:, -scrollColToVisible, -scrollSelToVisible. Fixed Makefile.preamble. It was adding -ObjC++ to CFLAGS. This should not be done since it causes problems with PS-wraps, *plus* it should not be necessary since we are using the proper file extensions .M and .cc. The reason this was done was because the NeXT makefile used for palettes (/NextDeveloper/Makefiles/app/specialrules.make) has a bug in it and does not add the -ObjC++ flag to files with .cc extension. I fixed the problem by overriding their buggy implicit rule for .cc in our local Makefile.postamble. Added keyboard control. Rows can be selected via the keyboard in all selection modes, in a sensible manner. Works but still needs a bit tighter integration with other operations such as mouse tracking, changing num-rows, etc. Added TableFocus class for showing keyboard focus. It displays a blinking dashed box. Keyboard controls are: Arrow keys move selection cursor. Space selects/deselects slot and sends action. Return sends doubleAction. Tab sends -selectText to nextText. Shift-Tab sends -selectText to previousText. v0.51 1995/09/19 07:30 EDT zarnuk@zarnuk.com Added -makeCellsPerform: methods. Fixed -sendAction:to:forAllCells: to match behavior documented in Matrix. Added font stuff. Created new archive version. Added support for reading old versions. v0.50 1995/09/18 15:15 EDT zarnuk@zarnuk.com Sorting was not honoring descending direction. -sortSlots: now generates an error if called re-entrantly. Added delegate call-backs for slot-dragged, slot-resized. Implemented auto-sort. v0.49 1995/09/18 07:45 EDT zarnuk@zarnuk.com Fixed some compilation problems. v0.48 1995/09/15 05:30 EDT sunshine@sunshineco.com Mouse down methods in BorderView and TableView now send action and double action. Added programmatic selection interface. Added MiscIntList to support selection of multiple rows/tags at one time. Modified mouse tracking behavior so that it acts more like Matrix upon double-click. That is, now you can double-click-drag and the double- action is sent upon the mouse-up from the double-click-drag. Fixed 'lib' targets in Makefile.postample to use 'cc -ObjC++ -r -nostdlib' instead of 'ld -r' since ld can't handle multiple architectures. Fixed mcgh ->> Misc conversion scripts to also convert Makefile.*. v0.47 1995/09/14 05:45 EDT zarnuk@zarnuk.com Applied Eric's fix to the -findImageNamed: stuff so that the resize cursors can be found at runtime. Added scroll_lib target to the Makefile.postamble to create the library. Added -sizeToCells method. Added sorting. Added -tag and -setTag: to MiscTextCell. v0.46 1995/09/13 13:45 EDT zarnuk@zarnuk.com Fixed compile problem. v0.45 1995/09/13 03:00 EDT zarnuk@zarnuk.com Plugged memory leak in MiscTableBorder::setCount() when shrinking uniform-size borders that had custom titles or prototype cells. Added -setAutodisplay: Added -border:drawSlot: (counter-part of -drawCol:, -drawRow:). Added -border:drawSlotTitle:, -drawColTitle:, -drawRowTitle: Added -[MiscBorderView drawSlot:]. Fixed up these methods to -update the display: -border:setSlot:title: -setBorderTitleMode: -border:setUniformSizeSlots: Converted all 'col' and 'row' methods to use the generic 'slot' methods. Expanded size of 'size' fields in inspector to accomodate new larger max. Implemented -border:getDelegateSlotTitle: -border:getDelegateSlotPrototype: Fixed up implementation of -sendAction methods. Added {get/set}{slot/col/row}data-size methods. v0.44 1995/09/12 15:30 EDT zarnuk@zarnuk.com Fixed assertion failure min_total_size <= max_total_size. Increased MISC_MAX_PIXELS_SIZE from 0x3FFF -> 0x7FFFF0000 (Note that 0x7FFFFFFE -- (LONG_MAX-1) Had problems from the long -> float -> long conversions. This value seems to be working.) Removed fascist policy of always forcing at least one column to autosize. Re-organized {get/set}{min/max} constrained stuff to be more consistent with the rest of the interface. Added {get/set}{min/max} total-size methods. Added get total-size methods. Published -constrainSize method. v0.43 1995/09/11 04:15 EDT zarnuk@zarnuk.com Fixed botched declarations in MiscTableScroll.h. These were all mis-spelled as "Cols" instead of "Rows". - (BOOL) sizeableRows; - (BOOL) draggableRows; - (BOOL) modifierDragRows; Renamed xxxViewOn methods to xxxTitlesOn. Fleshed out most of the documentation. Added -tag, and -setTag: Added stubs for -sendAction, -sendAction:to:, -sendAction:to:forAllCells:, -sendDoubleAction, -cellIsSelected:: Added -constrain {min/max} {width/height} methods. Added constrain {min/max} constrols to the inspector. Columns are now autosize by default. Eric added outlets to palette nib so connections can be made from Table Scroll to other objects in IB. v0.42 1995/09/10 22:00 EDT sunshine@sunshineco.com Finished mcgh ->> Misc conversion scripts. They now handle nibs, tiffs, and the documentation. Incorporated Paul's changes to the documentation. v0.41 1995/09/10 21:00 EDT sunshine@sunshineco.com Converted back to mcgh from Misc. Added scripts to convert to Misc upon demand. The scripts are currently incomplete since they don't deal with nibs or tiffs. v0.40 1995/09/03 06:00 EDT sunshine@sunshineco.com Changed all prefixes to Misc or MISC_ as appropriate in preparation for inclusion in the MiscKit. Modified copyright notices to mention the MiscKit and its license. Fixed up the two public headers TableScroll.h and TableTypes.h so that they can be included by non-C++ clients (in other words, probably *all* MiscKit users) as well as C++ clients. Started writing preliminary class documentation. Added missing -doubleTarget and -setDoubleTarget: methods. Added a TODO file. v0.39 1995/08/30 23:52 EDT sunshine@sunshineco.com Fixed up the icons on the "up" and "down" buttons on the inspector. They now support both color and gray. Added missing "to-do" stuff to the BUG file. Should make a TODO file. v0.38 1995/08/30 22:17 EDT sunshine@sunshineco.com Fixed bug where drawing got all messed up during auto-scroll when resizing columns/row. Problem was that instance-drawing was ON during auto-scroll. Fixed bug where automatic column/row titles were "reordering" themselves automatically after dragging instead of sticking to original columns/rows. Problem was that visual coordinates were being used in auto-generation instead of physical coordinates. Added copyright notice to all files. Normalized comment headers. v0.37 1995/08/27 04:00 EDT sunshine@sunshineco.com Fixed the problem with list-mode selection where it "leaked" selected cells when you dragged the mouse back and forth very quickly. Fixed the problem where the scrollers and document frame were not being updated when a column/row was resized. MiscKit/Palettes/MiscTableScroll/IBConnector.h100444 1750 1750 4146 6757716145 21562 0ustar sunshinesunshine#ifndef __MiscTableScroll_IBConnector_h #define __MiscTableScroll_IBConnector_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // IBConnector.h // // The declarations of Interface Builder's private connection classes: // IBConnector, IBOutletConnector, and IBControlConnector. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: IBConnector.h,v 1.2 99/06/29 07:17:58 sunshine Exp $ // $Log: IBConnector.h,v $ // Revision 1.2 99/06/29 07:17:58 sunshine // v140: Cleaned up. Added copyright notice. // //----------------------------------------------------------------------------- extern "Objective-C" { #import #import } @interface IBConnector : Object { id source; id destination; id label; } - (id)initSource:(id)src destination:(id)dst label:(id)label; - (id)free; - (id)source; - (id)destination; - (id)label; - (id)setLabel:(id)label; - (id)displayConnection; - (id)establishConnection; - (id)getIBPrintName; - (id)nibInstantiate; - (id)renewObject:(id)from to:(id)to; - (id)read:(NXTypedStream*)s; - (id)write:(NXTypedStream*)s; @end @interface IBOutletConnector : IBConnector - (id)establishConnection; @end @interface IBControlConnector : IBConnector - (id)getIBPrintName; - (id)establishConnection; @end #endif // __MiscTableScroll_IBConnector_h MiscKit/Palettes/MiscTableScroll/MiscDrawList.cc100444 1750 1750 17627 6757716165 22152 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDrawList.cc // // An extensible array of specifications for drawing cell contents. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDrawList.cc,v 1.5 97/12/19 00:48:32 zarnuk Exp $ // $Log: MiscDrawList.cc,v $ // Revision 1.5 97/12/19 00:48:32 zarnuk // v133: added draw_clipped_text flag. // // Revision 1.4 97/02/11 19:16:43 sunshine // v123: Fixed bug: Was unconditionally using screenFont even when not drawing // to screen (such as during printing, copying). //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscDrawList.h" #include "MiscLineWrapper.h" #include extern "Objective-C" { #import #import #import #import // NX_LEFTALIGNED } extern "C" { #include #include } //----------------------------------------------------------------------------- // get_char_wrap //----------------------------------------------------------------------------- inline static bool get_char_wrap( id cell ) { if ([cell isKindOf:[Cell class]]) { struct CellDefs { @defs(Cell) }; return ((CellDefs const*) cell)->cFlags2.noWrap; } return false; } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscDrawList::append( NXRect frame_rect, id cell, BOOL lit, NXColor default_text_color, Font* default_font ) { char const* txt = 0; NXImage* img = 0; if (cell != 0) { if ([cell respondsTo:@selector(image)]) img = [cell image]; else if ([cell respondsTo:@selector(icon)]) { char const* nm = [cell icon]; if (nm != 0) img = [NXImage findImageNamed:nm]; } if (img == 0) if ([cell respondsTo:@selector(title)]) txt = [cell title]; else if ([cell respondsTo:@selector(stringValue)]) txt = [cell stringValue]; if (img != 0 || (txt != 0 && *txt != 0)) { if (num_recs >= max_recs) { max_recs += max_recs; recs = (Rec*) realloc( recs, max_recs * sizeof(*recs) ); } Rec& r = recs[ num_recs++ ]; if (img != 0) { r.image = img; r.icon_rect = frame_rect; if ([cell respondsTo:@selector(getIconRect:)]) [cell getIconRect:&(r.icon_rect)]; } else r.image = 0; if (txt != 0 && *txt != 0) { int const len = strlen( txt ) + 1; r.text = (char*) malloc( len ); memcpy( r.text, txt, len ); r.text_rect = frame_rect; if ([cell respondsTo:@selector(getTitleRect:)]) [cell getTitleRect:&(r.text_rect)]; r.font = 0; if ([cell respondsTo:@selector(font)]) r.font = [cell font]; if (r.font == 0) r.font = default_font; NXColor color; if (lit && [cell respondsTo:@selector(highlightTextColor)]) color = [cell highlightTextColor]; else if ([cell respondsTo:@selector(textColor)]) color = [cell textColor]; else color = default_text_color; r.text_color = color_list.store( color ); int flags; if ([cell respondsTo:@selector(alignment)]) flags = ([cell alignment] << 1); else flags = (NX_LEFTALIGNED << 1); if (get_char_wrap( cell )) flags |= 1; r.flags = flags; } else { r.text = 0; r.font = 0; r.text_color = -1; } } } } //----------------------------------------------------------------------------- // Rec::draw_icon //----------------------------------------------------------------------------- void MiscDrawList::Rec::draw_icon() { NXPoint p; p.x = icon_rect.origin.x; p.y = icon_rect.origin.y + icon_rect.size.height; NXRect r; r.origin.x = 0; r.origin.y = 0; [image getSize:&(r.size)]; float const dx = icon_rect.size.width - r.size.width; if (dx < 0) r.size.width = icon_rect.size.width; else if (dx > 0) p.x = floor( p.x + dx / 2 ); float const dy = icon_rect.size.height - r.size.height; if (dy < 0) r.size.height = icon_rect.size.height; else if (dy > 0) p.y = floor( p.y - dy / 2 ); [image composite:NX_SOVER fromRect:&r toPoint:&p]; } //----------------------------------------------------------------------------- // Rec::draw_text //----------------------------------------------------------------------------- void MiscDrawList::Rec::draw_text( MiscLineWrapper& lw ) const { lw.setText( text ); lw.setRect( text_rect ); lw.setCharWrap( flags & 1 ); lw.setAlignment( flags >> 1 ); lw.draw(); } //----------------------------------------------------------------------------- // draw_icons //----------------------------------------------------------------------------- void MiscDrawList::draw_icons() { for (int i = 0; i < num_recs; i++) { Rec& r = recs[i]; if (r.image != 0) r.draw_icon(); } } //----------------------------------------------------------------------------- // draw_text //----------------------------------------------------------------------------- void MiscDrawList::draw_text() { MiscLineWrapper lw; lw.setNoPartialLines( !draw_clipped_text ); for (int i = 0; i < num_recs; i++) // For each font... { if (recs[i].font != 0) { Font* const font = recs[i].font; Font* screenFont; if (NXDrawingStatus == NX_DRAWING && (screenFont = [font screenFont]) != 0) { [screenFont set]; lw.setFont( screenFont ); } else { [font set]; lw.setFont( font ); } for (int j = i; j < num_recs; j++) // For each font-color pair... { if (recs[j].text_color >= 0) { int const color_id = recs[j].text_color; NXSetColor( color_list[ color_id ] ); for (int k = j; k < num_recs; k++) // For each record... { Rec& r = recs[k]; if (r.font == font && r.text_color == color_id) { r.font = 0; // Mark record "used". r.text_color = -1; r.draw_text( lw ); } } } } } } } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscDrawList::draw() { if (num_recs > 0) { draw_icons(); draw_text(); empty(); } } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- void MiscDrawList::empty() { for (int i = 0; i < num_recs; i++) if (recs[i].text != 0) free( recs[i].text ); num_recs = 0; } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscDrawList::~MiscDrawList() { empty(); free( recs ); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscDrawList::MiscDrawList( bool b ) { num_recs = 0; max_recs = 16; recs = (Rec*) malloc( max_recs * sizeof( *recs ) ); draw_clipped_text = b; } MiscKit/Palettes/MiscTableScroll/MiscBorderCell.h100444 1750 1750 3072 6757716145 22243 0ustar sunshinesunshine#ifndef __MiscBorderCell_h #define __MiscBorderCell_h //============================================================================= // // Copyright (C) 1995-1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderCell.h // // Cell class used by MiscBorderView to manage column headings and row // labels for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderCell.h,v 1.2 96/09/13 12:31:48 zarnuk Exp $ // $Log: MiscBorderCell.h,v $ // Revision 1.2 96/09/13 12:31:48 zarnuk // Added the image instance variable. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class NXImage; @interface MiscBorderCell : Cell { NXImage* image; } - setImage:img; @end #endif // __MiscBorderCell_h MiscKit/Palettes/MiscTableScroll/MiscBorderView.M100444 1750 1750 132706 6757716145 22312 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderView.M // // View class for the row/column borders on a MiscTableView. // Supports resizing, dragging. // // NOTE: *COORDS* // COORDINATE SYSTEM RULES: // // 1) The BorderView and the TableView must *NOT* be scaled or rotated. // There is no reason to do so, and supporting this unnecessary // capability is complicated and slow. The entire TableScroll // can be scaled and/or rotated, but the BorderView and // TableView subviews should not be scaled and/or rotated // relative to the TableScroll. // // 2) This means that the only coordinate transformations that are // necessary when converting coordinates between the BorderView, // TableView and/or TableScroll are simple translations. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderView.M,v 1.25 98/05/12 13:56:12 zarnuk Exp $ // $Log: MiscBorderView.M,v $ // Revision 1.25 98/05/12 13:56:12 zarnuk // v139: Fixed v1 corrupted selection set bug in mouseDown. // // Revision 1.24 98/03/29 19:30:31 sunshine // v138: Fixed v134 bug: No longer suspends/resumes editing when border view // is used to change slot selection. This broke relationship where one and // only selected slot was the one containing the edit session. // // Revision 1.23 97/12/22 21:55:43 zarnuk // v134: now uses suspendEditing / resumeEditing. // // Revision 1.22 97/12/19 00:43:36 zarnuk // v133: Now supports resizing uniform-size borders. Fixed v1 bug in // range::fromRect:, dropped support for constrain-max. //----------------------------------------------------------------------------- #import "MiscBorderView.h" #import "MiscAssert.h" #import "MiscBorderCell.h" #import "MiscGeometry.h" #import "MiscHighlightTracker.h" #import "MiscListTracker.h" #import "MiscRadioTracker.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import "MiscTableWell.h" #import #import #import extern "Objective-C" { #import #import #import #import #import #import #import #import #import #import #import #import #import } extern "C" { #import #import #import #import // memset(). #import // FILENAME_MAX } static NXCoord MIN_TOGGLE_WIDTH = 5; static NXCoord TOGGLE_WIDTH = 5; #define MISC_RESIZE_EPSILON 4 #define MISC_FRAME_HEIGHT 18 #define MISC_FRAME_WIDTH 46 static NXCursor* horzCursor = 0; static NXCursor* vertCursor = 0; static NXCursor* dragCursor = 0; static NXCursor* reverseCursor = 0; static NXImage* sortAscendImage = 0; static NXImage* sortAscendHImage = 0; static NXImage* sortDescendImage = 0; static NXImage* sortDescendHImage = 0; static inline MiscPixels dmin( MiscPixels a, MiscPixels b ) { return (a < b ? a : b); } static inline MiscPixels dmax( MiscPixels a, MiscPixels b ) { return (a > b ? a : b); } //---------------------------------------------------------------------------- // startTimer //---------------------------------------------------------------------------- static inline void startTimer( NXTrackingTimer*& timer ) { if (timer == 0) timer = NXBeginTimer( 0, 0.1, 0.1 ); } //---------------------------------------------------------------------------- // stopTimer //---------------------------------------------------------------------------- static inline void stopTimer( NXTrackingTimer*& timer ) { if (timer) { NXEndTimer( timer ); timer = 0; } } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscBorderView //----------------------------------------------------------------------------- // + findImageNamed: //----------------------------------------------------------------------------- + (NXImage*)findImageNamed:(char const*)name { NXImage* image = [NXImage findImageNamed:name]; if (image == 0) { char path[ FILENAME_MAX + 1 ]; [[NXBundle bundleForClass:self] getPath:path forResource:name ofType:"tiff"]; image = [[NXImage alloc] initFromFile:path]; [image setName:name]; } return image; } //----------------------------------------------------------------------------- // + cursorFromImageName: // NOTE: Cannot use [self zone] in a class (factory) method // like this one, hence no allocFromZone:. //----------------------------------------------------------------------------- + (NXCursor*)cursorFromImageName:(char const*)name { NXImage* image = [self findImageNamed:name]; NXPoint const hot = { 8, 8 }; NXCursor* cursor = [[NXCursor alloc] initFromImage:image]; [cursor setHotSpot:&hot]; return cursor; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (horzCursor == 0) { horzCursor = [self cursorFromImageName:"MiscHorzResizeCursor"]; vertCursor = [self cursorFromImageName:"MiscVertResizeCursor"]; dragCursor = [self cursorFromImageName:"MiscSlotDragCursor" ]; reverseCursor = [self cursorFromImageName:"MiscReverseCursor"]; NXPoint const hot = { 4, 0 }; [reverseCursor setHotSpot:&hot]; sortAscendImage = [self findImageNamed:"MiscSortAscend" ]; sortAscendHImage = [self findImageNamed:"MiscSortAscendH" ]; sortDescendImage = [self findImageNamed:"MiscSortDescend" ]; sortDescendHImage = [self findImageNamed:"MiscSortDescendH"]; NXSize sz; [sortAscendImage getSize:&sz]; TOGGLE_WIDTH = sz.width; if (TOGGLE_WIDTH < MIN_TOGGLE_WIDTH) TOGGLE_WIDTH = MIN_TOGGLE_WIDTH; } return self; } //----------------------------------------------------------------------------- // TYPE VARIATIONS //----------------------------------------------------------------------------- - (MiscPixels)frameHeight { NXRect rect; [self getFrame:&rect]; return (MiscPixels) (isHorz ? rect.size.height : rect.size.width); } - (void)setFrameHeight:(MiscPixels)x { NXRect rect; [self getFrame:&rect]; if (isHorz) rect.size.height = x; else rect.size.width = x; [self setFrame:&rect]; } - (NXCursor*)cursor { return isHorz ? horzCursor : vertCursor; } - (MiscBorderType)borderType { return isHorz ? MISC_COL_BORDER : MISC_ROW_BORDER; } - (MiscTableBorder*)otherBorder { return [scroll border:MISC_OTHER_BORDER([self borderType])]; } - (void)clearOtherBorder { [self otherBorder]->selectNone(); } - (id)cellAt:(MiscCoord_P)row :(MiscCoord_P)col { return isHorz ? [scroll cellAt:row:col] : [scroll cellAt:col:row]; } - (void)convertPointToScroll:(MiscPoint_O*)p_o { NXPoint p = *p_o; [scroll convertPoint:&p fromView:self]; *p_o = p; } - (void)convertOriginToScroll:(MiscRect_O*)r_o { NXPoint p = *r_o; [scroll convertPoint:&p fromView:self]; *r_o = p; } //----------------------------------------------------------------------------- // - changeFrameIfNeeded // FIXME: The frame updates need to be untangled. All requests should // go through the table-scroll object. Implementations should only // update themselves, not other objects. //----------------------------------------------------------------------------- - (void)changeFrameIfNeeded { MiscRect_O r( isHorz, frame ); MiscPixels const my_width = r.getWidth_O(); MiscPixels const i_width = info->totalSize(); if (my_width != i_width) { [window invalidateCursorRectsForView:self]; r.setWidth_O( i_width ); [self sizeTo:r.getWidth() :r.getHeight()]; [[scroll docView] adjustSize]; } } //----------------------------------------------------------------------------- // - setPos:width: //----------------------------------------------------------------------------- - (void)setPos:(MiscCoord_V)pos width:(MiscPixels)size { MiscCoord_P pPos = info->visualToPhysical(pos); [scroll border:[self borderType] setSlot:pPos size:(NXCoord)size]; [window invalidateCursorRectsForView:self]; [scroll update]; } //----------------------------------------------------------------------------- // - initFrame:scroll:info:type: //----------------------------------------------------------------------------- - (id)initFrame:(NXRect const*)frameRect scroll:(MiscTableScroll*)i_scroll info:(MiscTableBorder*)i_info type:(MiscBorderViewType)type { NXZone* const z = [self zone]; [super initFrame:0]; [self setFlipped:YES]; [self setOpaque:YES]; [self setClipping:NO]; togglePos = -1; isHorz = (type == MISC_COL_BORDER_VIEW); scroll = i_scroll; info = i_info; theCell = [[MiscBorderCell allocFromZone:z] initTextCell:"Kilroy"]; oldSel = new( NXZoneMalloc(z,sizeof(*oldSel)) ) MiscSparseSet; [self setSelectionMode:[scroll selectionMode]]; MiscRect_O myFrame( isHorz ); if (frameRect != 0) myFrame = frameRect->origin; myFrame.setWidth_O( i_info->totalSize() ); myFrame.setHeight_O( (isHorz ? MISC_FRAME_HEIGHT : MISC_FRAME_WIDTH) ); NXRect r = myFrame; [self setFrame:&r]; return self; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { [theCell free]; [tracker free]; if (oldSel != 0) { oldSel->MiscSparseSet::~MiscSparseSet(); NXZoneFree( [self zone], oldSel ); } return [super free]; } //============================================================================= // CONVERSIONS //============================================================================= //----------------------------------------------------------------------------- // - range::fromRect: // Returns by reference the range of visual slots contained in rect. // rMin is inclusive, rMax is exclusive. //----------------------------------------------------------------------------- - (void)range:(MiscCoord_V*)rMin :(MiscCoord_V*)rMax fromRect:(NXRect const*)rect { MiscRect_O r( isHorz, *rect ); *rMin = info->visualForOffset( r.getX_O() ); *rMax = info->visualForOffset( r.getMaxX_O() - 1 ) + 1; } //----------------------------------------------------------------------------- // - rect:forPos: //----------------------------------------------------------------------------- - (void)rect:(NXRect*)nxrect forPos:(MiscCoord_V)pos { NXRect nxBounds; [self getBounds:&nxBounds]; MiscRect_O r( isHorz, nxBounds ); r.setX_O( info->getOffset(pos) ); r.setWidth_O( info->effectiveSize(pos) ); *nxrect = r; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // - getVisibleRange:: // // Returns by reference the range of visual slots contained in the visible // rectangle. rMin is inclusive, rMax is exclusive. //----------------------------------------------------------------------------- - (void)getVisibleRange:(MiscCoord_V*)rMin :(MiscCoord_V*)rMax { NXRect visRect; [superview getDocVisibleRect:&visRect]; [self range:rMin:rMax fromRect:&visRect]; } //----------------------------------------------------------------------------- // drewPos: // // Keeps the old selection sets up to date whenever we draw a cell. This // way -selectionChanged has valid data to work from. //----------------------------------------------------------------------------- - (void)drewPos:(MiscCoord_V)slot { BOOL isSelected = info->isSelected( slot ); if (isSelected != oldSel->contains(slot)) { if (isSelected) oldSel->add( slot ); else oldSel->remove( slot ); } } //----------------------------------------------------------------------------- // - drawPos:inRect:controlView: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos inRect:(NXRect const*)rect controlView:(View*)controlView { [theCell setStringValue:info->getTitle(pos)]; [theCell setState:info->isSelected(pos)]; NXImage* img = 0; if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])]) if (info->isSortable(pos)) if (info->getSortDirection(pos) == MISC_SORT_DESCENDING) img = togglePos == pos ? sortDescendHImage : sortDescendImage; else img = togglePos == pos ? sortAscendHImage : sortAscendImage; [theCell setImage:img]; [theCell drawSelf:rect inView:controlView]; } //----------------------------------------------------------------------------- // - drawPos:updateSel: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos updateSel:(BOOL)updateSel { if (0 <= pos && pos < info->count()) { NXRect rect; [self rect:&rect forPos:pos]; [self drawPos:pos inRect:&rect controlView:self]; if (updateSel) [self drewPos:pos]; } } //----------------------------------------------------------------------------- // - drawPos: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos { [self drawPos:pos updateSel:YES]; } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NXRect const*)rect { MiscCoord_V pos_min; MiscCoord_V pos_max; [self range:&pos_min:&pos_max fromRect:rect]; for (MiscCoord_V pos = pos_min; pos < pos_max; pos++) [self drawPos:pos]; } //----------------------------------------------------------------------------- // - drawSelf:: //----------------------------------------------------------------------------- - (id)drawSelf:(NXRect const*)rects :(int)nrects { if (nrects == 1) [self drawRect:rects]; else if (nrects == 3) { [self drawRect:++rects]; [self drawRect:++rects]; } return self; } //----------------------------------------------------------------------------- // - drawSlot: [public] //----------------------------------------------------------------------------- - (void)drawSlot:(MiscCoord_V)n { MiscCoord_V rMin, rMax; [self getVisibleRange:&rMin:&rMax]; if (rMin <= n && n < rMax) { if ([self isAutodisplay] && [self canDraw]) { [self lockFocus]; [self drawPos:n]; [self unlockFocus]; } else { [self setNeedsDisplay:YES]; } } } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - setSelectionMode: //----------------------------------------------------------------------------- - (void)setSelectionMode:(MiscSelectionMode)mode { NXZone* const z = [self zone]; if (tracker) [tracker free]; switch (mode) { case MISC_LIST_MODE: tracker = [MiscListTracker allocFromZone:z]; break; case MISC_RADIO_MODE: tracker = [MiscRadioTracker allocFromZone:z]; break; case MISC_HIGHLIGHT_MODE: tracker = [MiscHighlightTracker allocFromZone:z]; break; } [tracker initBorder:info]; } //----------------------------------------------------------------------------- // - selectionChanged //----------------------------------------------------------------------------- - (void)selectionChanged { MiscSparseSet const& newSel = info->selectionSet(); if ([self isAutodisplay] && [self canDraw]) { MiscCoord_V rMin, rMax; [self getVisibleRange:&rMin:&rMax]; int locked = 0; for (MiscCoord_V i = rMin; i < rMax; i++) { if (oldSel->contains(i) != newSel.contains(i)) { if (!locked) { locked = 1; [window disableFlushWindow]; [self lockFocus]; } [self drawPos:i updateSel:NO]; } } if (locked) { [self unlockFocus]; [[window reenableFlushWindow] flushWindow]; } } else [self setNeedsDisplay:YES]; *oldSel = newSel; } //----------------------------------------------------------------------------- // - resetSelection //----------------------------------------------------------------------------- - (void)resetSelection { *oldSel = info->selectionSet(); } //----------------------------------------------------------------------------- // - selectPos: //----------------------------------------------------------------------------- - (void)selectPos:(MiscCoord_V)pos { info->selectOne( pos ); [scroll selectionChanged]; } //============================================================================= // CURSOR MANAGEMENT //============================================================================= //----------------------------------------------------------------------------- // - toggleRect:forPos:visible: //----------------------------------------------------------------------------- - (BOOL)toggleRect:(NXRect*)nxrect forPos:(MiscCoord_V)pos visible:(NXRect const*)vis { MiscPixels const pos_width = info->effectiveSize(pos); if (pos_width > 0) { NXCoord const w = TOGGLE_WIDTH + MISC_RESIZE_EPSILON; [self rect:nxrect forPos:pos]; nxrect->origin.x += nxrect->size.width - w; nxrect->size.width = w; if (NXIntersectionRect( vis, nxrect ) != 0) return YES; } return NO; } //----------------------------------------------------------------------------- // - resizeRect:forPos:visible: //----------------------------------------------------------------------------- - (BOOL)resizeRect:(NXRect*)nxrect forPos:(MiscCoord_V)pos visible:(NXRect const*)vis { MiscPixels const pos_width = info->effectiveSize(pos); if (pos_width > 0) { MiscPixels const pos_offset = info->getOffset(pos); MiscPixels const min_x = pos_offset + pos_width - MISC_RESIZE_EPSILON; MiscRect_O r( isHorz, bounds ); r.setX_O( min_x ); r.setWidth_O( MISC_RESIZE_EPSILON ); *nxrect = r; if (NXIntersectionRect( vis, nxrect ) != 0) return YES; } return NO; } //----------------------------------------------------------------------------- // - resetCursorRects //----------------------------------------------------------------------------- - (id)resetCursorRects { BOOL const draggable = info->isDraggable(); BOOL const sizeable = info->isSizeable(); NXRect vis; [self getVisibleRect:&vis]; if (draggable && !info->isModifierDrag()) [self addCursorRect:&vis cursor:dragCursor]; if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])]) { MiscCoord_V min_pos, max_pos; [self getVisibleRange:&min_pos:&max_pos]; int const count = info->count(); if (0 <= min_pos && min_pos < count) { NXRect rect; int const lim = (max_pos <= count) ? max_pos : count; for (MiscCoord_V pos = min_pos; pos < lim; pos++) if (info->isSortable(pos) && [self toggleRect:&rect forPos:pos visible:&vis]) [self addCursorRect:&rect cursor:reverseCursor]; } } if (sizeable) { BOOL const uniform = info->isUniformSize(); NXCursor* const resizeCursor = [self cursor]; MiscCoord_V min_pos, max_pos; [self getVisibleRange:&min_pos:&max_pos]; int const count = info->count(); if (0 <= min_pos && min_pos < count) { NXRect rect; int const lim = (max_pos <= count) ? max_pos : count; for (MiscCoord_V pos = min_pos; pos < lim; pos++) if ((uniform || info->isSizeable(pos)) && [self resizeRect:&rect forPos:pos visible:&vis]) [self addCursorRect:&rect cursor:resizeCursor]; } } return self; } //============================================================================= // MOUSE-TRACKING //============================================================================= //----------------------------------------------------------------------------- // - posForMousePt: //----------------------------------------------------------------------------- - (MiscCoord_V)posForMousePt:(NXPoint const*)p { MiscPixels pix = MiscPoint_O( isHorz, *p ).getX_O(); MiscRect_O r( isHorz, bounds ); return (pix < r.getMaxX_O() ? info->visualForOffset( pix ) : info->count()); } //============================================================================= // RESIZING //============================================================================= //----------------------------------------------------------------------------- // - resizeEvent:x:deltaX:minX:maxX: //----------------------------------------------------------------------------- - (int)resizeEvent:(NXEvent const*)p x:(MiscPixels)x deltaX:(MiscPixels)deltaX minX:(MiscPixels)minX maxX:(MiscPixels)maxX { NXRect nxDocFrame; [scroll getDocClipFrame:&nxDocFrame]; NXRect nxClipFrame; [superview getFrame:&nxClipFrame]; MiscRect_O docFrame( isHorz, nxDocFrame ); MiscRect_O clipFrame( isHorz, nxClipFrame ); NXCoord const minDrawX = (NXCoord)clipFrame.getX_O(); // scroll coords NXCoord const maxDrawX = (NXCoord)clipFrame.getMaxX_O(); // scroll coords x += deltaX; NXCoord draw_x; // scroll coords MiscRect_O line( isHorz ); line.setX_O( x - 1 ); line.setY_O( 0 ); line.setWidth_O( 2 ); line.setHeight_O( clipFrame.getHeight_O() + docFrame.getHeight_O() - 1 ); [self convertOriginToScroll:&line]; draw_x = line.getX_O(); BOOL did_scroll = NO; BOOL in_bounds = (minDrawX <= draw_x && draw_x <= maxDrawX); [scroll lockFocus]; PSsetinstance(YES); NXSetColor( NX_COLORBLACK ); if (in_bounds) { NXRect r = line; NXRectFill( &r ); } NXTrackingTimer* timer = 0; startTimer( timer ); NXEvent lastEvent = *p; while (1) { p = [NXApp getNextEvent:NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK | NX_TIMERMASK ]; if (p == 0 || p->type == NX_MOUSEUP) break; if (p->type == NX_TIMER) { NXPoint mousePt = lastEvent.location; [scroll convertPoint:&mousePt fromView:0]; MiscPixels const mousePtX = MiscPoint_O( isHorz,mousePt ).getX_O(); if (mousePtX < minDrawX || maxDrawX < mousePtX) { PSsetinstance(NO); [self autoscroll:&lastEvent]; PSsetinstance(YES); did_scroll = YES; } } else lastEvent = *p; NXPoint new_loc = lastEvent.location; [self convertPoint:&new_loc fromView:0]; MiscPixels mouseX = MiscPoint_O( isHorz, new_loc ).getX_O(); MiscPixels new_x = (mouseX + deltaX); if (new_x < minX) new_x = minX; else if (new_x >= maxX) new_x = maxX - 1; BOOL const did_move = (new_x != x); if (did_move || did_scroll) { if (in_bounds && !did_scroll) PShideinstance( line.getX(), line.getY(), line.getWidth(), line.getHeight() ); if (did_move) { x = new_x; line.setX_O( x - 1 ); line.setY_O( 0 ); [self convertOriginToScroll:&line]; draw_x = line.getX_O(); in_bounds = (minDrawX <= draw_x && draw_x <= maxDrawX); } if (in_bounds) { NXRect r = line; NXRectFill( &r ); } did_scroll = NO; } } stopTimer( timer ); if (in_bounds) PShideinstance( line.getX(), line.getY(), line.getWidth(), line.getHeight() ); PSsetinstance(NO); [scroll unlockFocus]; x -= deltaX; return x; } //----------------------------------------------------------------------------- // - resizeEvent:inPos:atX:deltaX:finalWidth: //----------------------------------------------------------------------------- - (BOOL)resizeEvent:(NXEvent const*)p inPos:(MiscCoord_V)pos atX:(MiscPixels)x_origin deltaX:(MiscPixels)delta_x finalWidth:(MiscPixels*)finalWidth { MiscPixels const org_x = info->getOffset(pos); MiscPixels const min_x = org_x + info->effectiveMinSize(pos); MiscPixels const max_x = org_x + info->getMaxSize(pos) + 1; MiscPixels const curr_x = [self resizeEvent:p x:x_origin deltaX:delta_x minX:min_x maxX:max_x]; MiscPixels final_delta = curr_x - x_origin; if (final_delta != 0) { *finalWidth = info->effectiveSize(pos) + final_delta; return YES; } return NO; } //----------------------------------------------------------------------------- // - inResizeZone:forPos:atX:deltaX: //----------------------------------------------------------------------------- - (BOOL)inResizeZone:(NXPoint const*)pt forPos:(MiscCoord_V*)pos atX:(MiscPixels*)pos_x deltaX:(MiscPixels*)delta_x { if (info->isSizeable()) { MiscCoord_V const plim = info->count(); MiscPixels x = MiscPoint_O( isHorz, *pt ).getX_O(); MiscCoord_V p = info->visualForOffset(x); if (0 <= p && p < plim) { BOOL const uniform = info->isUniformSize(); MiscPixels max_x = info->getOffset(p) + info->effectiveSize(p); MiscPixels delta = max_x - x; if (0 <= delta && delta <= MISC_RESIZE_EPSILON) { do { p++; } while (p < plim && info->effectiveSize(p) <= 0); p--; if (0 <= p && p < plim && (uniform || info->isSizeable(p))) { *pos = p; *pos_x = x; *delta_x = delta; return YES; } } } } return NO; } //----------------------------------------------------------------------------- // - adjustSize //----------------------------------------------------------------------------- - (void)adjustSize { [self changeFrameIfNeeded]; } //============================================================================= // DRAGGING //============================================================================= //----------------------------------------------------------------------------- // draw_view // Draw a view hierarchy without calling lockFocus so that it can be // drawn onto a different window. Used for drawing the drag cache // window. //----------------------------------------------------------------------------- static void draw_view( View* v, NXRect const* r ) { // FIXME: maybe clip, maybe manually transform graphics state coord matrix. [v drawSelf:r:1]; List* subs = [v subviews]; unsigned int lim = (subs ? [subs count] : 0); for (unsigned int i = 0; i < lim; i++) { View* sub = (View*) [subs objectAt:i]; NXRect frame; [sub getFrame:&frame]; if (NXIntersectionRect( r, &frame ) != 0) { [sub convertRect:&frame fromView:v]; draw_view( sub, &frame ); } } } //----------------------------------------------------------------------------- // - dragCacheForPos: // // NOTE *COORDS* // The TableScroll, BorderView, and TableView all share the the same // scaling and rotation. Also, the coordinate system of the TableView // is always anchored at the same "X" offset as the BorderView, so that // (orientation corrected) "X" coordinates and widths can be exchanged // between the two views without further adjustments. //----------------------------------------------------------------------------- - (NXImage*)dragCacheForPos:(MiscCoord_V)pos { NXImage* cache = [[NXImage allocFromZone:[self zone]] init]; MiscTableView* tableView = (MiscTableView*) [scroll docView]; NXRect nxBorder; [self rect:&nxBorder forPos:pos]; NXRect nxTable; [tableView getVisibleRect:&nxTable]; MiscRect_O oBorder( isHorz, nxBorder ); MiscRect_O oTable( isHorz, nxTable ); MiscSize_O oCache( isHorz ); oCache.setWidth_O( oBorder.getWidth_O() ); oCache.setHeight_O( oBorder.getHeight_O() + oTable.getHeight_O() ); NXSize nxCache = oCache; [cache setSize:&nxCache]; if (oTable.getX_O() <= oBorder.getX_O() && // Is entire slot oBorder.getMaxX_O() <= oTable.getMaxX_O()) // visible? { MiscRect_O oScroll( isHorz ); oScroll.setX_O( oBorder.getX_O() ); oScroll.setY_O( oBorder.getY_O() ); oScroll.setWidth_O( oBorder.getWidth_O() ); oScroll.setHeight_O( oCache.getHeight_O() ); NXRect nxScroll = oScroll; [scroll convertRect:&nxScroll fromView:self]; [scroll lockFocus]; NXBitmapImageRep* rep = [[NXBitmapImageRep allocFromZone:[self zone]] initData:0 fromRect:&nxScroll]; [scroll unlockFocus]; [cache useRepresentation:rep]; } else { [cache setFlipped:YES]; [cache lockFocus]; oTable.setX_O( oBorder.getX_O() ); // NOTE *COORDS* oTable.setWidth_O( oBorder.getWidth_O() ); nxTable = oTable; MiscPoint_O oDelta( isHorz, nxTable.origin ); oDelta.setY_O( oDelta.getY_O() - oBorder.getHeight_O() ); NXPoint delta = oDelta; View* focusView = [NXApp focusView]; [focusView translate:-delta.x:-delta.y]; draw_view( tableView, &nxTable ); [focusView translate:delta.x:delta.y]; [focusView translate:-nxBorder.origin.x:-nxBorder.origin.y]; draw_view( self, &nxBorder ); [focusView translate:nxBorder.origin.x:nxBorder.origin.y]; [cache unlockFocus]; } return cache; } //----------------------------------------------------------------------------- // - getVisibleCacheMin:max: //----------------------------------------------------------------------------- - (NXImage*)getVisibleCacheMin:(MiscPixels*)pMin max:(MiscPixels*)pMax { NXRect nxDoc; [[scroll docView] getVisibleRect:&nxDoc]; NXRect nxVis; [self getVisibleRect:&nxVis]; MiscRect_O rDoc( isHorz ); MiscRect_O rVis( isHorz, nxVis ); *pMin = rVis.getX_O(); *pMax = rVis.getMaxX_O(); [scroll convertRect:&nxDoc fromView:[scroll docView]]; [scroll convertRect:&nxVis fromView:self]; rDoc = nxDoc; rVis = nxVis; MiscRect_O r( isHorz ); r.setX_O( rVis.getX_O() ); r.setY_O( rVis.getY_O() ); r.setWidth_O( rVis.getWidth_O() ); r.setHeight_O( rVis.getHeight_O() + rDoc.getHeight_O() ); NXRect nxr = r; [scroll lockFocus]; NXBitmapImageRep* rep = [[NXBitmapImageRep allocFromZone:[self zone]] initData:0 fromRect:&nxr]; [scroll unlockFocus]; NXImage* cache = [[NXImage allocFromZone:[self zone]] initSize:&nxr.size]; [cache useRepresentation:rep]; return cache; } //----------------------------------------------------------------------------- // - setWells::forPos: //----------------------------------------------------------------------------- - (void)setWells:(MiscTableWell**)w1 :(MiscTableWell**)w2 forPos:(MiscCoord_V)pos { NXZone* const z = [self zone]; MiscTableView* doc = [scroll docView]; NXRect nxDoc; [doc getVisibleRect:&nxDoc]; NXRect nxClip; [superview getFrame:&nxClip]; MiscRect_O rDoc( isHorz, nxDoc ); MiscRect_O rClip( isHorz, nxClip ); MiscRect_O r( isHorz ); r.setX_O( info->getOffset(pos) ); r.setWidth_O( info->effectiveSize(pos) ); r.setHeight_O( rClip.getHeight_O() ); NXRect nxr = r; *w1 = [[MiscTableWell allocFromZone:z] initFrame:&nxr]; [self addSubview:*w1]; r.setY_O( rDoc.getY_O() ); r.setHeight_O( rDoc.getHeight_O() ); nxr = r; *w2 = [[MiscTableWell allocFromZone:z] initFrame:&nxr]; [doc addSubview:*w2]; [*w1 display]; [*w2 display]; } //----------------------------------------------------------------------------- // - clearWells:: //----------------------------------------------------------------------------- - (void)clearWells:(MiscTableWell**)w1 :(MiscTableWell**)w2 { [*w1 removeFromSuperview]; [*w2 removeFromSuperview]; [*w1 free]; [*w2 free]; *w1 = 0; *w2 = 0; // NOTE: Does not need display here. Everything will get displayed later. } //----------------------------------------------------------------------------- // - offsetFromEvent: //----------------------------------------------------------------------------- - (NXCoord)offsetFromEvent:(NXEvent const*)ev { NXPoint mLoc = ev->location; [self convertPoint:&mLoc fromView:0]; return (NXCoord) MiscPoint_O( isHorz, mLoc ).getX_O(); } //----------------------------------------------------------------------------- // - calcDrop:: //----------------------------------------------------------------------------- - (MiscCoord_V)calcDrop :(MiscCoord_V)fromPos :(NXPoint const*)mouseDownPt :(NXPoint const*)mouseUpPt { MiscCoord_V toPos = fromPos; MiscPixels const start_pos = MiscPoint_O( isHorz, *mouseDownPt ).getX_O(); MiscPixels const end_pos = MiscPoint_O( isHorz, *mouseUpPt ).getX_O(); MiscPixels const delta_pos = (end_pos - start_pos); MiscPixels const SLOP = 4; if (delta_pos < -SLOP || SLOP < delta_pos) { MiscPixels const start_ofs = info->getOffset( fromPos ); MiscPixels drop_pos = start_ofs + delta_pos; if (delta_pos < 0) drop_pos += SLOP; else drop_pos += info->effectiveSize(fromPos) - SLOP; toPos = info->visualForOffset( drop_pos ); if (toPos < 0) toPos = 0; } return toPos; } //----------------------------------------------------------------------------- // - dragEvent:inPos: //----------------------------------------------------------------------------- - (MiscCoord_V)dragEvent:(NXEvent*)event inPos:(MiscCoord_V)pos { int const WANTED = (NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK | NX_TIMERMASK); NXPoint mouseDownPt = event->location; [self convertPoint:&mouseDownPt fromView:0]; NXPoint mouseUpPt = mouseDownPt; [scroll disableCursor]; [window flushWindow]; [window disableFlushWindow]; NXImage* dragCache = [self dragCacheForPos:pos]; MiscTableWell *w1, *w2; [self setWells:&w1 :&w2 forPos:pos]; MiscPixels pMin,pMax; NXImage* visCache = [self getVisibleCacheMin:&pMin max:&pMax]; NXSize nxSize; NXPoint nxPoint; NXRect nxRect; [dragCache getSize:&nxSize]; MiscSize_O size( isHorz, nxSize ); MiscPixels pLoc = info->getOffset( pos ); MiscPixels delta = MiscPixels( [self offsetFromEvent:event] - pLoc ); NXTrackingTimer* timer = 0; NXEvent lastEvent = *event; [scroll lockFocus]; while (1) { MiscPoint_O pt( isHorz ); MiscRect_O rDrag( isHorz ); MiscPixels const w = size.getWidth_O(); MiscPixels const dw = dmin( dmin( dmin(w, pMax - pMin), pMax - pLoc), pLoc + w - pMin ); BOOL const shouldDraw = (dw > 0.0); if (shouldDraw) { if (isHorz) { pt.setX( dmax( pLoc, pMin ) ); pt.setY( size.getHeight_O() ); if (pLoc < pMin) rDrag.setX( pMin - pLoc ); } else { pt.setX( 0 ); pt.setY( dmax( pLoc, pMin ) + dw ); if (pLoc + w >= pMax) rDrag.setY( pLoc + w - pMax ); } [self convertPointToScroll:&pt]; nxPoint = pt; rDrag.setWidth_O( dw ); rDrag.setHeight_O( size.getHeight_O() ); nxRect = rDrag; [dragCache composite:NX_COPY fromRect:&nxRect toPoint:&nxPoint]; } [[window reenableFlushWindow] flushWindow]; event = [NXApp getNextEvent:WANTED]; [window disableFlushWindow]; if (shouldDraw) { NXSize s; [visCache getSize:&s]; MiscPixels xTarg; if (isHorz) { xTarg = (pLoc < pMin ? 0 : pLoc - pMin); } else { if (pLoc < pMin) xTarg = MiscPixels(s.height) - dw; else if (pLoc < pMax) xTarg = pMax - pLoc - dw; else xTarg = 0; } MiscRect_O rVis( isHorz ); rVis.setX_O( xTarg ); rVis.setWidth_O( rDrag.getWidth_O() ); rVis.setHeight_O( rDrag.getHeight_O() ); nxRect = rVis; nxPoint = pt; [visCache composite:NX_COPY fromRect:&nxRect toPoint:&nxPoint]; } if (event == 0) break; if (event->type == NX_MOUSEUP) { mouseUpPt = event->location; [self convertPoint:&mouseUpPt fromView:0]; break; } if (event->type != NX_TIMER) lastEvent = *event; MiscPixels mLoc = MiscPixels( [self offsetFromEvent:&lastEvent] ); if ((mLoc < pMin && pMin > 0.0) || (mLoc > pMax && pMax < MiscRect_O( isHorz, bounds ).getMaxX_O())) { [self autoscroll:&lastEvent]; [visCache free]; visCache = [self getVisibleCacheMin:&pMin max:&pMax]; mLoc = MiscPixels( [self offsetFromEvent:&lastEvent] ); startTimer( timer ); } else { stopTimer( timer ); } pLoc = mLoc - delta; if (pLoc < pMin - size.getWidth_O()) pLoc = pMin - size.getWidth_O(); else if (pLoc > pMax) pLoc = pMax; } stopTimer( timer ); [scroll unlockFocus]; [self clearWells:&w1 :&w2]; [visCache free]; [dragCache free]; MiscCoord_V const toPos = [self calcDrop:pos :&mouseDownPt :&mouseUpPt]; if (toPos != pos) { BOOL const was_auto = [scroll isAutodisplay]; [scroll setAutodisplay:NO]; [scroll border:[self borderType] moveSlotFrom:pos to:toPos]; [window invalidateCursorRectsForView:self]; [scroll border:[self borderType] slotDraggedFrom:pos to:toPos]; [scroll reenableCursor]; [scroll update]; [scroll setAutodisplay:was_auto]; // Will display if needed. } else { // Need to redisplay the slot that the wells were covering. MiscBorderType const b = [self borderType]; int const phys_pos = [scroll border:b slotAtPosition:toPos]; [scroll border:b drawSlotTitle:phys_pos]; [scroll border:b drawSlot:phys_pos]; [scroll reenableCursor]; } [[window reenableFlushWindow] flushWindow]; return toPos; } //----------------------------------------------------------------------------- // - awaitDragEvent:inPos: //----------------------------------------------------------------------------- - (MiscCoord_V)awaitDragEvent:(NXEvent const*)event inPos:(MiscCoord_V)pos { MiscCoord_V toPos = pos; int const WANTED = (NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK); float const FOREVER = FLT_MAX; float const SLOP = 2.0; NXEvent mouseDown = *event; for (;;) { NXEvent peek; NXEvent* p = [NXApp peekNextEvent:WANTED into:&peek waitFor:FOREVER threshold:NX_MODALRESPTHRESHOLD]; if (p == 0 || p->type == NX_MOUSEUP) break; else if (p->location.x > mouseDown.location.x + SLOP || p->location.y > mouseDown.location.y + SLOP || p->location.x < mouseDown.location.x - SLOP || p->location.y < mouseDown.location.y - SLOP) { [scroll suspendEditing]; toPos = [self dragEvent:&mouseDown inPos:pos]; [scroll resumeEditing]; break; } else [NXApp getNextEvent:NX_MOUSEDRAGGEDMASK]; } return toPos; } //============================================================================= // TOGGLE SORT DIRECTION //============================================================================= //----------------------------------------------------------------------------- // - toggleRect:forPos: //----------------------------------------------------------------------------- - (void)toggleRect:(NXRect*)r forPos:(MiscCoord_V)pos { [self rect:r forPos:pos]; NXCoord const w = TOGGLE_WIDTH + MISC_RESIZE_EPSILON; r->origin.x = floor( r->origin.x + r->size.width - w ); r->size.width = w; } //----------------------------------------------------------------------------- // - inToggleZone:forPos: //----------------------------------------------------------------------------- - (BOOL)inToggleZone:(NXPoint const*)pt forPos:(MiscCoord_V)pos { if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])] && info->isSortable(pos)) { NXRect r; [self toggleRect:&r forPos:pos]; return r.origin.x <= pt->x && pt->x <= (r.origin.x + r.size.width); } return NO; } //----------------------------------------------------------------------------- // - toggleEvent:forPos: //----------------------------------------------------------------------------- - (void)toggleEvent:(NXEvent const*)p forPos:(MiscCoord_V)pos { NXRect toggleZone; BOOL was_in_zone = YES; BOOL is_in_zone = YES; [self toggleRect:&toggleZone forPos:pos]; togglePos = pos; [self lockFocus]; [self drawPos:pos]; [window flushWindow]; DPSFlush(); while (1) { p = [NXApp getNextEvent:NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK ]; if (p == 0) break; NXPoint new_loc = p->location; [self convertPoint:&new_loc fromView:0]; is_in_zone = NXPointInRect( &new_loc, &toggleZone ); if (was_in_zone != is_in_zone) { was_in_zone = is_in_zone; togglePos = (is_in_zone ? pos : -1); [self drawPos:pos]; [window flushWindow]; DPSFlush(); } if (p->type == NX_MOUSEUP) break; } togglePos = -1; [self unlockFocus]; if (is_in_zone) { BOOL const was_auto = [scroll isAutodisplay]; [scroll setAutodisplay:NO]; MiscBorderType const bt = [self borderType]; MiscSortDirection dir = info->getSortDirection( pos ); dir = MISC_OTHER_DIRECTION( dir ); MiscCoord_P p_pos = info->visualToPhysical( pos ); [scroll border:bt setSlot:p_pos sortDirection:dir]; [scroll border:bt slotSortReversed:p_pos]; [scroll update]; [scroll setAutodisplay:was_auto]; } } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - adjustCursor: //----------------------------------------------------------------------------- - (void)adjustCursor:(MiscCoord_V)pos { if (pos < 0) pos = 0; else if (pos >= info->count()) pos = info->count() - 1; [scroll border:[self borderType] setCursor:info->visualToPhysical(pos)]; } //----------------------------------------------------------------------------- // - selectionEvent:fromPos: //----------------------------------------------------------------------------- - (void)selectionEvent:(NXEvent const*)p fromPos:(MiscCoord_V)pos { BOOL doubleClicked = (p->data.mouse.click > 1); [scroll disableCursor]; [self clearOtherBorder]; [tracker mouseDown:p atPos:pos]; [scroll selectionChanged]; NXTrackingTimer* timer = 0; startTimer( timer ); NXEvent lastEvent = *p; while (1) { p = [NXApp getNextEvent:NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK | NX_TIMERMASK ]; if (p == 0 || p->type == NX_MOUSEUP) break; else if (p->type == NX_TIMER) [self autoscroll:&lastEvent]; else lastEvent = *p; NXPoint new_loc = lastEvent.location; [self convertPoint:&new_loc fromView:0]; MiscCoord_V new_pos = [self posForMousePt:&new_loc]; if (new_pos != pos) { pos = new_pos; [tracker mouseDragged:p atPos:pos]; [scroll selectionChanged]; } } stopTimer( timer ); [tracker mouseUp:p atPos:pos]; [scroll selectionChanged]; [self adjustCursor:pos]; [scroll reenableCursor]; [[self window] flushWindow]; if ([scroll isEnabled]) { [scroll sendAction]; if (doubleClicked) [scroll sendDoubleAction]; } } //============================================================================= // MOUSE-EVENTS //============================================================================= //----------------------------------------------------------------------------- // - acceptsFirstMouse //----------------------------------------------------------------------------- - (BOOL)acceptsFirstMouse { return YES; } //----------------------------------------------------------------------------- // - mouseDown: // // NOTE: *OUT-OF-BOUNDS* // The AppKit allows up to 3 pixels of slop on double-clicks even when // the new location is outside the bounds of the view receiving the // original click. They send the second event to the original view, but // they do not coerce the location to the same location as the original // event. Our code assumes all mouseDown: events are located within // the bounds of our view, so reject all events outside our bounds. //----------------------------------------------------------------------------- - (id)mouseDown:(NXEvent*)p { NXPoint evpt = p->location; [self convertPoint:&evpt fromView:0]; if (evpt.x >= 0 && evpt.x < bounds.size.width && // NOTE *OUT-OF-BOUNDS* evpt.y >= 0 && evpt.y <= bounds.size.height) { MiscCoord_V pos = [self posForMousePt:&evpt]; int const old_mask = [window addToEventMask:NX_MOUSEDRAGGEDMASK]; MiscPixels x, delta_x; if ([self inResizeZone:&evpt forPos:&pos atX:&x deltaX:&delta_x]) { [scroll suspendEditing]; MiscPixels finalWidth; BOOL doit; doit = [self resizeEvent:p inPos:pos atX:x deltaX:delta_x finalWidth:&finalWidth]; if (doit) { [window disableFlushWindow]; if (info->isUniformSize()) { [scroll border:[self borderType] setUniformSizeSlots:(NXCoord)finalWidth]; [window invalidateCursorRectsForView:self]; [scroll update]; } else [self setPos:pos width:finalWidth]; [scroll border:[self borderType] slotResized:pos]; [[window reenableFlushWindow] flushWindow]; } [scroll resumeEditing]; } else if ([self inToggleZone:&evpt forPos:pos]) { [scroll suspendEditing]; [self toggleEvent:p forPos:pos]; [scroll resumeEditing]; } else if (info->isDraggable() && (info->isModifierDrag() == ((p->flags & NX_COMMANDMASK) != 0))) { [self awaitDragEvent:p inPos:pos]; } else { MiscAssert( tracker != 0 ); [scroll selectText:self]; // Ends cell editing. [self selectionEvent:p fromPos:pos]; } [window setEventMask:old_mask]; return self; } return 0; } @end MiscKit/Palettes/MiscTableScroll/MiscBorderView.h100444 1750 1750 4741 6757716146 22303 0ustar sunshinesunshine#ifndef __MiscBorderView_h #define __MiscBorderView_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderView.h // // View class for the row/column borders on a MiscTableView. // Supports resizing, dragging. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderView.h,v 1.7 97/02/11 19:13:52 sunshine Exp $ // $Log: MiscBorderView.h,v $ // Revision 1.7 97/02/11 19:13:52 sunshine // v123: reflectSelection --> selectionChanged // Now checks isAutodisplay in -selectionChanged. // // Revision 1.6 96/12/30 16:19:49 zarnuk // Added -setFrameHeight:. // // Revision 1.5 96/09/20 10:32:47 zarnuk // Added -resetSelection to fix problems with stale/invalid "oldSel". //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import enum MiscBorderViewType { MISC_COL_BORDER_VIEW, MISC_ROW_BORDER_VIEW }; class MiscSparseSet; class MiscTableBorder; @class MiscBorderCell, MiscMouseTracker, MiscTableScroll, MiscTableView; @class NXCursor; @interface MiscBorderView : View { MiscTableScroll* scroll; MiscTableBorder* info; MiscBorderCell* theCell; MiscMouseTracker* tracker; MiscSparseSet* oldSel; MiscCoord_V togglePos; BOOL isHorz; } - (id)initFrame:(NXRect const*)frameRect scroll:(MiscTableScroll*)scroll info:(MiscTableBorder*)info type:(MiscBorderViewType)type; - (id)free; - (MiscPixels)frameHeight; - (void)setFrameHeight:(MiscPixels)x; - (void)adjustSize; - (void)setSelectionMode:(MiscSelectionMode)mode; - (void)selectionChanged; - (void)resetSelection; - (void)drawSlot:(MiscCoord_V)x; @end #endif // __MiscBorderView_h MiscKit/Palettes/MiscTableScroll/MiscColView.M100444 1750 1750 3235 6757716146 21545 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColView.M // // View class for the column headings on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColView.M,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscColView.M,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #import "MiscColView.h" @implementation MiscColView //----------------------------------------------------------------------------- // - initFrame:spreadSheet: //----------------------------------------------------------------------------- - initFrame: (NXRect const*) frameRect scroll: (MiscTableScroll*) i_scroll info: (MiscTableBorder*) i_info { [super initFrame:frameRect scroll:i_scroll info:i_info type:MISC_COL_BORDER_VIEW]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscColView.h100444 1750 1750 2715 6757716146 21602 0ustar sunshinesunshine#ifndef __MiscColView_h #define __MiscColView_h //============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColView.h // // View class for the column headings on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColView.h,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscColView.h,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #import "MiscBorderView.h" @interface MiscColView : MiscBorderView { } - initFrame: (NXRect const*) frameRect scroll: (MiscTableScroll*) scroll info: (MiscTableBorder*) info; @end #endif // __MiscColView_h MiscKit/Palettes/MiscTableScroll/MiscColorList.h100444 1750 1750 4011 6757716146 22133 0ustar sunshinesunshine#ifndef __MiscColorList_h #define __MiscColorList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColorList.h // // An extensible array of colors that can act as a color palette to // reduce the storage overhead of storing a lot of colors. Also // useful for speeding color comparisons in some cases. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColorList.h,v 1.1 96/08/30 14:51:51 sunshine Exp $ // $Log: MiscColorList.h,v $ // Revision 1.1 96/08/30 14:51:51 sunshine // Extensible array of colors acting as a color palette. // //----------------------------------------------------------------------------- extern "Objective-C" { #import } struct MiscColorList { private: int num_colors; int max_colors; NXColor* colors; MiscColorList(MiscColorList const&) {} // No copy constructor. void operator = (MiscColorList const&) {} // No assign operator. public: MiscColorList(); ~MiscColorList(); int count() const { return num_colors; } void empty() { num_colors = 0; } NXColor const& nth( int n ) const { return colors[n]; } NXColor const& operator [] ( int n ) const { return colors[n]; } int store( NXColor c ); }; #endif // __MiscColorList_h MiscKit/Palettes/MiscTableScroll/MiscCornerView.M100444 1750 1750 5170 6757716146 22260 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscCornerView.M // // View class that covers the gap in the upper left corner when a // MiscTableScroll has both row and column titles turned on. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscCornerView.M,v 1.3 97/12/19 00:46:07 zarnuk Exp $ // $Log: MiscCornerView.M,v $ // Revision 1.3 97/12/19 00:46:07 zarnuk // v133: Renamed, MiscNullView -> MiscCornerView. Added get/setTitle. // // Revision 1.2 96/01/13 23:38:37 zarnuk // Now allocates the cell from [self zone]. //----------------------------------------------------------------------------- #import "MiscCornerView.h" #import "MiscBorderCell.h" extern "Objective-C" { #import } @implementation MiscCornerView - (char const*)title { return [theCell stringValue]; } - (id)setTitle:(char const*)s { [theCell setStringValue:s]; return self; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - free { [theCell free]; return [super free]; } //----------------------------------------------------------------------------- // - initFrame: //----------------------------------------------------------------------------- - initFrame:(NXRect const*)frameRect { [super initFrame:frameRect]; [self setFlipped:YES]; [self setOpaque:YES]; [self setClipping:NO]; theCell = [[MiscBorderCell allocFromZone:[self zone]] initTextCell:""]; return self; } //----------------------------------------------------------------------------- // - drawSelf:: //----------------------------------------------------------------------------- - drawSelf: (NXRect const*) rects : (int) nrects { [theCell drawSelf:&bounds inView:self]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscGeometry.cc100444 1750 1750 2363 6757716165 22163 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscGeometry.h //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscGeometry.cc,v 1.1 96/05/05 10:53:55 sunshine Exp $ // $Log: MiscGeometry.cc,v $ // Revision 1.1 96/05/05 10:53:55 sunshine // Geometric type structures which know their border orientation. // //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #import "MiscGeometry.h" MiscKit/Palettes/MiscTableScroll/MiscCornerView.h100444 1750 1750 3241 6757716147 22311 0ustar sunshinesunshine#ifndef __MiscCornerView_h #define __MiscCornerView_h //============================================================================= // // Copyright (C) 1995,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscCornerView.h // // View class that covers the gap in the upper left corner when a // MiscTableScroll has both row and column titles turned on. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscCornerView.h,v 1.2 97/12/19 00:44:59 zarnuk Exp $ // $Log: MiscCornerView.h,v $ // Revision 1.2 97/12/19 00:44:59 zarnuk // v133: Renamed, MiscNullView -> MiscCornerView. Added get/setTitle. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class MiscBorderCell; @interface MiscCornerView : View { MiscBorderCell* theCell; } - (char const*)title; - (id)setTitle:(char const*)s; @end #endif // __MiscCornerView_h MiscKit/Palettes/MiscTableScroll/MiscDelegateFlags.h100444 1750 1750 11567 6757716147 22747 0ustar sunshinesunshine#ifndef __MiscDelegateFlags_h #define __MiscDelegateFlags_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDelegateFlags.h // // Flags indicating which selectors a delegate responds to. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDelegateFlags.h,v 1.9 99/06/29 07:33:07 sunshine Exp $ // $Log: MiscDelegateFlags.h,v $ // Revision 1.9 99/06/29 07:33:07 sunshine // v140: Added new delegate messages for becoming & resigning first responder. // // Revision 1.8 98/03/24 04:52:47 sunshine // v138: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // // Revision 1.7 97/12/22 21:59:23 zarnuk // v134: Eliminated -tableScroll:edit:at::. //----------------------------------------------------------------------------- #include "bool.h" extern "Objective-C" { #import } class MiscDelegateFlags { public: enum Selector { DEL_SLOT_DRAGGED, // tableScroll:border:slotDraggedFro... DEL_SLOT_REVERSED, // tableScroll:border:slotSortReversed: DEL_SLOT_RESIZED, // tableScroll:border:slotResized: DEL_CHANGE_FONT, // tableScroll:changeFont:to: DEL_FONT_CHANGED, // tableScroll:fontChangedFrom:to: DEL_BACK_COLOR_CHANGED, // tableScroll:backgroundColorChange... DEL_BACKH_COLOR_CHANGED, // tableScroll:highlightBackgroundCo... DEL_TEXT_COLOR_CHANGED, // tableScroll:textColorChangedTo: DEL_TEXTH_COLOR_CHANGED, // tableScroll:highlightTextColorCha... DEL_GET_ISEARCH_COL, // tableScroll:getISearchCol: DEL_BUFF_COUNT, // tableScrollBuffCount: DEL_SLOT_PROTOTYPE, // tableScroll:border:slotPrototype: DEL_SLOT_TITLE, // tableScroll:border:slotTitle: DEL_CELL_AT, // tableScroll:cellAt:: DEL_REVIVE_CELL, // tableScroll:reviveCell:at:: DEL_RETIRE_CELL, // tableScroll:retireCell:at:: DEL_TAG_AT, // tableScroll:tagAt:: DEL_INT_VALUE_AT, // tableScroll:intValueAt:: DEL_FLOAT_VALUE_AT, // tableScroll:floatValueAt:: DEL_DOUBLE_VALUE_AT, // tableScroll:doubleValueAt:: DEL_STRING_VALUE_AT, // tableScroll:stringValueAt:: DEL_TITLE_AT, // tableScroll:titleAt:: DEL_STATE_AT, // tableScroll:stateAt:: DEL_REGISTER_SERVICE_TYPES, // tableScrollRegisterServicesTypes: DEL_VALID_REQUESTOR, // tableScroll:validRequestorForSend... DEL_CAN_WRITE_PB_TYPE, // tableScroll:canWritePboardType: DEL_WRITE_PB_TYPE_TO_STREAM, // tableScroll:writePboard:type:toSt... DEL_WRITE_SEL_TO_PB_TYPES, // tableScroll:writeSelectionToPaste... DEL_READ_SEL_FROM_PB, // tableScroll:readSelectionFromPast... DEL_ALLOW_DRAG, // tableScroll:allowDragOperationAt:... DEL_PREPARE_PB_FOR_DRAG, // tableScroll:preparePasteboard:for... DEL_IMAGE_FOR_DRAG, // tableScroll:imageForDragOperation... DEL_DRAG_OP_MASK, // tableScroll:draggingSourceOperati... DEL_DRAG_IGNORE_MODIFIERS, // tableScrollIgnoreModifierKeysWhil... DEL_DRAG_DELAY_WIN_ORDERING, // tableScroll:shouldDelayWindowOrde... DEL_WILL_PRINT, // tableScrollWillPrint: DEL_DID_PRINT, // tableScroll:didPrint: DEL_PRINT_PAGE_HEADER, // tableScroll:willPrintPageHeader:i... DEL_PRINT_PAGE_FOOTER, // tableScroll:willPrintPageFooter:i... DEL_CAN_EDIT_AT, // tableScroll:canEdit:at:: DEL_SET_STRINGVALUE_AT, // tableScroll:setStringValue:at:: DEL_ABORT_EDIT_AT, // tableScroll:abortEditAt:: DEL_WILL_EDIT_AT, // tableScroll:willEditAt:: DEL_DID_EDIT_AT, // tableScroll:didEdit:at:: DEL_TEXT_DID_END, // textDidEnd:endChar: DEL_TEXT_DID_CHANGE, // textDidChange: DEL_TEXT_DID_GET_KEYS, // textDidGetKeys:isEmpty: DEL_TEXT_WILL_CHANGE, // textWillChange: DEL_TEXT_WILL_END, // textWillEnd: DEL_DID_BECOME_FIRST_RESP, // tableScrollDidBecomeFirstResponder: DEL_DID_RESIGN_FIRST_RESP, // tableScrollDidResignFirstResponder: MAX_DEL_ENUM, BAD_DEL_ENUM = -1 }; private: int const SET_SIZE = ((MAX_DEL_ENUM - 1) / 8) + 1; unsigned char set[ SET_SIZE ]; public: MiscDelegateFlags( id delegate = 0 ) { setDelegate( delegate ); } void setDelegate( id delegate ); bool respondsTo( Selector ) const; static SEL selToObjc( Selector ); static Selector objcToSel( SEL ); // Returns BAD_DEL_ENUM if not found. }; #endif // __MiscDelegateFlags_h MiscKit/Palettes/MiscTableScroll/MiscDrawList.h100444 1750 1750 4556 6757716147 21771 0ustar sunshinesunshine#ifndef __MiscDrawList_h #define __MiscDrawList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDrawList.h // // An extensible array of specifications for drawing cell contents. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDrawList.h,v 1.3 97/12/19 00:47:32 zarnuk Exp $ // $Log: MiscDrawList.h,v $ // Revision 1.3 97/12/19 00:47:32 zarnuk // v133: Corrected copyright notice. // // Revision 1.2 97/12/19 00:46:57 zarnuk // v133: added draw_clipped_text flag. //----------------------------------------------------------------------------- #include "MiscColorList.h" #include extern "Objective-C" { @class Font, NXImage; #import // NXRect, NXColor } class MiscLineWrapper; struct MiscDrawList { public: struct Rec { NXRect text_rect; NXRect icon_rect; char* text; Font* font; NXImage* image; int text_color; int flags; // (alignment << 1) | (char_wrap) void draw_icon(); void draw_text( MiscLineWrapper& ) const; }; private: MiscColorList color_list; int num_recs; int max_recs; Rec* recs; bool draw_clipped_text; MiscDrawList(MiscDrawList const&) {} // No copy constructor. void operator = (MiscDrawList const&) {} // No assign operator. void draw_icons(); void draw_text(); public: MiscDrawList( bool i_draw_clipped_text ); ~MiscDrawList(); int count() const { return num_recs; } void empty(); void append( NXRect frame_rect, id cell, BOOL is_highlighted, NXColor default_text_color, Font* default_font ); void draw(); }; #endif // __MiscDrawList_h MiscKit/Palettes/MiscTableScroll/MiscLineWrapper.cc100444 1750 1750 35572 6757716165 22650 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscLineWrapper.h // // A C++ object for calculating line breaks in text. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscLineWrapper.cc,v 1.3 97/06/10 05:40:27 sunshine Exp $ // $Log: MiscLineWrapper.cc,v $ // Revision 1.3 97/06/10 05:40:27 sunshine // v127: Removed unused header. // // Revision 1.2 96/09/13 12:36:14 zarnuk // Line height is now based purely on point size. No longer uses the // broken NeXT bounding box. // // Revision 1.1 96/08/30 14:56:38 sunshine // A C++ object for calculating line breaks in text. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscLineWrapper.h" extern "Objective-C" { #import // NXIsGraph() #import // NX_LEFTALIGNED... #import } extern "C" { #include #include #include #include } float const MiscLineWrapper::DEFAULT_LEFT_MARGIN = 2.0; float const MiscLineWrapper::DEFAULT_TOP_MARGIN = 0.0; float const MiscLineWrapper::DEFAULT_RIGHT_MARGIN = 2.0; float const MiscLineWrapper::DEFAULT_BOTTOM_MARGIN = 0.0; //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscLineWrapper::~MiscLineWrapper() { free( text ); free( lines ); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscLineWrapper::MiscLineWrapper() { text_len = 0; text_max = 1024; text = (char*) malloc( text_max ); font = 0; metrics = 0; alignment = NX_LEFTALIGNED; num_lines = 0; max_lines = 16; lines = (Line*) malloc( max_lines * sizeof(*lines) ); rect.origin.x = 0; rect.origin.y = 0; rect.size.width = 0; rect.size.height = 0; left_margin = DEFAULT_LEFT_MARGIN; top_margin = DEFAULT_TOP_MARGIN; right_margin = DEFAULT_RIGHT_MARGIN; bottom_margin = DEFAULT_BOTTOM_MARGIN; ascender = 0; descender = 0; line_height = 0; char_wrap = false; no_partial = false; needs_wrap = false; } //----------------------------------------------------------------------------- // setCharWrap //----------------------------------------------------------------------------- void MiscLineWrapper::setCharWrap( bool b ) { if (char_wrap != b) { char_wrap = b; needs_wrap = true; } } //----------------------------------------------------------------------------- // setRect //----------------------------------------------------------------------------- void MiscLineWrapper::setRect( NXRect r ) { r.origin.x = floor( r.origin.x + left_margin ); r.origin.y = floor( r.origin.y + top_margin ); r.size.width = floor( r.size.width - (left_margin + right_margin) ); r.size.height = floor( r.size.height - (top_margin + bottom_margin) ); if (r.size.width != rect.size.width) needs_wrap = true; rect = r; } //----------------------------------------------------------------------------- // setLeftMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setLeftMargin( float f ) { if (left_margin != f) { rect.origin.x = floor( rect.origin.x - left_margin + f ); left_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setTopMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setTopMargin( float f ) { if (top_margin != f) { rect.origin.y = floor( rect.origin.y - top_margin + f ); top_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setRightMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setRightMargin( float f ) { if (right_margin != f) { rect.size.width = floor( rect.size.width - right_margin + f ); right_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setBottomMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setBottomMargin( float f ) { if (bottom_margin != f) { rect.size.height = floor( rect.size.height - bottom_margin + f ); bottom_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setText //----------------------------------------------------------------------------- void MiscLineWrapper::setText( char const* t ) { if (t == 0 || *t == 0) { if (text_len != 0) needs_wrap = true; text_len = 0; } else { int len = strlen( t ); if (len >= MAX_TEXT_LENGTH) len = MAX_TEXT_LENGTH - 1; if (len != text_len || strncmp( t, text, len ) != 0) { len++; // Include space for null byte. if (text_max < len) { while (text_max < len) text_max += text_max; text = (char*) realloc( text, text_max ); } len--; // Don't include null byte in length. memcpy( text, t, len ); text[ len ] = '\0'; text_len = len; needs_wrap = true; } } } //----------------------------------------------------------------------------- // setFont //----------------------------------------------------------------------------- void MiscLineWrapper::setFont( Font* f ) { if (font != f) { font = f; float const LINE_SPACING = 1.20; needs_wrap = true; metrics = [f metrics]; ascender = metrics->ascender; descender = - metrics->descender; float const size = [font pointSize]; if (!metrics->isScreenFont) { ascender *= size; descender *= size; } ascender = ceil( ascender ); descender = ceil( descender ); line_height = ceil( size * LINE_SPACING ); } } //----------------------------------------------------------------------------- // setAlignment //----------------------------------------------------------------------------- void MiscLineWrapper::setAlignment( int a ) { if (a != NX_CENTERED && a != NX_RIGHTALIGNED) a = NX_LEFTALIGNED; if (alignment != a) { alignment = a; needs_wrap = true; } } //----------------------------------------------------------------------------- // calc_width //----------------------------------------------------------------------------- float MiscLineWrapper::calc_width( int i, int lim ) const { float w = 0; if (metrics->isFixedPitch) { int const TAB_STOPS = 8; int n = 0; for (int j = i; j < lim; j++) if (text[j] == '\t' && alignment == NX_LEFTALIGNED) n += TAB_STOPS - (n & (TAB_STOPS - 1)); else n++; w = n * [font getWidthOf:"W"]; } else { float const space_width = [font getWidthOf:" "]; float const TAB_SIZE = 8 * space_width; float sz = [font pointSize]; for ( ; i < lim; i++) { unsigned char c = (unsigned char) text[i]; if (c == '\t') if (alignment == NX_LEFTALIGNED) w = (floor(w / TAB_SIZE) + 1.0) * TAB_SIZE; else w += space_width; else { int j = c; if (metrics->encoding != 0) j = metrics->encoding[ c ]; float cw = 0; if (metrics->widths != 0) cw = metrics->widths[j]; else if (metrics->charMetrics != 0) cw = metrics->charMetrics[j].xWidth; else cw = space_width; if (!metrics->isScreenFont) cw *= sz; w += cw; } } } return w; } //----------------------------------------------------------------------------- // wrap_segment // Wrap a line segment from the text. Line segments are determined by // explicit newlines in the text. // // NOTE *1* // This case arises when a single character is wider than the width of // the rectangle. Force the character onto the line even though it // exceeds the rectangle width. Otherwise, the character will never // be consumed, and we will go into an infinite loop. //----------------------------------------------------------------------------- void MiscLineWrapper::wrap_segment( int seg_start, int seg_end ) { bool do_char_wrap = char_wrap && alignment == NX_LEFTALIGNED; float max_width = rect.size.width; do { if (num_lines >= max_lines) { max_lines += max_lines; lines = (Line*) realloc( lines, max_lines * sizeof(*lines) ); } Line& line = lines[ num_lines++ ]; line.width = 0; line.start = seg_start; int white_start = seg_start; int black_start = seg_start; int black_end = seg_start; while (black_start < seg_end) { while (black_start < seg_end && !NXIsGraph( text[ black_start ] )) black_start++; if (black_start < seg_end) { black_end = black_start; while (black_end < seg_end && NXIsGraph( text[ black_end ] )) black_end++; float black_width = calc_width( seg_start, black_end ); if (black_width <= max_width) // Word fits on line. { line.width = black_width; white_start = black_end; black_start = black_end; } else // Word does not fit. { // Line is empty. Split word. if (do_char_wrap || white_start == seg_start) { while (black_end > black_start && black_width > max_width) black_width = calc_width(seg_start,--black_end); if (black_end == seg_start) { black_end++; // NOTE *1* black_width = calc_width( seg_start, black_end ); } if (black_end > black_start) line.width = black_width; // else there are preceeding whitespace characters on // the line. The width remains zero, and we move the // whole word to the next line. white_start = black_end; black_start = black_end; } // else line is not empty, move word to next line. break; // *** BREAK *** finish line } } } line.len = white_start - seg_start; // Trailing spaces not included seg_start = black_start; } while (seg_start < seg_end); } //----------------------------------------------------------------------------- // do_wrap //----------------------------------------------------------------------------- void MiscLineWrapper::do_wrap() { int line_start = 0; int line_end; num_lines = 0; while (line_start < text_len) { line_end = line_start; while (line_end < text_len) if (text[line_end++] == '\n') break; wrap_segment( line_start, line_end ); line_start = line_end; } } //----------------------------------------------------------------------------- // wrap //----------------------------------------------------------------------------- void MiscLineWrapper::wrap() { if (needs_wrap) { needs_wrap = false; do_wrap(); } } //----------------------------------------------------------------------------- // dump //----------------------------------------------------------------------------- void MiscLineWrapper::dump() const { for (int i = 0; i < num_lines; i++) { Line& line = lines[i]; fprintf( stderr, "%2d: w=%g (%.*s)\n", i, line.width, line.len, text + line.start ); } } //----------------------------------------------------------------------------- // width_check //----------------------------------------------------------------------------- bool MiscLineWrapper::width_check() const { for (int i = 0; i < num_lines; i++) if (lines[i].width > rect.size.width) return true; return false; } //----------------------------------------------------------------------------- // has_tabs //----------------------------------------------------------------------------- bool MiscLineWrapper::has_tabs( Line const& line ) const { int i = line.start; int const lim = i + line.len; for ( ; i < lim; i++) if (text[i] == '\t') return true; return false; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscLineWrapper::draw( float x, float y, int start, int len ) { int const lim = start + len; char const save_ch = text[ lim ]; text[ lim ] = '\0'; PSmoveto( x, y ); PSshow( text + start ); text[ lim ] = save_ch; } //----------------------------------------------------------------------------- // draw_tabs // Need to draw tab-separated segments. //----------------------------------------------------------------------------- void MiscLineWrapper::draw_tabs( float x0, float y, Line const& line ) { int const i0 = line.start; int const lim = i0 + line.len; int i = i0; while (i < lim) { while (i < lim && text[i] == '\t') i++; int j = i; while (i < lim && text[i] != '\t') i++; int const n = i - j; if (n > 0) { float x = x0; if (j > i0) x += calc_width( i0, j ); draw( x, y, j, n ); } } } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscLineWrapper::draw() { wrap(); float const wmax = rect.size.width; float const x0 = rect.origin.x; float const xmax = x0 + wmax; float x = x0; float const y0 = rect.origin.y; float const ymax = y0 + rect.size.height; float y = y0 + line_height - descender; bool did_clip = false; if (width_check()) { did_clip = true; PSgsave(); NXRectClip( &rect ); } for (int i = 0; i < num_lines; i++, y += line_height) { bool is_partial = y + descender >= ymax; if (is_partial && (no_partial || y - ascender >= ymax)) break; Line const& line = lines[i]; if (line.len > 0) { if (is_partial && !did_clip) { did_clip = true; PSgsave(); NXRectClip( &rect ); } x = x0; if (line.width < wmax) if (alignment == NX_CENTERED) x = floor( x0 + (wmax - line.width) / 2 ); else if (alignment == NX_RIGHTALIGNED) x = floor( xmax - line.width ); if (alignment == NX_LEFTALIGNED && has_tabs( line )) draw_tabs( x, y, line ); else draw( x, y, line.start, line.len ); } } if (did_clip) PSgrestore(); } MiscKit/Palettes/MiscTableScroll/MiscExporter.M100444 1750 1750 17056 6757716147 22034 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporter.M // // Object that exports the contents of an MiscTableScroll in // various useful formats. // // TODO: // * Genericize for use with Matrix, DBTableView. // * Add more export formats: rtf0, Lotus 1-2-3, Quattro, Excel, etc. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporter.M,v 1.3 96/09/25 17:34:12 zarnuk Exp $ // $Log: MiscExporter.M,v $ // Revision 1.3 96/09/25 17:34:12 zarnuk // syntax errors. // // Revision 1.2 96/09/25 17:09:16 zarnuk // Added commonInstance. exportTableScroll:(toFilename:) methods now return // an integer success/fail code. // // Revision 1.1 96/09/25 11:54:21 zarnuk // Exports the contents of table scroll in various formats. // //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import "MiscExporterAccessoryView.h" #import extern "Objective-C" { #import } extern "C" { #import #import #import // malloc(), free() #import // memcpy(), strlen() } //============================================================================= // MiscExporter //============================================================================= @implementation MiscExporter - (MiscExportFormat) getExportFormat { return exportFormat; } - (MiscExportTitleMode) getRowExportTitleMode { return rowTitleMode; } - (MiscExportTitleMode) getColExportTitleMode { return colTitleMode; } - (MiscExportGridMode) getRowExportGridMode { return rowGrid; } - (MiscExportGridMode) getColExportGridMode { return colGrid; } - (void) setExportFormat:(MiscExportFormat)x { exportFormat = x; } - (void) setRowExportTitleMode:(MiscExportTitleMode)x { rowTitleMode = x; } - (void) setColExportTitleMode:(MiscExportTitleMode)x { colTitleMode = x; } - (void) setRowExportGridMode:(MiscExportGridMode)x { rowGrid = x; } - (void) setColExportGridMode:(MiscExportGridMode)x { colGrid = x; } //----------------------------------------------------------------------------- // rowTitleCharWidth: //----------------------------------------------------------------------------- - (int) rowTitleCharWidth:(int) nrows { int max_width = 0; if (rowTitleMode != MISC_EXPORT_TITLES_OFF) for (int r = 0; r < nrows; r++) { int const len = safe_strlen( row_title( r, tableScroll ) ); if (max_width < len) max_width = len; } return max_width; } //----------------------------------------------------------------------------- // makeColMap: //----------------------------------------------------------------------------- - (int*) makeColMap:(int)ncols { int* col_map = (int*) malloc( ncols * sizeof(*col_map) ); for (int c = 0; c < ncols; c++) col_map[c] = col_at( c, tableScroll ); return col_map; } //----------------------------------------------------------------------------- // exportToFile: //----------------------------------------------------------------------------- - (void) exportToFile:(FILE*)fp { switch (exportFormat) { default: case MISC_EXPORT_ASCII_FIXED: [self exportFixed:fp]; break; case MISC_EXPORT_ASCII_TAB: [self exportTab:fp]; break; case MISC_EXPORT_ASCII_DELIMITED:[self exportDelimited:fp];break; case MISC_EXPORT_DBF: [self exportDBF:fp]; break; } } //----------------------------------------------------------------------------- // exportToFilename: //----------------------------------------------------------------------------- - (int) exportToFilename:(char const*)nm { int rc = 0; FILE* fp = fopen( nm, "wb" ); if (fp == 0) rc = errno; else { [self exportToFile:fp]; rc = fclose( fp ); } return rc; } //----------------------------------------------------------------------------- // createAccessorView //----------------------------------------------------------------------------- - (MiscExporterAccessoryView*) createAccessoryView { return (MiscExporterAccessoryView*) [[MiscExporterAccessoryView alloc] initFrame:0 format:exportFormat rowTitle:rowTitleMode colTitle:colTitleMode rowGrid:rowGrid colGrid:colGrid]; } //----------------------------------------------------------------------------- // getValuesFromAccessoryView: //----------------------------------------------------------------------------- - (void) getValuesFromAccessoryView:(MiscExporterAccessoryView*)view { [self setExportFormat:[view format]]; [self setRowExportTitleMode:[view rowTitleMode]]; [self setColExportTitleMode:[view colTitleMode]]; [self setRowExportGridMode:[view rowGrid]]; [self setColExportGridMode:[view colGrid]]; } //----------------------------------------------------------------------------- // exportTableScroll: //----------------------------------------------------------------------------- - (int) exportTableScroll:(MiscTableScroll*)ts { int rc = -1; if (ts != 0 && [ts numCols] > 0) { tableScroll = ts; SavePanel* panel = [SavePanel new]; id old_delg = [panel delegate]; View* old_view = [panel accessoryView]; MiscExporterAccessoryView* view = [self createAccessoryView]; [panel setDelegate:self]; [panel setAccessoryView:view]; [panel makeKeyAndOrderFront:0]; if ([panel runModal] == NX_OKTAG) { [self getValuesFromAccessoryView:view]; if ((rc = [self exportToFilename:[panel filename]]) != 0) NXRunAlertPanel( "Error", "Cannot open %s.\n%s", "OK",0,0, [panel filename], strerror(rc) ); } [panel close]; [panel setAccessoryView:old_view]; [panel setDelegate:old_delg]; [view free]; } return rc; } //----------------------------------------------------------------------------- // exportTableScroll:toFilename: //----------------------------------------------------------------------------- - (int) exportTableScroll:(MiscTableScroll*)ts toFilename:(char const*) nm { int rc = -1; if (nm != 0 && ts != 0 && [ts numCols] > 0) { tableScroll = ts; rc = [self exportToFilename:nm]; } return rc; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - init { [super init]; rowTitleMode = MISC_EXPORT_TITLES_ROW_DEFAULT; colTitleMode = MISC_EXPORT_TITLES_COL_DEFAULT; rowGrid = MISC_EXPORT_GRID_ROW_DEFAULT; colGrid = MISC_EXPORT_GRID_COL_DEFAULT; return self; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (MiscExporter*) commonInstance { static MiscExporter* obj = 0; if (obj == 0) obj = [[self alloc] init]; return obj; } @end MiscKit/Palettes/MiscTableScroll/MiscRectList.cc100444 1750 1750 5322 6757716166 22120 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectList.h // // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectList.cc,v 1.1 96/08/30 14:57:26 sunshine Exp $ // $Log: MiscRectList.cc,v $ // Revision 1.1 96/08/30 14:57:26 sunshine // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server // //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscRectList.h" extern "C" { #include // malloc(), realloc(), free() } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscRectList::MiscRectList() { num_rects = 0; max_rects = 16; rects = (NXRect*) malloc( max_rects * sizeof(*rects) ); } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscRectList::~MiscRectList() { free( rects ); } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscRectList::append( NXRect r ) { if (num_rects >= max_rects) { max_rects += max_rects; rects = (NXRect*) realloc( rects, max_rects * sizeof(*rects) ); } rects[ num_rects++ ] = r; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscRectList::draw( NXColor c ) { if (num_rects > 0) { NXSetColor( c ); NXRectFillList( rects, num_rects ); empty(); } } MiscKit/Palettes/MiscTableScroll/MiscExporterASCII.M100444 1750 1750 37427 6757716150 22603 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterASCII.M // // Routines that export the contents of an MiscTableScroll to // various ASCII text formats. // // BUGS: // * This is not performing the NXToAscii() translation, so this // is not pure 7-bit ASCII. // TODO: // * Genericize for use with Matrix, DBTableView. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterASCII.M,v 1.1 96/09/25 11:55:37 zarnuk Exp $ // $Log: MiscExporterASCII.M,v $ // Revision 1.1 96/09/25 11:55:37 zarnuk // Exports the contents of table scroll in ASCII text formats. // //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import #import "bool.h" extern "Objective-C" { #import #import } extern "C" { #import #import // malloc(), free() #import // memcpy(), strlen() } //============================================================================= // UTILITY ROUTINES //============================================================================= //----------------------------------------------------------------------------- // colgrid //----------------------------------------------------------------------------- inline static void colgrid( MiscExportGridMode grid, FILE* fp, char ch = '|' ) { if (grid == MISC_EXPORT_GRID_LINE) fputc( ch, fp ); else if (grid == MISC_EXPORT_GRID_SPACE) fputc( ' ', fp ); } //----------------------------------------------------------------------------- // endline //----------------------------------------------------------------------------- inline static void endline( MiscExportGridMode grid, FILE* fp, char ch = '|' ) { colgrid( grid, fp, ch ); fputc( '\n', fp ); } //----------------------------------------------------------------------------- // rowTitleHeader //----------------------------------------------------------------------------- inline static void rowTitleHeader( int len, MiscExportGridMode grid, FILE* fp ) { if (len > 0) { colgrid( grid, fp ); pad( len, fp ); } } //----------------------------------------------------------------------------- // rowgrid //----------------------------------------------------------------------------- static void rowgrid( MiscExportGridMode row_grid, MiscExportGridMode col_grid, int row_title_width, int ncols, int const* widths, FILE* fp ) { if (row_grid != MISC_EXPORT_GRID_OFF) { char row_grid_ch = ' '; char col_grid_ch = ' '; if (row_grid == MISC_EXPORT_GRID_LINE) { row_grid_ch = '-'; if (col_grid == MISC_EXPORT_GRID_LINE) col_grid_ch = '+'; } else if (col_grid == MISC_EXPORT_GRID_LINE) col_grid_ch = '|'; if (row_title_width > 0) { colgrid( col_grid, fp, col_grid_ch ); repchar( row_title_width, row_grid_ch, fp ); } int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( col_grid, fp, col_grid_ch ); repchar( *w, row_grid_ch, fp ); } endline( col_grid, fp, col_grid_ch ); } } //----------------------------------------------------------------------------- // cell_alignment //----------------------------------------------------------------------------- static int cell_alignment( id cell ) { int rc = NX_LEFTALIGNED; if (cell != 0 && [cell respondsTo:@selector(alignment)]) rc = [cell alignment]; return rc; } //----------------------------------------------------------------------------- // cell_str //----------------------------------------------------------------------------- static char const* cell_str( id cell ) { char const* s = 0; if (cell != 0 && [cell respondsTo:@selector(stringValue)]) s = [cell stringValue]; return s; } //============================================================================= // CHAR FILTER //============================================================================= //----------------------------------------------------------------------------- // MiscCharFilter // Base class for the output character filters. // Base class is unfiltered. //----------------------------------------------------------------------------- class MiscCharFilter { protected: FILE* fp; char const* s; int len; int pos; public: MiscCharFilter( FILE* f ): fp(f), s(0), len(0), pos(0) {} virtual ~MiscCharFilter(); virtual char nextChar(); void reset( char const* t, int n ) { s = t; len = n; pos = 0; } void reset( char const* t ) { s = t; len = safe_strlen(s); pos = 0; } void reset() { pos = 0; } int length() const { return len; } bool done() const { return pos >= len; } bool more() const { return pos < len; } virtual void write(); void write( int field_width ); void left( int field_width ); void center( int field_width ); void right( int field_width ); static void pad( int n, FILE* f, char ch=' ' ); void pad( int n, char ch=' ' ) { pad( n, fp, ch ); } }; MiscCharFilter::~MiscCharFilter() {} char MiscCharFilter::nextChar() { char c = '\0'; if (pos < len) c = s[pos++]; return c; } void MiscCharFilter::pad( int n, FILE* fp, char ch ) { while (n-- > 0) fputc( ch, fp ); } void MiscCharFilter::write() { while (more()) fputc( nextChar(), fp ); } void MiscCharFilter::write( int w ) { while (w-- > 0) fputc( nextChar(), fp ); } void MiscCharFilter::left( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { write(); pad( delta ); } } void MiscCharFilter::center( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { int const left_pad = (delta >> 1); int const right_pad = delta - left_pad; pad( left_pad ); write(); pad( right_pad ); } } void MiscCharFilter::right( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { pad( delta ); write(); } } //----------------------------------------------------------------------------- // MiscTabFilter // Output character filter for the ASCII fixed and tab-separated formats // Converts tabs, carriage-returns and newlines into space characters. //----------------------------------------------------------------------------- class MiscTabFilter : public MiscCharFilter { public: MiscTabFilter( FILE* f ): MiscCharFilter(f) {} virtual char nextChar(); }; char MiscTabFilter::nextChar() { char c = '\0'; if (pos < len) { c = s[pos++]; if (c == '\t' || c == '\n' || c == '\r') c = ' '; } return c; } //----------------------------------------------------------------------------- // MiscDelimFilter // Output character filter for the ASCII delimited format. // Converts carriage-returns and newlines into space characters. // Converts double-quote characters into single quote characters. //----------------------------------------------------------------------------- class MiscDelimFilter : public MiscCharFilter { public: MiscDelimFilter( FILE* f ): MiscCharFilter(f) {} virtual char nextChar(); virtual void write(); }; char MiscDelimFilter::nextChar() { char c = '\0'; if (pos < len) { c = s[pos++]; if (c == '\n' || c == '\r') c = ' '; else if (c == '"') c = '\''; } return c; } void MiscDelimFilter::write() { if (s != 0) { fputc( '"', fp ); MiscCharFilter::write(); fputc( '"', fp ); } } //============================================================================= // MiscExporter(ASCII) //============================================================================= @implementation MiscExporter(ASCII) //----------------------------------------------------------------------------- // fixedWidths::: //----------------------------------------------------------------------------- - (int*) fixedWidths:(int)nrows :(int)ncols :(int const*)map { int* const widths = (int*) calloc( ncols, sizeof(*widths) ); for (int r = 0; r < nrows; r++) { int* w = widths; for (int c = 0; c < ncols; c++,w++) { int const len = safe_strlen(str_at(r,map[c],tableScroll)); if (*w < len) *w = len; } } return widths; } //----------------------------------------------------------------------------- // fixedHeadersOn::::: //----------------------------------------------------------------------------- - (void) fixedHeadersOn:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { int c; int* wp = widths; for (c = 0; c < ncols; c++,wp++) { int const len = safe_strlen( col_title( map[c], tableScroll) ); if (*wp < len) *wp = len; } rowgrid( rowGrid, colGrid, row_title_width, ncols, widths, fp ); rowTitleHeader( row_title_width, colGrid, fp ); MiscTabFilter filt( fp ); int const* w = widths; for (c = 0; c < ncols; c++,w++) { colgrid( colGrid, fp ); filt.reset( col_title( map[c], tableScroll ) ); filt.center( *w ); } endline( colGrid, fp ); } //----------------------------------------------------------------------------- // fixedHeadersWrap::::: //----------------------------------------------------------------------------- - (void) fixedHeadersWrap:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { int c; int max_lines = 1; int* wp = widths; for (c = 0; c < ncols; c++,wp++) { int const len = safe_strlen( col_title( map[c], tableScroll) ); if (len > *wp) { if (*wp == 0) *wp = 1; int const num_lines = (len + (*wp - 1)) / *wp; if (max_lines < num_lines) max_lines = num_lines; } } rowgrid( rowGrid, colGrid, row_title_width, ncols, widths, fp ); MiscTabFilter filt( fp ); for (int i = 0; i < max_lines; i++) { rowTitleHeader( row_title_width, colGrid, fp ); int const* w = widths; for (c = 0; c < ncols; c++,w++) { colgrid( colGrid, fp ); char const* const s = col_title( map[c], tableScroll ); int const len = safe_strlen( s ); bool skip = true; if (len > 0) { int const num_lines = (len + (*w - 1)) / *w; int const first_line = max_lines - num_lines; if (i >= first_line) { skip = false; if (len < *w) { filt.reset( s, len ); filt.center( *w ); } else { int const start_pos = (i - first_line) * *w; filt.reset( s + start_pos, len - start_pos ); filt.left( *w ); } } } if (skip) filt.pad( *w ); } endline( colGrid, fp ); } } //----------------------------------------------------------------------------- // fixedHeadersTrunc::::: //----------------------------------------------------------------------------- - (void) fixedHeadersTrunc:(int)row_title_width :(int)ncols :(int const*)map :(int const*)widths :(FILE*)fp { rowgrid( rowGrid, colGrid, row_title_width, ncols, widths, fp ); rowTitleHeader( row_title_width, colGrid, fp ); MiscTabFilter filt(fp); int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( colGrid, fp ); filt.reset( col_title( map[c], tableScroll ) ); filt.center( *w ); } endline( colGrid, fp ); } //----------------------------------------------------------------------------- // fixedHeaders::::: //----------------------------------------------------------------------------- - (void) fixedHeaders:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { switch (colTitleMode) { default: case MISC_EXPORT_TITLES_ON: [self fixedHeadersOn:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_WRAP: [self fixedHeadersWrap:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_TRUNCATE: [self fixedHeadersTrunc:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_OFF: break; } if (colTitleMode != MISC_EXPORT_TITLES_OFF) rowgrid( MISC_EXPORT_GRID_LINE, colGrid, row_title_width, ncols, widths, fp ); } //----------------------------------------------------------------------------- // exportFixed: [public] //----------------------------------------------------------------------------- - (void) exportFixed:(FILE*)fp { int const nrows = [tableScroll numRows]; int const ncols = [tableScroll numCols]; int* col_map = [self makeColMap:ncols]; int* widths = [self fixedWidths:nrows:ncols:col_map]; int const row_title_width = [self rowTitleCharWidth:nrows]; [self fixedHeaders:row_title_width:ncols:col_map:widths:fp]; MiscTabFilter filt(fp); for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); if (row_title_width > 0) { colgrid( colGrid, fp ); filt.reset( row_title( pr, tableScroll ) ); filt.center( row_title_width ); } int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( colGrid, fp ); id cell = cell_at( pr, col_map[c], tableScroll ); filt.reset( cell_str( cell ) ); switch (cell_alignment( cell )) { default: case NX_LEFTALIGNED: filt.left( *w ); break; case NX_RIGHTALIGNED: filt.right( *w ); break; case NX_CENTERED: filt.center( *w ); break; } } endline( colGrid, fp ); rowgrid( rowGrid, colGrid, row_title_width, ncols, widths, fp ); } free( widths ); free( col_map ); } //----------------------------------------------------------------------------- // exportDelimited: //----------------------------------------------------------------------------- - (void) exportDelimited:(FILE*)fp :(MiscCharFilter*)filt :(char) separator { int const nrows = [tableScroll numRows]; int const ncols = [tableScroll numCols]; BOOL const row_titles = (rowTitleMode != MISC_EXPORT_TITLES_OFF); int* col_map = [self makeColMap:ncols]; if (colTitleMode != MISC_EXPORT_TITLES_OFF) { if (row_titles) { filt->reset( "Row Titles" ); filt->write(); fputc( separator, fp ); } for (int c = 0; c < ncols; c++) { if (c > 0) fputc( separator, fp ); filt->reset( col_title( col_map[c], tableScroll ) ); filt->write(); } fputc( '\n', fp ); } for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); if (row_titles) { filt->reset( row_title( pr, tableScroll ) ); filt->write(); fputc( separator, fp ); } for (int c = 0; c < ncols; c++) { if (c > 0) fputc( separator, fp ); filt->reset( str_at( pr, col_map[c], tableScroll ) ); filt->write(); } fputc( '\n', fp ); } free( col_map ); } //----------------------------------------------------------------------------- // exportTab: [public] //----------------------------------------------------------------------------- - (void) exportTab:(FILE*)fp { MiscTabFilter filt( fp ); [self exportDelimited:fp:&filt:'\t']; } //----------------------------------------------------------------------------- // exportDelimited: [public] //----------------------------------------------------------------------------- - (void) exportDelimited:(FILE*)fp { MiscDelimFilter filt( fp ); [self exportDelimited:fp:&filt:',']; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScroll.subproj120777 1750 1750 0 6757716177 25203 2misckitustar sunshinesunshineMiscKit/Palettes/MiscTableScroll/MiscExporterAccessoryView.h100444 1750 1750 4166 6757716150 24546 0ustar sunshinesunshine#ifndef __MiscExporterAccessoryView_h #define __MiscExporterAccessoryView_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterAccessoryView.h // // SavePanel accessory view for use by the MiscExporter class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterAccessoryView.h,v 1.1 96/09/25 11:55:59 zarnuk Exp $ // $Log: MiscExporterAccessoryView.h,v $ // Revision 1.1 96/09/25 11:55:59 zarnuk // SavePanel accessory view for use by the MiscExporter. // //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import @class Box, Button; @interface MiscExporterAccessoryView : View { Button* formatPop; Button* rowTitlePop; Button* colTitlePop; Button* rowGridPop; Button* colGridPop; Box* formatBox; Box* rowTitleBox; Box* colTitleBox; Box* rowGridBox; Box* colGridBox; } - initFrame:(NXRect const*)rect format:(MiscExportFormat)format rowTitle:(MiscExportTitleMode)rowTitle colTitle:(MiscExportTitleMode)colTitle rowGrid:(MiscExportGridMode)rowGrid colGrid:(MiscExportGridMode)colGrid; - (MiscExportFormat) format; - (MiscExportTitleMode) rowTitleMode; - (MiscExportTitleMode) colTitleMode; - (MiscExportGridMode) rowGrid; - (MiscExportGridMode) colGrid; @end #endif // __MiscExporterAccessoryView_h MiscKit/Palettes/MiscTableScroll/MiscExporterDBF.M100444 1750 1750 51725 6757716150 22343 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterDBF.M // // Routines to export MiscTableScrolls in dBASE III (.DBF) format. // // TODO: // Provide some public means to set the "AMERICAN_DATE" and the // locale-specific characters. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterDBF.M,v 1.3 99/06/29 07:36:17 sunshine Exp $ // $Log: MiscExporterDBF.M,v $ // Revision 1.3 99/06/29 07:36:17 sunshine // v140: Ported back to NextStep 3.2. Compiler complained about signed vs. // unsigned assignment. // // Revision 1.2 97/05/04 18:32:10 zarnuk // v126: Fixed compiler warning. // // Revision 1.1 96/09/25 11:55:17 zarnuk // Exports the contents of table scroll in dBASEIII .dbf format. //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import "bool.h" extern "Objective-C" { #import } extern "C" { #import #import // malloc(), free() #import // memcpy(), strlen() #import // time(), localtime(), strftime() } char const DECIMAL_CHAR = '.'; // American value. char const DATE_CHAR = '/'; // American value. char const TIME_CHAR = ':'; // American value. bool const AMERICAN_DATE = true; // mm/dd/yy vs. dd/mm/yy int const DBF_NUM_FLDS_MAX = 1022; // Max # fields. int const DBF_REC_LEN_MAX = 0x7fff; // Max record length. int const DBF_FLD_NAME_MAX = 10; int const DBF_CHAR_LEN_MAX = 254; int const DBF_DATE_WIDTH = 8; // "YYYYMMDD" int const DBF_TIME_WIDTH = 5; // "HH:MM" int const DBF_NUMERIC_LEN_MAX = 19; // Max length for "N" fields. static char const DBF_NULL_DATE_STR[] = " "; static char const DBF_NULL_TIME_STR[] = " "; struct DBFHeader { unsigned char version; unsigned char update_yr; unsigned char update_mon; unsigned char update_day; unsigned char num_recs[4]; // little-endian long int unsigned char hdr_len[2]; // little-endian short int unsigned char rec_len[2]; // little-endian short int char fill[20]; }; struct DBFFieldDef { char name[ DBF_FLD_NAME_MAX + 1 ]; char type; // Char, Numeric, Logical, Date, Memo. char fill[4]; unsigned char fld_len; unsigned char num_decimals; char fill2[14]; }; enum DBFDataType { DBF_TYPE_CHAR, // Non-structured type. DBF_TYPE_NUMERIC, // Numeric values only. DBF_TYPE_DATE, // Date values only. DBF_TYPE_DATETIME // Date-time values only. }; #define DBF_BIT_CHAR (1 << DBF_TYPE_CHAR) #define DBF_BIT_NUMERIC (1 << DBF_TYPE_NUMERIC) #define DBF_BIT_DATE (1 << DBF_TYPE_DATE) #define DBF_BIT_DATETIME (1 << DBF_TYPE_DATETIME) static char const DBF_TYPE_CODE[] = "CNDD"; struct DBFInfo { DBFDataType type; // Final data type. unsigned int mask; // All candidate types. int max_width; // Max width for this column. int max_left; // Left of decimal for numeric. int max_right; // Right of decimal for numeric. }; struct DBFDateTime { int year; int month; int day; int hour; int minute; int second; }; //----------------------------------------------------------------------------- // dbf_field_name // Make sure all field names conform to DBF field name rules. //----------------------------------------------------------------------------- static int dbf_field_name( char* buff, char const* s ) { int len = 0; if (s != 0) { bool in_gap = true; for (; len < DBF_FLD_NAME_MAX && *s != 0; s++) { char const* t = (char const*)NXToAscii( NXToUpper(*s) ); for (; len < DBF_FLD_NAME_MAX && *t != 0; t++) { char const c = *t; if ('A' <= c && c <= 'Z') { in_gap = false; buff[len++] = c; } else if ('0' <= c && c <= '9') { in_gap = false; if (len == 0) // Cannot start with digit. buff[len++] = 'F'; buff[len++] = c; } else if (!in_gap) { in_gap = true; buff[len++] = '_'; } } } if (in_gap && len > 0) // Remove trailing underline. len--; } if (len == 0) { char const DEFAULT_FIELD_NAME[] = "FIELD"; strcpy( buff, DEFAULT_FIELD_NAME ); len = sizeof( DEFAULT_FIELD_NAME ) - 1; } buff[ len ] = '\0'; return len; } //----------------------------------------------------------------------------- // adjust_name // Adjust this field name to try to avoid a collision with other // field names. Performs the adjustment by appending a counter to // the end of the name. If the counter does not fit in the space // following the field name, the field name's "core" length is // trimmed back to allow more space for the counter. Returns the // new "core" length for the field. //----------------------------------------------------------------------------- static int adjust_name( char* name, int core_len, int counter ) { char buff[ 16 ]; sprintf( buff, "%d", counter ); int buff_len = strlen( buff ); if (core_len + buff_len > DBF_FLD_NAME_MAX) core_len = DBF_FLD_NAME_MAX - buff_len; strcpy( name + core_len, buff ); return core_len; } //----------------------------------------------------------------------------- // collision // Does this field name collide with any preceeding field name? //----------------------------------------------------------------------------- static BOOL collision( DBFFieldDef const* flds, DBFFieldDef const* flds_lim ) { char const* const name = flds_lim->name; for ( ; flds < flds_lim; flds++) if (strcmp( flds->name, name ) == 0) return YES; return NO; } //----------------------------------------------------------------------------- // set_field_name //----------------------------------------------------------------------------- static void set_field_name( char const* s, DBFFieldDef* fld, DBFFieldDef* flds ) { int slen = dbf_field_name( fld->name, s ); int num_tries = 0; while (collision( flds, fld )) slen = adjust_name( fld->name, slen, ++num_tries ); } //----------------------------------------------------------------------------- // set_field //----------------------------------------------------------------------------- static void set_field( char const* s, DBFFieldDef* fld, DBFFieldDef* flds, DBFInfo const* ip ) { set_field_name( s, fld, flds ); fld->type = DBF_TYPE_CODE[ ip->type ]; fld->fld_len = (unsigned char) ip->max_width; if (ip->type == DBF_TYPE_NUMERIC) fld->num_decimals = ip->max_right; } //----------------------------------------------------------------------------- // set_time_field //----------------------------------------------------------------------------- static void set_time_field( char const* s, DBFFieldDef* fld, DBFFieldDef* flds, DBFInfo const* ip ) { set_field_name( s, fld, flds ); fld->type = DBF_TYPE_CODE[ DBF_TYPE_CHAR ]; fld->fld_len = DBF_TIME_WIDTH; } //----------------------------------------------------------------------------- // skip_whitespace //----------------------------------------------------------------------------- inline static char const* skip_whitespace( char const* s ) { if (s != 0) for (; *s != 0 && NXIsSpace(*s); s++) /*empty*/; return s; } //----------------------------------------------------------------------------- // dbf_is_numeric //----------------------------------------------------------------------------- static bool dbf_is_numeric( char const* s, DBFInfo* ip ) { bool neg = false; int left_len = 0; int right_len = 0; if (*s == '\0') // Empty string, treat as null. return true; if (*s == '-') { s++; neg = true; } else if (*s == '+') s++; s = skip_whitespace( s ); while ('0' <= *s && *s <= '9') { s++; left_len++; } if (*s == DECIMAL_CHAR) { s++; while ('0' <= *s && *s <= '9') { s++; right_len++; } } s = skip_whitespace( s ); if (*s == '\0' && (left_len > 0 || right_len > 0)) { if (left_len == 0) left_len++; if (neg) left_len++; if (ip->max_left < left_len) ip->max_left = left_len; if (ip->max_right < right_len) ip->max_right = right_len; return true; } return false; } //----------------------------------------------------------------------------- // dbf_parse_time //----------------------------------------------------------------------------- static DBFDataType dbf_parse_time( char const* s, DBFDateTime& dt ) { DBFDataType type = DBF_TYPE_CHAR; if ('0' <= *s && *s <= '9') { int hour = 0; do { hour = hour * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR) { s++; if ('0' <= *s && *s <= '9') { int minute = 0; int second = 0; do { minute = minute * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR) // seconds are optional. { s++; second = -1; if ('0' <= *s && *s <= '9') { second = 0; do { second = second * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR || *s == DECIMAL_CHAR) { s++; // fractions of seconds ignored. while ('0' <= *s && *s <= '9') s++; } } } s = skip_whitespace(s); if (*s == '\0' && 0 <= hour && hour <= 23 && 0 <= minute && minute <= 59 && 0 <= second && second <= 59) { dt.hour = hour; dt.minute = minute; dt.second = second; type = DBF_TYPE_DATETIME; } } } } return type; } //----------------------------------------------------------------------------- // dbf_parse_date //----------------------------------------------------------------------------- static DBFDataType dbf_parse_date( char const* s, DBFDateTime& dt ) { memset( &dt, 0, sizeof(dt) ); DBFDataType type = DBF_TYPE_CHAR; if (*s == '\0') type = DBF_TYPE_DATE; else if ('0' <= *s && *s <= '9') { int month = 0; do { month = month * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == DATE_CHAR) { s++; if ('0' <= *s && *s <= '9') { int day = 0; do { day = day * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == DATE_CHAR) { s++; if ('0' <= *s && *s <= '9') { int year = 0; do { year = year * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (!AMERICAN_DATE) { int tmp = month; month = day; day = tmp; } if (1 <= month && month <= 12 && 1 <= day && day <= 31 && ((0 <= year && year < 100) || (1700 < year && year < 3000))) { if (year < 100) { time_t t; time(&t); struct tm const* tm = localtime(&t); int tm_year = tm->tm_year + 1900; year += 1900; while ((tm_year - year) > 90) year += 100; } dt.year = year; dt.month = month; dt.day = day; s = skip_whitespace(s); if (*s == '\0') type = DBF_TYPE_DATE; else type = dbf_parse_time( s, dt ); } } } } } } return type; } //============================================================================= // MiscExporter //============================================================================= @implementation MiscExporter(DBF) //----------------------------------------------------------------------------- // dbfAnalyze::: //----------------------------------------------------------------------------- - (DBFInfo*) dbfAnalyze:(int)nrows :(int)ncols :(int const*)map { int c; DBFDateTime datetime; DBFInfo* const info = (DBFInfo*) calloc( ncols, sizeof(*info) ); for (c = 0; c < ncols; c++) info[c].mask = (DBF_BIT_NUMERIC | DBF_BIT_DATE | DBF_BIT_DATETIME); for (int r = 0; r < nrows; r++) { DBFInfo* ip = info; for (c = 0; c < ncols; c++,ip++) { char const* const s = str_at( r, map[c], tableScroll ); if (s != 0 && *s != 0) { int const len = strlen(s); if (ip->max_width < len) ip->max_width = len; unsigned int mask = ip->mask; if (mask & DBF_BIT_NUMERIC) { if (!dbf_is_numeric( s, ip )) mask &= ~DBF_BIT_NUMERIC; } if (mask & (DBF_BIT_DATE | DBF_BIT_DATETIME)) { switch (dbf_parse_date( s, datetime )) { default: case DBF_TYPE_CHAR: case DBF_TYPE_NUMERIC: mask &= ~(DBF_BIT_DATE | DBF_BIT_DATETIME); break; case DBF_TYPE_DATETIME: mask &= ~DBF_BIT_DATE; break; case DBF_TYPE_DATE: break; } } ip->mask = mask; } } } DBFInfo* ip = info; for (c = 0; c < ncols; c++,ip++) { DBFDataType type = DBF_TYPE_CHAR; unsigned int const mask = ip->mask; if (mask & DBF_BIT_DATE) { type = DBF_TYPE_DATE; ip->max_width = DBF_DATE_WIDTH; } else if (mask & DBF_BIT_DATETIME) { type = DBF_TYPE_DATETIME; ip->max_width = DBF_DATE_WIDTH; } else if (mask & DBF_BIT_NUMERIC) { type = DBF_TYPE_NUMERIC; int width = ip->max_left; if (ip->max_right > 0) width += ip->max_right + 1; if (width > DBF_NUMERIC_LEN_MAX) { type = DBF_TYPE_CHAR; if (width > DBF_CHAR_LEN_MAX) width = DBF_CHAR_LEN_MAX; } ip->max_width = width; } else if (ip->max_width > DBF_CHAR_LEN_MAX) ip->max_width = DBF_CHAR_LEN_MAX; ip->type = type; } return info; } //----------------------------------------------------------------------------- // dbfFields::::: // Set the names of the Field definitions. // Make sure all field names conform to DBF field name rules. // Make sure all field names are unique within the DBF length limits. //----------------------------------------------------------------------------- - (void) dbfFields:(int)row_title_width :(DBFFieldDef*)flds :(int)ncols :(int const*)map :(DBFInfo const*)info { DBFFieldDef* fld = flds; if (row_title_width > 0) { strcpy( fld->name, "ROW_TITLE" ); fld->type = DBF_TYPE_CODE[ DBF_TYPE_CHAR ]; fld->fld_len = (unsigned char) row_title_width; fld++; } DBFInfo const* ip = info; for (int c = 0; c < ncols; c++,fld++,ip++) { char const* const s = col_title( map[c], tableScroll ); set_field( s, fld, flds, ip ); if (ip->type == DBF_TYPE_DATETIME) set_time_field( s, ++fld, flds, ip ); } } //----------------------------------------------------------------------------- // dbfHeader:::: //----------------------------------------------------------------------------- - (int) dbfHeader:(int)row_title_width :(int)nrows :(int)ncols :(int const*)map :(DBFInfo const*)info :(FILE*)fp { BOOL const rowTitlesOn = (row_title_width > 0); int rec_len = 1; // All records have a one-byte flag. int nflds = 0; int ntime = 0; // Number of extra time fields. if (rowTitlesOn) { rec_len += row_title_width; nflds++; } DBFInfo const* ip = info; for (int i = 0; i < ncols; i++,ip++) { if (ip->type == DBF_TYPE_DATETIME) { if (nflds + 1 < DBF_NUM_FLDS_MAX && rec_len <= DBF_REC_LEN_MAX - DBF_DATE_WIDTH - DBF_TIME_WIDTH) { rec_len += DBF_DATE_WIDTH + DBF_TIME_WIDTH; nflds += 2; ntime++; } else break; // Either get both in, or neither. } else if (nflds < DBF_NUM_FLDS_MAX && rec_len + ip->max_width < DBF_REC_LEN_MAX) { rec_len += ip->max_width; nflds++; } } int const nbytes = sizeof(DBFHeader) + (nflds * sizeof(DBFFieldDef)) + 1; DBFHeader* hdr = (DBFHeader*) calloc( 1, nbytes ); DBFFieldDef* flds = (DBFFieldDef*)(hdr + 1); time_t t; time( &t ); struct tm const* tm = localtime( &t ); hdr->version = 0x03; hdr->update_yr = (unsigned char) ((tm->tm_year) & 0x0ff); hdr->update_mon = (unsigned char) ((tm->tm_mon + 1) & 0x0ff); hdr->update_day = (unsigned char) ((tm->tm_mday) & 0x0ff); int n = nrows; hdr->num_recs[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[1] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[2] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[3] = (unsigned char) (n & 0x0ff); n = nbytes; hdr->hdr_len[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->hdr_len[1] = (unsigned char) (n & 0x0ff); n = rec_len; hdr->rec_len[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->rec_len[1] = (unsigned char) (n & 0x0ff); ncols = (rowTitlesOn ? nflds - 1 : nflds) - ntime; [self dbfFields:row_title_width:flds:ncols:map:info]; flds[nflds].name[0] = '\r'; fwrite( hdr, nbytes, 1, fp ); free( hdr ); return ncols; } //----------------------------------------------------------------------------- // dbf_put_char //----------------------------------------------------------------------------- static void dbf_put_char( char const* s, int width, FILE* fp ) { if (s == 0) pad( width, fp ); else { int const len = strlen( s ); int const delta = width - len; if (delta > 0) { fwrite( s, len, 1, fp ); pad( delta, fp ); } else fwrite( s, width, 1, fp ); } } //----------------------------------------------------------------------------- // dbf_put_numeric //----------------------------------------------------------------------------- static void dbf_put_numeric( char const* s, DBFInfo const* ip, FILE* fp ) { if (s == 0) { if (ip->max_left > 1) pad( ip->max_left - 1, fp ); fputc( '0', fp ); if (ip->max_right > 0) { fputc( '.', fp ); repchar( ip->max_right, '0', fp ); } } else { bool neg = false; int right_len = 0; s = skip_whitespace(s); if (*s == '-') { s++; neg = true; } else if (*s == '+') s++; s = skip_whitespace(s); char const* const left_part = s; while ('0' <= *s && *s <= '9') s++; int const left_len = (s - left_part); char const* right_part = s; if (*s == DECIMAL_CHAR) { s++; right_part++; while ('0' <= *s && *s <= '9') s++; right_len = (s - right_part); } int left_pad = ip->max_width - left_len; if (left_len == 0) left_pad--; // Room for required '0'. if (ip->max_right > 0) // Room for decimal and fraction. left_pad -= ip->max_right + 1; if (neg) left_pad--; // Room for '-'. pad( left_pad, fp ); if (neg) fputc( '-', fp ); if (left_len <= 0) fputc( '0', fp ); else fwrite( left_part, 1, left_len, fp ); if (ip->max_right > 0) { fputc( '.', fp ); if (right_len > 0) fwrite( right_part, 1, right_len, fp ); if (right_len < ip->max_right) repchar( ip->max_right - right_len, '0', fp ); } } } //----------------------------------------------------------------------------- // dbf_put_date //----------------------------------------------------------------------------- static void dbf_put_date( char const* s, DBFInfo const* ip, FILE* fp ) { s = skip_whitespace(s); if (s == 0 || *s == 0) { fputs( DBF_NULL_DATE_STR, fp ); if (ip->type == DBF_TYPE_DATETIME) fputs( DBF_NULL_TIME_STR, fp ); } else { char buff[ 64 ]; DBFDateTime dt; dbf_parse_date( s, dt ); sprintf( buff, "%04d%02d%02d", dt.year, dt.month, dt.day ); fputs( buff, fp ); if (ip->type == DBF_TYPE_DATETIME) { sprintf( buff, "%02d:%02d", dt.hour, dt.minute ); fputs( buff, fp ); } } } //----------------------------------------------------------------------------- // exportDBF: //----------------------------------------------------------------------------- - (void) exportDBF:(FILE*)fp { int const nrows = [tableScroll numRows]; int const tcols = [tableScroll numCols]; int* col_map = [self makeColMap:tcols]; DBFInfo* info = [self dbfAnalyze:nrows:tcols:col_map]; int row_title_width = [self rowTitleCharWidth:nrows]; if (row_title_width > DBF_CHAR_LEN_MAX) row_title_width = DBF_CHAR_LEN_MAX; int const ncols = [self dbfHeader:row_title_width:nrows:tcols:col_map:info:fp]; for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); fputc( ' ', fp ); if (row_title_width > 0) dbf_put_char( row_title( pr, tableScroll ), row_title_width, fp ); DBFInfo const* ip = info; for (int c = 0; c < ncols; c++,ip++) { char const* const s = str_at( pr, col_map[c], tableScroll ); switch (ip->type) { case DBF_TYPE_CHAR: dbf_put_char( s, ip->max_width, fp ); break; case DBF_TYPE_NUMERIC: dbf_put_numeric( s, ip, fp ); break; case DBF_TYPE_DATE: case DBF_TYPE_DATETIME: dbf_put_date( s, ip, fp ); break; } } } fputc( '\x1a', fp ); // Terminating Control-Z. free( info ); free( col_map ); } @end MiscKit/Palettes/MiscTableScroll/MiscExporterPrivate.h100444 1750 1750 6301 6757716151 23364 0ustar sunshinesunshine#ifndef __MiscExporterPrivate_h #define __MiscExporterPrivate_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterPrivate.h // // Private, internal communication and utility routines for the // MiscExporter class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterPrivate.h,v 1.1 96/09/25 11:54:58 zarnuk Exp $ // $Log: MiscExporterPrivate.h,v $ // Revision 1.1 96/09/25 11:54:58 zarnuk // Internal communication methods for the MiscExporter class. // //----------------------------------------------------------------------------- #import #import extern "Objective-C" { #import } extern "C" { #import #import } @interface MiscExporter(Private) - (int*) makeColMap:(int)ncols; - (int) rowTitleCharWidth:(int) nrows; @end @interface MiscExporter(ASCII) - (void) exportFixed:(FILE*)fp; - (void) exportTab:(FILE*)fp; - (void) exportDelimited:(FILE*)fp; @end @interface MiscExporter(DBF) - (void) exportDBF:(FILE*)fp; @end //----------------------------------------------------------------------------- // safe_strlen //----------------------------------------------------------------------------- inline static int safe_strlen( char const* s ) { return (s != 0 ? (int) strlen(s) : 0); } //----------------------------------------------------------------------------- // repchar //----------------------------------------------------------------------------- inline static void repchar( int rep, char c, FILE* fp ) { for (int i = 0; i < rep; i++) fputc( c, fp ); } //----------------------------------------------------------------------------- // pad //----------------------------------------------------------------------------- inline static void pad( int len, FILE* fp ) { repchar( len, ' ', fp ); } inline static int row_at( int visual_pos, id obj ) { return [obj rowAtPosition:visual_pos]; } inline static int col_at( int visual_pos, id obj ) { return [obj colAtPosition:visual_pos]; } inline static id cell_at( int r, int c, id obj ) { return [obj cellAt:r:c]; } inline static char const* str_at( int r, int c, id obj ) { return [obj stringValueAt:r:c]; } inline static char const* col_title( int c, id obj ) { return [obj colTitle:c]; } inline static char const* row_title( int r, id obj ) { return [obj rowTitle:r]; } #endif // __MiscExporterPrivate_h MiscKit/Palettes/MiscTableScroll/MiscGeometry.h100444 1750 1750 17153 6757716151 22043 0ustar sunshinesunshine#ifndef __MiscGeometry_h #define __MiscGeometry_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscGeometry.h // // Geometric types (point, size, rectangle) which understand and can // adjust for orientation (horizontal or vertical). Orientation is // specified upon creation and can not be changed thereafter. // // Method names with the "_O" suffix take orientation into consideration, // whereas methods lacking this suffix do not. // // Methods dealing with NeXT geometric structures do not apply orientation // adjustments. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscGeometry.h,v 1.2 96/08/30 14:53:14 sunshine Exp $ // $Log: MiscGeometry.h,v $ // Revision 1.2 96/08/30 14:53:14 sunshine // Fixed some incorrect casts. Added missing return statements. // // Revision 1.1 96/05/05 10:53:51 sunshine // Geometric type structures which know their border orientation. //----------------------------------------------------------------------------- #include #include "bool.h" extern "C" { #import } class MiscOrientation { private: bool horizontal; public: bool isHorz() const { return horizontal; } bool isVert() const { return !isHorz(); } MiscBorderType border() const { return isHorz() ? MISC_COL_BORDER : MISC_ROW_BORDER; } MiscOrientation( bool is_horz ) : horizontal(is_horz) {} MiscOrientation( MiscBorderType b ) : horizontal( b == MISC_COL_BORDER ) {} }; class MiscPoint_O : public virtual MiscOrientation { private: MiscPixels x; MiscPixels y; public: MiscPixels getX() const { return x; } MiscPixels getY() const { return y; } MiscPixels getX_O() const { return isHorz() ? x : y; } MiscPixels getY_O() const { return isHorz() ? y : x; } void setX( MiscPixels n ) { x = n; } void setY( MiscPixels n ) { y = n; } void setX_O( MiscPixels n ) { (isHorz() ? x : y) = n; } void setY_O( MiscPixels n ) { (isHorz() ? y : x) = n; } MiscPoint_O& operator=( MiscPoint_O const& p ) { setX_O( p.getX_O() ); setY_O( p.getY_O() ); return *this; } bool operator==( MiscPoint_O const& p ) const { return isHorz() == p.isHorz() && getX_O() == p.getX_O() && getY_O() == p.getY_O(); } bool operator!=( MiscPoint_O const& p ) const { return !operator==(p); } NXPoint nxPoint() const { NXPoint p = { x, y }; return p; } operator NXPoint() const { return nxPoint(); } MiscPoint_O& operator=( NXPoint p ) { x = MiscPixels( p.x ); y = MiscPixels( p.y ); return *this; } MiscPoint_O( bool is_horz, MiscPixels _x = 0, MiscPixels _y = 0 ) : MiscOrientation(is_horz),x(_x),y(_y) {} MiscPoint_O( MiscBorderType b, MiscPixels _x = 0, MiscPixels _y = 0 ) : MiscOrientation(b),x(_x),y(_y) {} MiscPoint_O( MiscPoint_O const& p ) : MiscOrientation(p.isHorz()),x(p.getX_O()),y(p.getY_O()) {} MiscPoint_O( bool is_horz, NXPoint p ) : MiscOrientation(is_horz),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {} MiscPoint_O( MiscBorderType b, NXPoint p ) : MiscOrientation(b),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {} }; class MiscSize_O : public virtual MiscOrientation { private: MiscPixels width; MiscPixels height; public: MiscPixels getWidth() const { return width; } MiscPixels getHeight() const { return height; } MiscPixels getWidth_O() const { return isHorz() ? width : height; } MiscPixels getHeight_O() const { return isHorz() ? height : width; } void setWidth( MiscPixels w ) { width = w; } void setHeight( MiscPixels h ) { height = h; } void setWidth_O( MiscPixels w ) { (isHorz() ? width : height) = w; } void setHeight_O( MiscPixels h ) { (isHorz() ? height : width) = h; } MiscSize_O& operator=( MiscSize_O const& p ) { setWidth_O( p.getWidth_O() ); setHeight_O( p.getHeight_O() ); return *this; } bool operator==( MiscSize_O const& p ) const { return isHorz() == p.isHorz() && getWidth_O() == p.getWidth_O() && getHeight_O() == p.getHeight_O(); } bool operator!=( MiscSize_O const& p ) const { return !operator==(p); } NXSize nxSize() const { NXSize s = { width, height }; return s; } operator NXSize() const { return nxSize(); } MiscSize_O& operator=( NXSize s ) { width = MiscPixels( s.width ); height = MiscPixels( s.height ); return *this; } MiscSize_O( bool is_horz, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(is_horz),width(w),height(h) {} MiscSize_O( MiscBorderType b, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(b),width(w),height(h) {} MiscSize_O( MiscSize_O const& p ) : MiscOrientation(p.isHorz()), width(p.getWidth_O()),height(p.getHeight_O()) {} MiscSize_O( bool is_horz, NXSize p ) : MiscOrientation(is_horz), width(MiscPixels(p.width)),height(MiscPixels(p.height)) {} MiscSize_O( MiscBorderType b, NXSize p ) : MiscOrientation(b), width(MiscPixels(p.width)),height(MiscPixels(p.height)) {} }; class MiscRect_O : public MiscPoint_O, public MiscSize_O { public: MiscPixels getMaxX() const { return getX() + getWidth(); } MiscPixels getMaxY() const { return getY() + getHeight(); } MiscPixels getMaxX_O() const { return getX_O() + getWidth_O(); } MiscPixels getMaxY_O() const { return getY_O() + getHeight_O(); } MiscRect_O& operator=( MiscPoint_O const& p ) { MiscPoint_O::operator=( p ); return *this; } MiscRect_O& operator=( MiscSize_O const& p ) { MiscSize_O::operator=( p ); return *this; } MiscRect_O& operator=( MiscRect_O const& r ) { MiscPoint_O::operator=(r); MiscSize_O::operator=(r); return *this; } bool operator==( MiscRect_O const& r ) const { return MiscPoint_O::operator==(r) && MiscSize_O::operator==(r); } bool operator!=( MiscRect_O const& r ) const { return !operator==(r); } NXRect nxRect() const { NXRect r = { nxPoint(), nxSize() }; return r; } operator NXRect() const { return nxRect(); } MiscRect_O& operator=( NXPoint p ) { MiscPoint_O::operator=(p); return *this; } MiscRect_O& operator=( NXSize s ) { MiscSize_O::operator=(s); return *this; } MiscRect_O& operator=( NXRect r ) { MiscPoint_O::operator=( r.origin ); MiscSize_O::operator=( r.size ); return *this; } MiscRect_O( bool is_horz, MiscPixels x = 0, MiscPixels y = 0, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(is_horz), MiscPoint_O(is_horz,x,y),MiscSize_O(is_horz,w,h) {} MiscRect_O( MiscBorderType b, MiscPixels x = 0, MiscPixels y = 0, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(b),MiscPoint_O(b,x,y),MiscSize_O(b,w,h) {} MiscRect_O( MiscRect_O const& r ) : MiscOrientation(r.isHorz()),MiscPoint_O(r),MiscSize_O(r) {} MiscRect_O( bool is_horz, NXRect r ) : MiscOrientation(is_horz), MiscPoint_O(is_horz,r.origin),MiscSize_O(is_horz,r.size) {} MiscRect_O( MiscBorderType b, NXRect r ) : MiscOrientation(b), MiscPoint_O(b,r.origin),MiscSize_O(b,r.size) {} }; #endif // __MiscGeometry_h MiscKit/Palettes/MiscTableScroll/MiscHighlightTracker.M100444 1750 1750 6020 6757716151 23407 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscHighlightTracker.M // // Highlight-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscHighlightTracker.M,v 1.4 96/09/20 10:33:23 zarnuk Exp $ // $Log: MiscHighlightTracker.M,v $ // Revision 1.4 96/09/20 10:33:23 zarnuk // All access to the selection now goes through MiscTableBorder. // // Revision 1.3 96/08/30 14:54:22 sunshine // Selected-slot was removed from SparseSet and promoted to TableBorder. // // Revision 1.2 96/05/05 11:05:32 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscHighlightTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscHighlightTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos { extending = ((event->flags & NX_ALTERNATEMASK) != 0); if (extending) { [super mouseDown: event atPos: pos]; } else { border->toggle( pos ); lastPos = pos; } } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (extending) { [super mouseDragged: event atPos: pos]; } else { if (border->goodPos( lastPos )) border->toggle( lastPos ); if (border->goodPos( pos )) border->toggle( pos ); lastPos = pos; } } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (extending) [super mouseUp: event atPos: pos]; } @end MiscKit/Palettes/MiscTableScroll/MiscRectColorList.cc100444 1750 1750 7163 6757716166 23124 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectColorList.h // // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // // NOTE *1* // The rects[] array also provides storage space for the temporary // rectangle array needed by NXRectFillList(), so there is always // capacity to hold a copy of the entire rectangle list. Allocating // the two arrays together like this reduces the overhead costs, and // reduces memory fragmentation. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectColorList.cc,v 1.1 96/08/30 14:57:10 sunshine Exp $ // $Log: MiscRectColorList.cc,v $ // Revision 1.1 96/08/30 14:57:10 sunshine // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscRectColorList.h" extern "C" { #include #include // malloc(), realloc(), free() } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscRectColorList::MiscRectColorList() { num_rects = 0; max_rects = 16; // NOTE *1* rects = (NXRect*) malloc( max_rects * sizeof(*rects) * 2 ); colors = (int*) malloc( max_rects * sizeof(*colors) ); } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscRectColorList::~MiscRectColorList() { free( rects ); free( colors ); } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscRectColorList::append( NXRect r, NXColor c ) { if (num_rects >= max_rects) { max_rects += max_rects; // NOTE *1* rects = (NXRect*) realloc( rects, max_rects * sizeof(*rects) * 2 ); colors = (int*) realloc( colors, max_rects * sizeof(*colors) ); } rects[ num_rects ] = r; colors[ num_rects ] = color_list.store( c ); num_rects++; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscRectColorList::draw() { int const num_colors = color_list.count(); if (num_colors > 0) { NXRect* const v = rects + num_rects; // NOTE *1* for (int i = 0; i < num_colors; i++) { int vj = 0; for (int j = 0; j < num_rects; j++) if (colors[j] == i) v[vj++] = rects[j]; NXSetColor( color_list[i] ); NXRectFillList( v, vj ); } empty(); } } MiscKit/Palettes/MiscTableScroll/MiscHighlightTracker.h100444 1750 1750 3720 6757716151 23446 0ustar sunshinesunshine#ifndef __MiscHighlightTracker_h #define __MiscHighlightTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscHighlightTracker.h // // Highlight-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscHighlightTracker.h,v 1.2 96/05/05 11:05:20 sunshine Exp $ // $Log: MiscHighlightTracker.h,v $ // Revision 1.2 96/05/05 11:05:20 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- #import "MiscListTracker.h" @interface MiscHighlightTracker : MiscListTracker { BOOL extending; MiscCoord_V lastPos; } - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscHighlightTracker_h MiscKit/Palettes/MiscTableScroll/MiscIntList.M100444 1750 1750 27255 6757716151 21607 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscIntList.M // // A dynamically sizable list of integers. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscIntList.M,v 1.7 97/01/22 04:01:47 sunshine Exp $ // $Log: MiscIntList.M,v $ // Revision 1.7 97/01/22 04:01:47 sunshine // v0.117: Fixed bug: std_cmp() was returning 0 for (x > y). // Added explicit (id) return types. Updated formatting. // // Revision 1.6 96/07/16 22:00:53 zarnuk // Added searching methods. // // Revision 1.5 95/10/03 05:08:16 zarnuk // Fixed compiler warning. //----------------------------------------------------------------------------- #import extern "Objective-C" { #import } extern "C" { #include #include } //----------------------------------------------------------------------------- // std_cmp //----------------------------------------------------------------------------- static int std_cmp( void*, int x, int y ) { if (x < y) return -1; if (x > y) return 1; return 0; } //----------------------------------------------------------------------------- // qsort_cmp //----------------------------------------------------------------------------- static MiscIntListCompareFunc cmp_func = 0; static void* cmp_data = 0; static int qsort_cmp( void const* px, void const* py ) { return (*cmp_func)( cmp_data, *((int const*)px), *((int const*)py) ); } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscIntList //----------------------------------------------------------------------------- // sortUsing:data: //----------------------------------------------------------------------------- - (void)sortUsing:(MiscIntListCompareFunc)func data:(void*)data { unsigned int const N = [self count]; if (N > 1) { cmp_func = (func ? func : std_cmp); cmp_data = data; qsort( [array elementAt:0], N, sizeof(int), qsort_cmp ); } } //----------------------------------------------------------------------------- // sort //----------------------------------------------------------------------------- - (void)sort { [self sortUsing:&std_cmp data:0]; } //----------------------------------------------------------------------------- // bsearch:using:data: // Binary search with hook for user-defined comparisons. //----------------------------------------------------------------------------- - (int)bsearch:(int)x using:(MiscIntListCompareFunc)func data:(void*)data { if (func == 0) func = std_cmp; int const* const v = [self rawData]; int lo = 0; int hi = (int) [self count] - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; int const cmp = (*func)( data, x, v[mid] ); if (cmp < 0) hi = mid - 1; else if (cmp > 0) lo = mid + 1; else return mid; } return ~lo; } //----------------------------------------------------------------------------- // bsearch: // Straight binary search. //----------------------------------------------------------------------------- - (int)bsearch:(int)x { int const* const v = [self rawData]; int lo = 0; int hi = (int) [self count] - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; int const y = v[mid]; if (x < y) hi = mid - 1; else if (x > y) lo = mid + 1; else return mid; } return ~lo; } //----------------------------------------------------------------------------- // lsearch:using:data: // Linear search with hook for user-defined comparison. //----------------------------------------------------------------------------- - (int)lsearch:(int)x using:(MiscIntListCompareFunc)func data:(void*)data { if (func == 0) func = std_cmp; int const* const v = [self rawData]; int const N = (int) [self count]; for (int i = 0; i < N; i++) if ((*func)( data, x, v[i] ) == 0) return i; return -1; } //----------------------------------------------------------------------------- // lsearch: //----------------------------------------------------------------------------- - (int)lsearch:(int)x { int const* const v = [self rawData]; int const N = (int) [self count]; for (int i = 0; i < N; i++) if (x == v[i]) return i; return -1; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; array = [[Storage allocFromZone:[self zone]] initCount:0 elementSize:sizeof(int) description:"i"]; return self; } //----------------------------------------------------------------------------- // initFromString: //----------------------------------------------------------------------------- - (id)initFromString:(char const*)s { [self init]; [self readFromString:s]; return self; } //----------------------------------------------------------------------------- // free //----------------------------------------------------------------------------- - (id)free { [array free]; return [super free]; } //----------------------------------------------------------------------------- // copyFromZone: //----------------------------------------------------------------------------- - (id)copyFromZone:(NXZone*)zone { MiscIntList* clone = [super copyFromZone:zone]; clone->array = [array copyFromZone:zone]; return clone; } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- - (id)empty { [array empty]; return self; } //----------------------------------------------------------------------------- // count //----------------------------------------------------------------------------- - (unsigned int)count { return [array count]; } //----------------------------------------------------------------------------- // intAt: //----------------------------------------------------------------------------- - (int)intAt:(unsigned int)pos { return (pos < [self count] ? (*(int*)[array elementAt:pos]) : 0); } //----------------------------------------------------------------------------- // addInt: //----------------------------------------------------------------------------- - (void)addInt:(int)value { [self insertInt:value at:[self count]]; } //----------------------------------------------------------------------------- // addIntList: //----------------------------------------------------------------------------- - (void)addIntList:(MiscIntList*)list { if (list != 0) { unsigned int const lim = [list count]; for (unsigned int i = 0; i < lim; i++) [self addInt:[list intAt:i]]; } } //----------------------------------------------------------------------------- // insertInt:at: //----------------------------------------------------------------------------- - (void)insertInt:(int)value at:(unsigned int)pos { [array insertElement:&value at:pos]; } //----------------------------------------------------------------------------- // removeIntAt: //----------------------------------------------------------------------------- - (void)removeIntAt:(unsigned int)pos { [array removeElementAt:pos]; } //----------------------------------------------------------------------------- // replaceIntAt:with: //----------------------------------------------------------------------------- - (void)replaceIntAt:(unsigned int)pos with:(int)value { [array replaceElementAt:pos with:&value]; } //----------------------------------------------------------------------------- // append_char //----------------------------------------------------------------------------- static void append_char( char c, char*& buff, int& buff_size, int& len, BOOL can_expand ) { if (buff != 0) { if (len >= buff_size) if (!can_expand) buff = 0; else { buff_size <<= 1; // Double the size. buff = (char*) realloc( buff, buff_size ); } if (buff != 0) buff[ len++ ] = c; } } //----------------------------------------------------------------------------- // append_int //----------------------------------------------------------------------------- static void append_int( int x, char*& buff, int& buff_size, int& len, BOOL can_expand ) { char tmp[ 64 ]; sprintf( tmp, "%d", x ); for (char const* t = tmp; *t != 0 && buff != 0; t++) append_char( *t, buff, buff_size, len, can_expand ); } //----------------------------------------------------------------------------- // - writeToString:size:canExpand: //----------------------------------------------------------------------------- - (char*)writeToString:(char*)buff size:(int)buff_size canExpand:(BOOL)can_expand { int const START_SIZE = 32; int i,x,len; int const lim = [self count]; if ((buff == 0 || buff_size == 0) && can_expand) { buff = (char*) malloc( START_SIZE ); buff_size = START_SIZE; } if (buff_size == 0) buff = 0; len = 0; for (i = 0; buff != 0 && i < lim; i++) { x = [self intAt:i]; if (i > 0) append_char( ' ', buff, buff_size, len, can_expand ); append_int( x, buff, buff_size, len, can_expand ); } append_char( '\0', buff, buff_size, len, can_expand ); return buff; } //----------------------------------------------------------------------------- // - writeToString:size: //----------------------------------------------------------------------------- - (char*)writeToString:(char*)buff size:(int)buff_size { return [self writeToString:buff size:buff_size canExpand:NO]; } //----------------------------------------------------------------------------- // writeToString //----------------------------------------------------------------------------- - (char*)writeToString { return [self writeToString:0 size:0 canExpand:YES]; } //----------------------------------------------------------------------------- // readFromString: //----------------------------------------------------------------------------- - (int)readFromString:(char const*)s { [self empty]; if (s != 0) { while (*s != 0) { while (*s != 0 && *s != '-' && (*s < '0' || '9' < *s)) s++; BOOL is_neg = NO; if (*s == '-') { is_neg = YES; s++; } if ('0' <= *s && *s <= '9') { int x = 0; do { x = x * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); [self addInt:(is_neg ? -x : x)]; } } } return [self count]; } //----------------------------------------------------------------------------- // rawData //----------------------------------------------------------------------------- - (int const*)rawData { if ([self count] == 0) return 0; return (int const*) [array elementAt:0]; } @end MiscKit/Palettes/MiscTableScroll/MiscHorzResizeCursor.tiff100444 1750 1750 512 6757716137 24206 0ustar sunshinesunshineMM*ˆÀ À Àüü<ó <ðÀ0<ð0À À 0<ð0 <ðÀ<óüü À ÀÀÀÀÀÿüÿÿÿÿÀ?ÿÿðÿÿÿüÿÿÿü?ÿÿðÿÿÀÿÿÿüÀÀÀ *2:B(RH@@ ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscLineWrapper.h100444 1750 1750 10024 6757716152 22467 0ustar sunshinesunshine#ifndef __MiscLineWrapper_h #define __MiscLineWrapper_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscLineWrapper.h // // A C++ object for calculating line breaks in text. // // NOTE *PARTIAL* // "Partial" lines are lines that do not fit completely within the // height of the drawing rectangle. For example, if you have 3 lines // of text, but the drawing rectangle is only 2.5 lines tall, the // third line of text is a partial line. The caller can decide // whether or not to draw these partial lines. Default behavior draws // partial lines. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscLineWrapper.h,v 1.1 96/08/30 14:56:41 sunshine Exp $ // $Log: MiscLineWrapper.h,v $ // Revision 1.1 96/08/30 14:56:41 sunshine // A C++ object for calculating line breaks in text. // //----------------------------------------------------------------------------- #include extern "Objective-C" { #import #import // NXRect } extern "C" { #include // INT_MAX } class MiscLineWrapper { public: int const MAX_TEXT_LENGTH = (INT_MAX / 2); static float const DEFAULT_LEFT_MARGIN; static float const DEFAULT_TOP_MARGIN; static float const DEFAULT_RIGHT_MARGIN; static float const DEFAULT_BOTTOM_MARGIN; struct Line { float width; int start; int len; }; private: int text_len; int text_max; char* text; Font* font; NXFontMetrics const* metrics; int alignment; int num_lines; int max_lines; Line* lines; NXRect rect; float left_margin; float top_margin; float right_margin; float bottom_margin; float ascender; float descender; float line_height; bool char_wrap; bool no_partial; // NOTE *PARTIAL* bool needs_wrap; MiscLineWrapper(MiscLineWrapper const&) {} // No copy constructor. void operator = (MiscLineWrapper const&) {} // No assign operator. void do_wrap(); void wrap_segment( int seg_start, int seg_end ); float calc_width( int start_pos, int lim ) const; bool width_check() const; bool has_tabs( Line const& line ) const; void draw( float x, float y, int start, int len ); void draw_tabs( float x, float y, Line const& line ); public: MiscLineWrapper(); ~MiscLineWrapper(); void setText( char const* ); void setFont( Font* ); void setRect( NXRect ); void setLeftMargin( float ); void setTopMargin( float ); void setRightMargin( float ); void setBottomMargin( float ); void setAlignment( int ); void setCharWrap( bool ); void setNoPartialLines( bool b ) { no_partial = b; } char const* getText() const { return text; } Font* getFont() const { return font; } NXRect const& getRect() const { return rect; } float getLeftMargin() const { return left_margin; } float getTopMargin() const { return top_margin; } float getRightMargin() const { return right_margin; } float getBottomMargin() const { return bottom_margin; } int getAlignment() const { return alignment; } bool getCharWrap() const { return char_wrap; } bool getNoPartialLines() const { return no_partial; } bool needsWrap() const { return needs_wrap; } int numLines() const { return num_lines; } Line const& lineAt( int i ) const { return lines[i]; } void wrap(); void draw(); void dump() const; }; #endif // __MiscLineWrapper_h MiscKit/Palettes/MiscTableScroll/MiscListTracker.M100444 1750 1750 6655 6757716152 22432 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscListTracker.M // // List-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscListTracker.M,v 1.4 96/09/20 10:33:49 zarnuk Exp $ // $Log: MiscListTracker.M,v $ // Revision 1.4 96/09/20 10:33:49 zarnuk // All access to the selection now goes through MiscTableBorder. // // Revision 1.3 96/08/30 14:54:48 sunshine // Selected-slot was removed from SparseSet and promoted to TableBorder. // // Revision 1.2 96/05/05 11:08:04 sunshine // Fixed bug: Was unable to shift-drag to deselect range of slots. // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscListTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscListTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos { deselecting = NO; if (event->flags & NX_SHIFTMASK) { deselecting = border->isSelected( pos ); border->toggle( pos ); anchor = pos; } else if (event->flags & NX_ALTERNATEMASK) { int selected_slot = border->selectedSlot(); if (!border->goodPos( selected_slot )) selected_slot = pos; border->select( selected_slot, pos ); anchor = selected_slot; border->setSelectedSlot( pos ); } else { border->selectOne( pos ); anchor = pos; } } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (pos < 0) pos = 0; if (pos >= border->count()) pos = border->count() - 1; if (deselecting) border->unselect( anchor, pos ); else { int selected_slot = border->selectedSlot(); if (pos != selected_slot) { border->unselect( anchor, selected_slot ); border->select( anchor, pos ); } } border->setSelectedSlot( pos ); } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos { } @end MiscKit/Palettes/MiscTableScroll/MiscSparseSet.cc100444 1750 1750 31033 6757716166 22316 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscSparseSet.cc // // This object implements a sparse set. The set is represented by an // array of ranges kept in sorted ascending order. Each range is // separated from neighboring ranges by a gap of at least one value. // In other words, ranges do not overlap, and they do not "touch" each // other. The upper and lower bounds in each range are inclusive. A // range might contain a single value. In that case, both the upper and // lower bounds will have the same value. There are no empty ranges. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscSparseSet.cc,v 1.12 99/06/29 07:36:43 sunshine Exp $ // $Log: MiscSparseSet.cc,v $ // Revision 1.12 99/06/29 07:36:43 sunshine // v140: Ported back to NextStep 3.2. Compiler complained about signed vs. // unsigned comparisons. // // Revision 1.11 97/06/10 05:40:02 sunshine // v127: Removed unused header. // // Revision 1.10 97/01/24 08:14:27 sunshine // v0.119: Removed unnecessary loop from shiftDownAt() //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #import "MiscSparseSet.h" extern "C" { #import #import #import } unsigned int const INITIAL_CAPACITY = 16; //----------------------------------------------------------------------------- // sort //----------------------------------------------------------------------------- static inline void sort( int& low, int& high ) { if (high < low) { int t = low; low = high; high = t; } } //============================================================================= // IMPLEMENTATION //============================================================================= //----------------------------------------------------------------------------- // dump //----------------------------------------------------------------------------- void MiscSparseSet::dump( char const* msg ) const { fprintf( stderr, "(SPARSE-SET %s (", msg ); int last_hi = -1; bool corrupt = false; for (unsigned int i = 0; i < num_ranges; i++) { Range const& r = ranges[i]; if (r.lo <= last_hi) corrupt = true; last_hi = r.hi; fprintf( stderr, "%s%d", (i != 0 ? " " : ""), r.lo ); if (r.lo != r.hi) fprintf( stderr, "-%d", r.hi ); } fprintf( stderr, "))%s\n", corrupt ? " *** CORRUPT ***" : "" ); } //----------------------------------------------------------------------------- // expand(uint) //----------------------------------------------------------------------------- void MiscSparseSet::expand( unsigned int new_capacity ) { if (max_ranges < new_capacity) { max_ranges = new_capacity; int const BYTES = max_ranges * sizeof(*ranges); if (ranges == 0) ranges = (Range*) malloc( BYTES ); else ranges = (Range*) realloc( ranges, BYTES ); } } //----------------------------------------------------------------------------- // expand //----------------------------------------------------------------------------- inline void MiscSparseSet::expand() { if (num_ranges >= max_ranges) expand( max_ranges == 0 ? INITIAL_CAPACITY : max_ranges << 1 ); } //----------------------------------------------------------------------------- // coerce //----------------------------------------------------------------------------- int MiscSparseSet::coerce( int x ) const { if (isEmpty()) x = -1; else { int i = bsearch( x ); if (i < 0) { i = ~i; x = (i > 0 ? ranges[i-1].hi : ranges[i].lo); } } return x; } //----------------------------------------------------------------------------- // bsearch //----------------------------------------------------------------------------- int MiscSparseSet::bsearch( int x ) const { int lo = 0; int hi = numRanges() - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; Range const& r = ranges[mid]; if (x > r.hi) lo = mid + 1; else if (x < r.lo) hi = mid - 1; else return mid; } return ~lo; } //----------------------------------------------------------------------------- // insertAt //----------------------------------------------------------------------------- void MiscSparseSet::insertAt( unsigned int i, int lo, int hi ) { expand(); Range* const p = ranges + i; if (i < num_ranges) memmove( p + 1, p, (num_ranges - i) * sizeof(*ranges) ); num_ranges++; p->lo = lo; p->hi = hi; } //----------------------------------------------------------------------------- // deleteAt //----------------------------------------------------------------------------- void MiscSparseSet::deleteAt( unsigned int i, unsigned int n ) { num_ranges -= n; if (i < num_ranges) { Range* const p = ranges + i; memmove( p, p + n, (num_ranges - i) * sizeof(*ranges)); } } //----------------------------------------------------------------------------- // add -- singleton //----------------------------------------------------------------------------- void MiscSparseSet::add( int x ) { int i = bsearch( x ); if (i < 0) // else, (i >= 0) already in an existing range. { int action = 0; i = ~i; if (i > 0 && ranges[i-1].hi == x - 1) action |= 1; if (i < int(num_ranges) && ranges[i].lo == x + 1) action |= 2; switch (action) { case 0: insertAt( i, x, x ); break; case 1: ranges[i-1].hi = x; break; case 2: ranges[i].lo = x; break; case 3: ranges[i-1].hi = ranges[i].hi; deleteAt(i,1); break; } } } //----------------------------------------------------------------------------- // add -- range //----------------------------------------------------------------------------- void MiscSparseSet::add( int lo, int hi ) { if (lo == hi) add( lo ); else { sort( lo, hi ); int ilo = bsearch( lo - 1 ); int ihi = bsearch( hi + 1 ); if (ilo == ihi) { if (ilo < 0) // else both are in same existing range. insertAt( ~ilo, lo, hi ); } else { // Convert to good node coords. int nlo = ilo; if (nlo < 0) nlo = ~nlo; // round up int nhi = ihi; if (nhi < 0) nhi = ~nhi - 1; // round down if (nlo != nhi) { Range const& t = ranges[nhi]; if (hi < t.hi) hi = t.hi; deleteAt( nlo + 1, nhi - nlo ); } Range& r = ranges[nlo]; if (r.lo > lo) r.lo = lo; if (r.hi < hi) r.hi = hi; } } } //----------------------------------------------------------------------------- // remove -- singleton // NOTE *1*: Can't use 'r.hi' here since insertAt() may have called realloc(). //----------------------------------------------------------------------------- void MiscSparseSet::remove( int x ) { int const i = bsearch( x ); if (i >= 0) // else, (i < 0) already in a "gap". { int action = 0; Range& r = ranges[i]; if (r.lo == x) action |= 1; // Trim below. if (r.hi == x) action |= 2; // Trim above. switch (action) { case 0: insertAt( i + 1, x + 1, r.hi ); ranges[i].hi = x - 1; break; // NOTE *1* case 1: r.lo = x + 1; break; case 2: r.hi = x - 1; break; case 3: deleteAt( i, 1 ); break; } } } //----------------------------------------------------------------------------- // remove -- range //----------------------------------------------------------------------------- void MiscSparseSet::remove( int lo, int hi ) { if (lo == hi) remove( lo ); else { sort( lo, hi ); lo--; hi++; int ilo = bsearch( lo ); int ihi = bsearch( hi ); if (ilo == ihi) { if (ilo >= 0) // else both in the same "gap". { Range& r = ranges[ilo]; int const t = r.hi; r.hi = lo; insertAt( ilo + 1, hi, t ); } } else { if (ilo >= 0) { ranges[ilo].hi = lo; ilo++; } else ilo = ~ilo; if (ihi >= 0) ranges[ihi].lo = hi; else ihi = ~ihi; if (ihi > ilo) deleteAt( ilo, ihi - ilo ); } } } //----------------------------------------------------------------------------- // Constructor [Copy] //----------------------------------------------------------------------------- MiscSparseSet::MiscSparseSet( MiscSparseSet const& s ) : num_ranges(s.num_ranges), max_ranges(s.num_ranges), ranges(0) { if (max_ranges > 0) { int const BYTES = max_ranges * sizeof(*ranges); ranges = (Range*) malloc( BYTES ); memcpy( ranges, s.ranges, BYTES ); } } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscSparseSet::~MiscSparseSet() { if (ranges != 0) free( ranges ); } //----------------------------------------------------------------------------- // operator= //----------------------------------------------------------------------------- MiscSparseSet& MiscSparseSet::operator=( MiscSparseSet const& s ) { if (&s != this) { if (s.isEmpty()) empty(); else { expand( s.num_ranges ); num_ranges = s.num_ranges; memcpy( ranges, s.ranges, num_ranges * sizeof(*ranges) ); } } return *this; } //----------------------------------------------------------------------------- // operator== //----------------------------------------------------------------------------- bool MiscSparseSet::operator==( MiscSparseSet const& s ) const { return (&s == this || (num_ranges == s.num_ranges && (num_ranges == 0 || memcmp( ranges, s.ranges, num_ranges * sizeof(*ranges) ) == 0))); } //----------------------------------------------------------------------------- // toggle //----------------------------------------------------------------------------- void MiscSparseSet::toggle( int x ) { if (contains( x )) remove( x ); else add( x ); } //----------------------------------------------------------------------------- // shiftUpAt //----------------------------------------------------------------------------- void MiscSparseSet::shiftUpAt( int x ) { for (unsigned int i = num_ranges; i-- > 0; ) { Range& r = ranges[i]; if (r.hi >= x) { r.hi++; if (r.lo >= x) r.lo++; } else break; } if (contains(x)) remove(x); // Newly inserted slots are not selected. } //----------------------------------------------------------------------------- // shiftDownAt //----------------------------------------------------------------------------- void MiscSparseSet::shiftDownAt( int x ) { if (contains(x)) remove(x); for (int i = num_ranges; i-- > 0; ) { Range& r = ranges[i]; if (r.hi > x) { r.hi--; if (r.lo > x) r.lo--; } else break; } if (i >= 0 && i + 1 < int(num_ranges) && ranges[i].hi + 1 == ranges[i + 1].lo) { ranges[i].hi = ranges[i+1].hi; // Collapse adjacent range. deleteAt( i + 1, 1 ); } } //----------------------------------------------------------------------------- // count //----------------------------------------------------------------------------- unsigned int MiscSparseSet::count() const { unsigned int total = 0; Range const* p = ranges; Range const* const plim = p + num_ranges; for ( ; p < plim; p++) total += p->hi - p->lo + 1; return total; } //----------------------------------------------------------------------------- // getRangeAt //----------------------------------------------------------------------------- void MiscSparseSet::getRangeAt( unsigned int i, int& lo, int& hi ) const { lo = hi = -1; if (i < num_ranges) { lo = ranges[i].lo; hi = ranges[i].hi; } } //----------------------------------------------------------------------------- // getTotalRange //----------------------------------------------------------------------------- void MiscSparseSet::getTotalRange( int& lo, int& hi ) const { lo = hi = -1; if (num_ranges > 0) { lo = ranges[ 0 ].lo; hi = ranges[ num_ranges - 1 ].hi; } } MiscKit/Palettes/MiscTableScroll/MiscListTracker.h100444 1750 1750 3756 6757716152 22464 0ustar sunshinesunshine#ifndef __MiscListTracker_h #define __MiscListTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscListTracker.h // // List-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscListTracker.h,v 1.2 96/05/05 11:07:36 sunshine Exp $ // $Log: MiscListTracker.h,v $ // Revision 1.2 96/05/05 11:07:36 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // Fixed bug: Was unable to shift-drag to deselect range of slots. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" @interface MiscListTracker : MiscMouseTracker { MiscCoord_V anchor; BOOL deselecting; } - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscListTracker_h MiscKit/Palettes/MiscTableScroll/MiscMouseTracker.M100444 1750 1750 5716 6757716152 22604 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscMouseTracker.M // // Abstract class defining selection behavior based upon mouse tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscMouseTracker.M,v 1.3 96/09/20 10:34:15 zarnuk Exp $ // $Log: MiscMouseTracker.M,v $ // Revision 1.3 96/09/20 10:34:15 zarnuk // All access to the selection now goes through MiscTableBorder. // // Revision 1.2 96/05/05 11:06:08 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscMouseTracker //----------------------------------------------------------------------------- // initBorder: //----------------------------------------------------------------------------- - initBorder: (MiscTableBorder*) b { [super init]; border = b; border->selectNone(); return self; } //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos { [self subclassResponsibility: _cmd]; } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos { [self subclassResponsibility: _cmd]; } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos { [self subclassResponsibility: _cmd]; } @end MiscKit/Palettes/MiscTableScroll/MiscMouseTracker.h100444 1750 1750 4331 6757716153 22630 0ustar sunshinesunshine#ifndef __MiscMouseTracker_h #define __MiscMouseTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscMouseTracker.h // // Abstract class defining selection behavior based upon mouse tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscMouseTracker.h,v 1.3 96/09/20 10:34:42 zarnuk Exp $ // $Log: MiscMouseTracker.h,v $ // Revision 1.3 96/09/20 10:34:42 zarnuk // All access to the selection now goes through MiscTableBorder. // // Revision 1.2 96/05/05 11:06:11 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import extern "C" { #import } class MiscTableBorder; @interface MiscMouseTracker : Object { MiscTableBorder* border; } - initBorder: (MiscTableBorder*) border; - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscMouseTracker_h MiscKit/Palettes/MiscTableScroll/MiscRadioTracker.M100444 1750 1750 6536 6757716153 22554 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRadioTracker.M // // Radio-mode selection tracking. // // NOTE: We emulate Matrix behavior here. In radio mode if the mouse // goes up and the shift-key is held down then the cell is deselected. // Since keyboard events are treated like mouse events we do the same for // keyUp events -- however since we don't actually receive keyUp events, // we also perform special checking for the shift-key modifier in // -mouseDown: when the event is a keyboard event. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRadioTracker.M,v 1.4 96/09/20 10:35:31 zarnuk Exp $ // $Log: MiscRadioTracker.M,v $ // Revision 1.4 96/09/20 10:35:31 zarnuk // All access to the selection now goes through MiscTableBorder. // // Revision 1.3 96/08/30 14:55:02 sunshine // Selected-slot was removed from SparseSet and promoted to TableBorder. // // Revision 1.2 96/05/05 11:06:46 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscRadioTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscRadioTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (event->type == NX_KEYDOWN && (event->flags & NX_SHIFTMASK) != 0 && border->hasSelection() && pos == border->selectedSlot()) border->selectNone(); else border->selectOne( pos ); } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (border->goodPos(pos)) border->selectOne( pos ); else border->selectNone(); } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos { if (event->flags & NX_SHIFTMASK && border->goodPos(pos) && border->isSelected(pos)) border->selectNone(); } @end MiscKit/Palettes/MiscTableScroll/MiscRadioTracker.h100444 1750 1750 3605 6757716153 22601 0ustar sunshinesunshine#ifndef __MiscRadioTracker_h #define __MiscRadioTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRadioTracker.h // // Radio-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRadioTracker.h,v 1.2 96/05/05 11:06:49 sunshine Exp $ // $Log: MiscRadioTracker.h,v $ // Revision 1.2 96/05/05 11:06:49 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" @interface MiscRadioTracker : MiscMouseTracker { } - (void) mouseDown: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged: (NXEvent const*) event atPos: (MiscCoord_V) pos; - (void) mouseUp: (NXEvent const*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscRadioTracker_h MiscKit/Palettes/MiscTableScroll/MiscRectColorList.h100444 1750 1750 4107 6757716153 22755 0ustar sunshinesunshine#ifndef __MiscRectColorList_h #define __MiscRectColorList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectColorList.h // // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectColorList.h,v 1.1 96/08/30 14:57:12 sunshine Exp $ // $Log: MiscRectColorList.h,v $ // Revision 1.1 96/08/30 14:57:12 sunshine // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- #include "MiscColorList.h" extern "Objective-C" { #import // NXRect } struct MiscRectColorList { private: MiscColorList color_list; int num_rects; int max_rects; NXRect* rects; int* colors; MiscRectColorList(MiscRectColorList const&) {} // No copy constructor. void operator = (MiscRectColorList const&) {} // No assign operator. public: MiscRectColorList(); ~MiscRectColorList(); int count() const { return num_rects; } void empty() { color_list.empty(); num_rects = 0; } void append( NXRect r, NXColor c ); void draw(); }; #endif // __MiscRectColorList_h MiscKit/Palettes/MiscTableScroll/MiscRectList.h100444 1750 1750 3634 6757716153 21762 0ustar sunshinesunshine#ifndef __MiscRectList_h #define __MiscRectList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectList.h // // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectList.h,v 1.1 96/08/30 14:57:29 sunshine Exp $ // $Log: MiscRectList.h,v $ // Revision 1.1 96/08/30 14:57:29 sunshine // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server // //----------------------------------------------------------------------------- extern "Objective-C" { #import // NXRect } struct MiscRectList { private: int num_rects; int max_rects; NXRect* rects; MiscRectList(MiscRectList const&) {} // No copy constructor. void operator = (MiscRectList const&) {} // No assign operator. public: MiscRectList(); ~MiscRectList(); int count() const { return num_rects; } void empty() { num_rects = 0; } void append( NXRect r ); void draw( NXColor c ); }; #endif // __MiscRectList_h MiscKit/Palettes/MiscTableScroll/MiscTableBorder.cc100444 1750 1750 102154 6757716166 22615 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorder.cc // // Structure describing border of an MiscTableView. // // NOTE: many of the sub-arrays in an MiscTableBorder are conditional. // They are not guaranteed to be allocated for every instance. They are // only allocated when the caller tries to store a value in them. // // FIXME: Optimization: separate slot-offset calculations from // resizing calculations. Many situations only require an offset- // update, not a full size recalc. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorder.cc,v 1.24 98/02/25 13:43:53 zarnuk Exp $ // $Log: MiscTableBorder.cc,v $ // Revision 1.24 98/02/25 13:43:53 zarnuk // v137: Added clearSortDirection(). // // Revision 1.23 98/02/17 14:24:03 zarnuk // v135: Dropped clearVMap(). Added swapSlots(). // // Revision 1.22 97/12/19 00:54:30 zarnuk // v133: Combined sort-dir and sort-type. Eliminated data-sizing entirely. // Eliminated constrain-max functionality. Added min/max uniform size. // Now passes the version to read(). // // Revision 1.21 97/11/14 20:33:26 zarnuk // v130: Converted many arrays to physical-order. Reorganized somewhat. // Broke off I/O and selection routines into separate files. // // Revision 1.20 97/06/10 05:39:47 sunshine // v127: Uses new MiscAssert. //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #include "MiscTableBorder.h" #include "MiscTableScrollPrivate.h" #include "MiscTableUtil.h" #include #include extern "Objective-C" { #import #import #import } extern "C" { #include // floor() #include #include } #define MISC_SWAP(T,V,X,Y)\ if ((V) != 0) { T const t = (V)[X]; (V)[X] = (V)[Y]; (V)[Y] = t; } #define MISC_SIZE_CHECK(X)\ do {\ MiscAssert( 0 <= X );\ MiscAssert( X <= MISC_MAX_PIXELS_SIZE );\ } while(0) #define MISC_RANGE_CHECK(X)\ MiscAssert( 0 <= X ); MiscAssert( X < num_slots ) #define MISC_RANGE_CHECK_1(X)\ MiscAssert( 0 <= X ); MiscAssert( X <= num_slots ) #define MISC_SLOT_MEMBER(X,M) ((slots != 0) ? slots[X].M : def_slot.M) #define MISC_SET_SLOT_MEMBER(X,N,M)\ do {\ needs_recalc = true;\ if (slots == 0) alloc_slots();\ slots[X].M = N;\ } while (0) #define MISC_MAP(M,I) (((M) != 0) ? (M)[I] : I) #define MISC_DEF_SORT_DIR MISC_SORT_ASCENDING #define MISC_DEF_SORT_TYPE MISC_SORT_STRING_CASE_INSENSITIVE #define MISC_DEF_SORT_INFO ((MISC_DEF_SORT_TYPE << 1) | \ (MISC_DEF_SORT_DIR & 1)) //----------------------------------------------------------------------------- // global_grow //----------------------------------------------------------------------------- void MiscTableBorder::global_grow( MiscPixels total_size ) { MiscPixels offset = 0; MiscPixels deficit = min_total_size - total_size; MiscPixels const adj = deficit / num_springy; int nextra = (int) (deficit - adj * num_springy); for (int i = 0; i < num_slots; i++) { MiscTableSlot& r = slots[i]; if (r.isSpringy()) { MiscPixels delta = adj; if (nextra > 0) { nextra--; delta++; } r.adj_size = r.size + delta; } r.offset = offset; offset += r.adj_size; } } //----------------------------------------------------------------------------- // perform_recalc //----------------------------------------------------------------------------- void MiscTableBorder::perform_recalc() { MISC_SIZE_CHECK( min_total_size ); int i; MiscPixels total_size = 0; if (slots == 0) alloc_slots(); for (i = 0; i < num_slots; i++) { MiscTableSlot& r = slots[i]; MiscAssert( 0 <= r.min_size ); MiscAssert( r.min_size <= r.size ); MiscAssert( r.size <= r.max_size ); MiscAssert( r.max_size <= MISC_MAX_PIXELS_SIZE ); r.offset = total_size; r.adj_size = r.size; total_size += r.adj_size; } if (total_size < min_total_size && num_springy > 0) global_grow( total_size ); } //----------------------------------------------------------------------------- // do_recalc //----------------------------------------------------------------------------- void MiscTableBorder::do_recalc() { needs_recalc = false; if (uniform_size == 0 && num_slots > 0) perform_recalc(); } //----------------------------------------------------------------------------- // recalc_if_needed //----------------------------------------------------------------------------- inline void MiscTableBorder::recalc_if_needed() { if (needs_recalc) do_recalc(); } //----------------------------------------------------------------------------- // recalcOffsets //----------------------------------------------------------------------------- void MiscTableBorder::recalcOffsets() { needs_recalc = true; recalc_if_needed(); } //----------------------------------------------------------------------------- // alloc_size //----------------------------------------------------------------------------- inline int MiscTableBorder::alloc_size( int rec_size ) { return rec_size * max_slots; } //----------------------------------------------------------------------------- // do_alloc //----------------------------------------------------------------------------- void* MiscTableBorder::do_alloc( int size ) { return malloc( alloc_size(size) ); } //----------------------------------------------------------------------------- // do_alloc_init //----------------------------------------------------------------------------- void* MiscTableBorder::do_alloc_init( int size ) { int const nbytes = alloc_size( size ); void* const p = malloc( nbytes ); memset( p, 0, nbytes ); return p; } //----------------------------------------------------------------------------- // do_realloc //----------------------------------------------------------------------------- void* MiscTableBorder::do_realloc( void* p, int size ) { if (p != 0) { if (max_slots != 0) { p = realloc( p, max_slots * size ); } else { free( p ); p = 0; } } return p; } //----------------------------------------------------------------------------- // do_realloc //----------------------------------------------------------------------------- void MiscTableBorder::do_realloc() { slots = (MiscTableSlot*) do_realloc( slots, sizeof(*slots) ); v2p = (MiscCoord_P*) do_realloc( v2p, sizeof(*v2p) ); p2v = (MiscCoord_V*) do_realloc( p2v, sizeof(*p2v) ); tags = (int*) do_realloc( tags, sizeof(*tags) ); titles = (char**) do_realloc( titles, sizeof(*titles) ); styles = (MiscTableCellStyle*) do_realloc( styles, sizeof(*styles) ); prototypes = (id*) do_realloc( prototypes, sizeof(*prototypes) ); sort_funcs = (MiscCompareEntryFunc*) do_realloc( sort_funcs, sizeof(*sort_funcs) ); sort_info = (int*) do_realloc(sort_info,sizeof(*sort_info)); } //----------------------------------------------------------------------------- // freeExtraCapacity //----------------------------------------------------------------------------- void MiscTableBorder::freeExtraCapacity() { if (max_slots > num_slots) { max_slots = num_slots; do_realloc(); } } //----------------------------------------------------------------------------- // setCapacity //----------------------------------------------------------------------------- void MiscTableBorder::setCapacity( int x ) { if (max_slots < x) { max_slots = x; do_realloc(); } } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- void MiscTableBorder::empty() { setCount(0); selectNone(); clearCursor(); clearClickedSlot(); } //----------------------------------------------------------------------------- // DELETE //----------------------------------------------------------------------------- void MiscTableBorder::destroy_slot( MiscCoord_V x, MiscCoord_P p ) { if (isSpringy(x)) num_springy--; if (titles != 0 && titles[p] != 0) free( titles[p] ); if (prototypes != 0 && prototypes[p] != 0) [prototypes[p] free]; } void MiscTableBorder::do_delete( void* p, int n, int i ) { if (p != 0) memmove( p + i * n, p + (i + 1) * n, (num_slots - i) * n ); } void MiscTableBorder::do_delete( MiscCoord_V x, MiscCoord_P p ) { if (x < num_slots) { do_delete( slots, sizeof(*slots), x ); do_delete( v2p, sizeof(*v2p), x ); } if (p < num_slots) { do_delete( tags, sizeof(*tags), p ); do_delete( titles, sizeof(*titles), p ); do_delete( styles, sizeof(*styles), p ); do_delete( prototypes, sizeof(*prototypes), p ); do_delete( sort_funcs, sizeof(*sort_funcs), p ); do_delete( sort_info, sizeof(*sort_info), p ); do_delete( p2v, sizeof(*p2v), p ); } } void MiscTableBorder::deleteAt( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); selection.shiftDownAt( x ); if (num_slots <= 1 || num_slots <= getCursor() + 1) clearCursor(); if (num_slots <= 1 || num_slots <= clickedSlot() + 1) clearClickedSlot(); needs_recalc = true; MiscCoord_P const p = visualToPhysical(x); destroy_slot( x, p ); num_slots--; do_delete( x, p ); if (v2p != 0) { for (int i = 0; i < num_slots; i++) { if (v2p[i] >= p) v2p[i]--; if (p2v[i] >= x) p2v[i]--; } } fixSelectedSlot(); } //----------------------------------------------------------------------------- // INSERT //----------------------------------------------------------------------------- void MiscTableBorder::init_slot( MiscCoord_V x, MiscCoord_P p ) { if (def_slot.isSpringy()) num_springy++; if (slots != 0) slots[x] = def_slot; if (tags != 0) tags[p] = def_tag; if (titles != 0) titles[p] = 0; if (styles != 0) styles[p] = def_style; if (prototypes != 0) prototypes[p] = 0; if (sort_funcs != 0) sort_funcs[p] = 0; if (sort_info != 0) sort_info[p] = MISC_DEF_SORT_INFO; if (v2p != 0) { v2p[x] = p; p2v[p] = x; } } void MiscTableBorder::do_insert( void* p, int n, int i ) { if (p != 0) memmove( p + (i + 1) * n, p + i * n, (num_slots - i) * n ); } void MiscTableBorder::do_insert( MiscCoord_V x, MiscCoord_P p ) { if (x < num_slots) { do_insert( slots, sizeof(*slots), x ); do_insert( v2p, sizeof(*v2p), x ); } if (p < num_slots) { do_insert( titles, sizeof(*titles), p ); do_insert( tags, sizeof(*tags), p ); do_insert( styles, sizeof(*styles), p ); do_insert( prototypes, sizeof(*prototypes), p ); do_insert( sort_funcs, sizeof(*sort_funcs), p ); do_insert( sort_info, sizeof(*sort_info), p ); do_insert( p2v, sizeof(*p2v), p ); } } void MiscTableBorder::insertAt( MiscCoord_V x, MiscCoord_P p ) { MISC_RANGE_CHECK_1( x ); needs_recalc = true; if (num_slots >= max_slots) setCapacity( max_slots + 1 ); do_insert( x, p ); if (v2p != 0) { for (int i = 0; i < num_slots; i++) { if (p2v[i] >= x) p2v[i]++; if (v2p[i] >= p) v2p[i]++; } } init_slot( x, p ); num_slots++; selection.shiftUpAt( x ); if (selected_slot >= x) selected_slot++; if (hasValidCursor() && cursor >= x) cursor++; if (clicked_slot >= x) clicked_slot++; } //----------------------------------------------------------------------------- // do_shift //----------------------------------------------------------------------------- void MiscTableBorder::do_shift( void* p, int n, int i, int j ) { if (p != 0) if (i < j) memmove( p + i * n, p + (i + 1) * n, (j - i) * n ); else memmove( p + (j + 1) * n, p + j * n, (i - j) * n ); } //----------------------------------------------------------------------------- // do_shift //----------------------------------------------------------------------------- void MiscTableBorder::do_shift( MiscCoord_V from, MiscCoord_V to ) { do_shift( slots, sizeof(*slots), from, to ); do_shift( v2p, sizeof(*v2p), from, to ); } //----------------------------------------------------------------------------- // alloc_vmap //----------------------------------------------------------------------------- void MiscTableBorder::alloc_vmap() { p2v = (MiscCoord_V*) do_alloc( sizeof(*p2v) ); v2p = (MiscCoord_P*) do_alloc( sizeof(*v2p) ); for (int i = 0; i < num_slots; i++) { p2v[i] = i; v2p[i] = i; } } //----------------------------------------------------------------------------- // moveFromTo //----------------------------------------------------------------------------- void MiscTableBorder::moveFromTo( MiscCoord_V from, MiscCoord_V to ) { MISC_RANGE_CHECK( from ); MISC_RANGE_CHECK( to ); bool const was_cursor = (cursor == from); bool const was_clicked_slot = (clicked_slot == from); bool const was_selected_slot = (selected_slot == from); bool const was_selected = selection.contains( from ); selection.shiftDownAt( from ); needs_recalc = true; MiscCoord_P const p = visualToPhysical( from ); MiscTableSlot const tmp_slot = slots ? slots[from] : def_slot; if (p2v == 0) alloc_vmap(); do_shift( from, to ); if (from < to) { for (int i = 0; i < num_slots; i++) if (from < p2v[i] && p2v[i] <= to) p2v[i]--; if (!was_cursor && from <= cursor && cursor >= to) cursor--; } else { for (int i = 0; i < num_slots; i++) if (to <= p2v[i] && p2v[i] < from) p2v[i]++; if (!was_cursor && from <= cursor && cursor >= to) cursor++; } p2v[p] = to; v2p[to] = p; if (slots != 0) slots[to] = tmp_slot; selection.shiftUpAt( to ); if (was_selected) selection.add( to ); if (was_selected_slot) setSelectedSlot( to ); if (was_clicked_slot) setClickedSlot( to ); if (was_cursor) cursor = to; } //----------------------------------------------------------------------------- // setCount //----------------------------------------------------------------------------- void MiscTableBorder::setCount( int x ) { setP2VMap(0); if (num_slots != x) { needs_recalc = true; int const old_slots = num_slots; num_slots = x; setCapacity( x ); // Only increases capacity, never decreases. if (old_slots < num_slots) { for (int i = old_slots; i < num_slots; i++) init_slot( i, i ); } else { MiscAssert( old_slots <= max_slots ); num_slots = old_slots; for (int i = x; i < old_slots; i++) destroy_slot( i, visualToPhysical(i) ); num_slots = x; selection.remove( num_slots, old_slots ); if (selectedSlot() >= num_slots) fixSelectedSlot(); if (cursor >= num_slots) clearCursor(); if (clicked_slot >= num_slots) clearClickedSlot(); } } } //----------------------------------------------------------------------------- // good_map // 'map' is a good map if all the values are in-range, and no value // is repeated. A null map represents a normal sequential series. // 'onescomp' interprets negative values as the one's complement of a // slot number. //----------------------------------------------------------------------------- bool MiscTableBorder::good_map( int const* map, bool onescomp ) const { bool answer = true; int const lim = count(); if (lim > 0) { if (map != 0) { bool* seen = (bool*) calloc( sizeof(bool), lim ); for (int i = 0; i < lim; i++) { int x = map[i]; if (onescomp && x < 0) x = ~x; if ((unsigned int) x < (unsigned int)lim && !seen[i]) seen[i] = true; else { answer = false; break; } } free( seen ); } } return answer; } //----------------------------------------------------------------------------- // do_remap //----------------------------------------------------------------------------- void* MiscTableBorder::do_remap( void* p, int n, MiscCoord_V const* new_p2v ) { if (p != 0) { void* t = do_alloc( n ); for (int i = 0; i < num_slots; i++) memcpy( t + MISC_MAP(new_p2v,i) * n, p + MISC_MAP(p2v,i) * n, n ); free( p ); p = t; } return p; } //----------------------------------------------------------------------------- // do_remap //----------------------------------------------------------------------------- void MiscTableBorder::do_remap( MiscCoord_V const* new_p2v ) { if (num_slots > 0) slots = (MiscTableSlot*) do_remap( slots, sizeof(*slots), new_p2v ); } //----------------------------------------------------------------------------- // setP2VMap //----------------------------------------------------------------------------- bool MiscTableBorder::setP2VMap( MiscCoord_V const* new_p2v ) { if (good_map( (int const*) new_p2v, false )) { if (new_p2v != 0 || p2v != 0) { MiscSparseSet p_sel; visualToPhysical( selection, p_sel ); MiscCoord_P const p_selSlot = (selected_slot >= 0 ? visualToPhysical(selected_slot) : -1); needs_recalc = true; do_remap( new_p2v ); if (p2v == 0) { p2v = (MiscCoord_V*) do_alloc( sizeof(*p2v) ); v2p = (MiscCoord_P*) do_alloc( sizeof(*v2p) ); } if (new_p2v != 0 && p2v != 0) { for (int i = 0; i < num_slots; i++) v2p[new_p2v[i]] = i; memcpy( p2v, new_p2v, num_slots * sizeof(*p2v) ); } else if (new_p2v == 0) { free( p2v ); p2v = 0; free( v2p ); v2p = 0; } physicalToVisual( p_sel, selection ); selected_slot = (p_selSlot >= 0 ? physicalToVisual(p_selSlot) : -1); } return true; } return false; } //----------------------------------------------------------------------------- // setV2PMap //----------------------------------------------------------------------------- bool MiscTableBorder::setV2PMap( MiscCoord_P const* new_v2p ) { if (good_map( (int const*) new_v2p, false )) { if (new_v2p != 0 || v2p != 0) { if (new_v2p != 0) { MiscCoord_V* new_p2v = (MiscCoord_V*) malloc( sizeof(*new_p2v) * num_slots ); for (int i = 0; i < num_slots; i++) new_p2v[new_v2p[i]] = i; setP2VMap( new_p2v ); free( new_p2v ); } else setP2VMap( 0 ); } return true; } return false; } //----------------------------------------------------------------------------- // swapSlots //----------------------------------------------------------------------------- void MiscTableBorder::swapSlots( MiscCoord_P x, MiscCoord_P y ) { MISC_SWAP( MiscTableSlot, slots, x, y ) MISC_SWAP( int, tags, x, y ) MISC_SWAP( char*, titles, x, y ) MISC_SWAP( MiscTableCellStyle, styles, x, y ) MISC_SWAP( id, prototypes, x, y ) MISC_SWAP( MiscCompareEntryFunc, sort_funcs, x, y ) MISC_SWAP( int, sort_info, x, y ) do_recalc(); // offsets only. } //----------------------------------------------------------------------------- // setUniformSize //----------------------------------------------------------------------------- bool MiscTableBorder::setUniformSize( MiscPixels x ) { bool const changed = (uniform_size != x); if (changed) { needs_recalc = true; if (uniform_size == 0) // New, non-zero uniform size. { if (slots != 0) { free( slots ); slots = 0; } num_springy = 0; min_total_size = 0; } uniform_size = x; } return changed; } //----------------------------------------------------------------------------- // TOTAL SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::totalSize() { if (num_slots == 0) return 0; else if (uniform_size != 0) return (uniform_size * num_slots); else { recalc_if_needed(); return getOffset( num_slots - 1 ) + effectiveSize( num_slots - 1 ); } } void MiscTableBorder::setMinTotalSize( MiscPixels x ) { if (min_total_size != x) { min_total_size = x; MISC_SIZE_CHECK( min_total_size ); needs_recalc = true; } } //----------------------------------------------------------------------------- // EFFECTIVE SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::effectiveSize( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; recalc_if_needed(); return MISC_SLOT_MEMBER( x, adj_size ); } MiscPixels MiscTableBorder::effectiveMinSize( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return min_uniform_size; recalc_if_needed(); MiscTableSlot const& r = slots[x]; MiscPixels slot_min = r.min_size; MiscPixels global_min = min_total_size; for (int i = 0; i < num_slots; i++) { if (i != x) { MiscTableSlot& t = slots[i]; if (t.isSpringy()) global_min -= t.max_size; else global_min -= t.size; } } if (slot_min < global_min) slot_min = global_min; if (slot_min > r.adj_size) slot_min = r.adj_size; return slot_min; } //----------------------------------------------------------------------------- // alloc_slots //----------------------------------------------------------------------------- void MiscTableBorder::alloc_slots() { MiscAssert( slots == 0 ); slots = (MiscTableSlot*) do_alloc( sizeof(*slots) ); for (int i = 0; i < num_slots; i++) slots[i] = def_slot; } //----------------------------------------------------------------------------- // OFFSETS //----------------------------------------------------------------------------- MiscCoord_V MiscTableBorder::find_slot_for_offset( MiscPixels x ) { MiscAssert( num_slots > 0 ); int lo = 0; int hi = num_slots - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; if (slots[mid].offset <= x) lo = mid + 1; else hi = mid - 1; } if (lo > 0 && (lo >= num_slots || slots[lo].offset > x)) lo--; return lo; } MiscCoord_V MiscTableBorder::visualForOffset( MiscPixels x ) { MiscCoord_V i = -1; if (x >= 0 && num_slots > 0) { if (uniform_size != 0) { i = (MiscCoord_V) (x / uniform_size); } else { recalc_if_needed(); i = find_slot_for_offset( x ); } } if (i >= num_slots) i = num_slots - 1; return i; } MiscPixels MiscTableBorder::getOffset( MiscCoord_V x ) { if (num_slots == 0) return 0; MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size * x; recalc_if_needed(); return MISC_SLOT_MEMBER( x, offset ); } //----------------------------------------------------------------------------- // SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::getSize( MiscCoord_V x ) const { if (num_slots == 0) return 0; MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; return MISC_SLOT_MEMBER( x, size ); } void MiscTableBorder::setSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, size ); } MiscPixels MiscTableBorder::getMinSize( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; return MISC_SLOT_MEMBER( x, min_size ); } void MiscTableBorder::setMinSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, min_size ); } MiscPixels MiscTableBorder::getMaxSize( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return max_uniform_size; return MISC_SLOT_MEMBER( x, max_size ); } void MiscTableBorder::setMaxSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, max_size ); } //----------------------------------------------------------------------------- // SIZING //----------------------------------------------------------------------------- MiscTableSizing MiscTableBorder::getSizing( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return MISC_NUSER_NSPRINGY_SIZING; return MISC_SLOT_MEMBER( x, sizing ); } void MiscTableBorder::setSizing( MiscCoord_V x, MiscTableSizing n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_MAX_SIZING ); if (uniform_size == 0) { bool was_springy = ::isSpringy(getSizing(x)); bool is_springy = ::isSpringy(n); if (was_springy != is_springy) { if (was_springy) num_springy--; else num_springy++; needs_recalc = true; } MISC_SET_SLOT_MEMBER( x, n, sizing ); } } //----------------------------------------------------------------------------- // TITLES //----------------------------------------------------------------------------- void MiscTableBorder::dealloc_titles() { if (titles != 0) { for (int i = 0; i < num_slots; i++) if (titles[i] != 0) free( titles[i] ); free( titles ); titles = 0; } } void MiscTableBorder::alloc_titles() { titles = (char**) do_alloc_init( sizeof(*titles) ); } static char* do_strdup( char const* s ) { char* p = 0; if (s != 0 && *s != 0) strcpy( p = (char*) malloc( strlen(s) + 1 ), s ); return p; } bool MiscTableBorder::setTitle_P( MiscCoord_P x, char const* s ) { bool changed = false; if (getTitleMode() == MISC_CUSTOM_TITLE) { MISC_RANGE_CHECK( x ); char* const t = (titles ? titles[x] : 0); if (t != 0 || s != 0) { if (t == 0 || s == 0 || strcmp(t,s) != 0) { if (t != 0) free(t); if (titles == 0) alloc_titles(); titles[x] = do_strdup(s); changed = true; } } } return changed; } static char* alpha_title( char* p, int x ) { *--p = '\0'; if (x >= 26) { do { *--p = (x % 26) + 'A'; x /= 26; } while (x >= 26); x--; } *--p = x + 'A'; return p; } char const* MiscTableBorder::getTitle_P( MiscCoord_P x ) const { int const BUFF_LEN = 16; static char buff[ BUFF_LEN ]; char const* s = ""; MISC_RANGE_CHECK( x ); switch (title_mode) { case MISC_NO_TITLE: break; case MISC_NUMBER_TITLE: sprintf( buff, "%d", x + 1 ); s = buff; break; case MISC_ALPHA_TITLE: s = alpha_title( buff + BUFF_LEN, x ); break; case MISC_CUSTOM_TITLE: s = (titles != 0) ? titles[x] : ""; break; case MISC_DELEGATE_TITLE: s = [owner border:type getDelegateSlotTitle:x]; break; } return s; } bool MiscTableBorder::setTitleMode( MiscTableTitleMode x ) { MISC_ENUM_CHECK( x, MISC_MAX_TITLE ); bool const changed = (title_mode != x); if (changed) { dealloc_titles(); title_mode = x; } return changed; } //----------------------------------------------------------------------------- // TAGS //----------------------------------------------------------------------------- void MiscTableBorder::alloc_tags() { tags = (int*) do_alloc_init( sizeof(*tags) ); if (def_tag != 0) for (int i = 0; i < num_slots; i++) tags[i] = def_tag; } void MiscTableBorder::setTag_P( MiscCoord_P x, int n ) { MISC_RANGE_CHECK( x ); if (tags == 0) alloc_tags(); tags[x] = n; } int MiscTableBorder::getTag_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (tags != 0) ? tags[x] : def_tag; } //----------------------------------------------------------------------------- // STYLES //----------------------------------------------------------------------------- void MiscTableBorder::alloc_styles() { styles = (MiscTableCellStyle*) do_alloc_init( sizeof(*styles) ); if ((int) def_style != 0) for (int i = 0; i < num_slots; i++) styles[i] = def_style; } void MiscTableBorder::setStyle_P( MiscCoord_P x, MiscTableCellStyle n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_TABLE_CELL_MAX ); if (styles == 0) alloc_styles(); styles[x] = n; } MiscTableCellStyle MiscTableBorder::getStyle_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (styles != 0) ? styles[x] : def_style; } //----------------------------------------------------------------------------- // PROTOTYPES //----------------------------------------------------------------------------- void MiscTableBorder::alloc_prototypes() { prototypes = (id*) do_alloc_init( sizeof(*prototypes) ); } id MiscTableBorder::new_prototype( MiscCoord_P x ) { NXZone* const zone = [owner zone]; id p = 0; switch (getStyle_P(x)) { case MISC_TABLE_CELL_TEXT: p = [[MiscTableCell allocFromZone:zone] initTextCell:0]; break; case MISC_TABLE_CELL_ICON: p = [[MiscTableCell allocFromZone:zone] initIconCell:0]; break; case MISC_TABLE_CELL_BUTTON: p = [[ButtonCell allocFromZone:zone] initTextCell:0]; break; case MISC_TABLE_CELL_CALLBACK: p = [owner border:type getDelegateSlotPrototype:x]; break; } return p; } id MiscTableBorder::getPrototype_P( MiscCoord_P x ) { MISC_RANGE_CHECK( x ); if (prototypes == 0) alloc_prototypes(); id p = prototypes[x]; if (p == 0) p = prototypes[x] = new_prototype(x); return p; } void MiscTableBorder::setPrototype_P( MiscCoord_P x, id n ) { MISC_RANGE_CHECK( x ); if (prototypes == 0) alloc_prototypes(); if (prototypes[x] != 0) [prototypes[x] free]; prototypes[x] = n; } //----------------------------------------------------------------------------- // SORT FUNCTIONS //----------------------------------------------------------------------------- void MiscTableBorder::alloc_sort_funcs() { sort_funcs = (MiscCompareEntryFunc*) do_alloc_init( sizeof(*sort_funcs) ); } void MiscTableBorder::setSortFunc_P( MiscCoord_P x, MiscCompareEntryFunc n ) { MISC_RANGE_CHECK( x ); if (sort_funcs == 0) alloc_sort_funcs(); sort_funcs[x] = n; } MiscCompareEntryFunc MiscTableBorder::getSortFunc_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_funcs != 0) ? sort_funcs[x] : 0; } //----------------------------------------------------------------------------- // SORT INFO (TYPE + DIR) //----------------------------------------------------------------------------- void MiscTableBorder::alloc_sort_info() { sort_info = (int*) do_alloc_init( sizeof(*sort_info) ); } void MiscTableBorder::setSortType_P( MiscCoord_P x, MiscSortType n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_SORT_TYPE_MAX ); if (sort_info == 0) alloc_sort_info(); int const z = sort_info[x]; // Preserve direction. sort_info[x] = ((n << 1) | (z & 1)); } MiscSortType MiscTableBorder::getSortType_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_info != 0) ? MiscSortType( sort_info[x] >> 1 ) : MISC_SORT_STRING_CASE_INSENSITIVE; } void MiscTableBorder::setSortDirection_P( MiscCoord_P x, MiscSortDirection n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_SORT_DIR_MAX ); if (sort_info == 0) alloc_sort_info(); int const z = sort_info[x]; // Preserve type. sort_info[x] = ((z & ~1) | (n & 1)); } MiscSortDirection MiscTableBorder::getSortDirection_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_info != 0) ? MiscSortDirection( sort_info[x] & 1 ) : MISC_SORT_ASCENDING; } void MiscTableBorder::clearSortDirection() // Set all slots to ascending. { if (sort_info != 0) { int const* const plim = sort_info + count(); for (int* p = sort_info; p < plim; p++) *p &= ~1; } } //----------------------------------------------------------------------------- // DESTRUCTOR / CONSTRUCTOR //----------------------------------------------------------------------------- MiscTableBorder::~MiscTableBorder() { emptyAndFree(); } MiscTableBorder::MiscTableBorder( MiscBorderType x ) { MISC_ENUM_CHECK( x, MISC_MAX_BORDER ); memset( this, 0, sizeof(*this) ); type = x; clearSelectedSlot(); clearCursor(); clearClickedSlot(); if (type == MISC_ROW_BORDER) { uniform_size = 18; def_slot.offset = 0; def_slot.size = uniform_size; def_slot.min_size = 10; def_slot.max_size = MISC_MAX_PIXELS_SIZE; def_slot.sizing = MISC_NUSER_NSPRINGY_SIZING; title_mode = MISC_NUMBER_TITLE; draggable = false; modifier_drag = true; sizeable = false; selectable = true; } else { def_slot.offset = 0; def_slot.size = 80; def_slot.min_size = 10; def_slot.max_size = MISC_MAX_PIXELS_SIZE; def_slot.sizing = MISC_USER_NSPRINGY_SIZING; uniform_size = 0; title_mode = MISC_CUSTOM_TITLE; draggable = true; modifier_drag = false; sizeable = true; selectable = false; } min_uniform_size = MISC_MIN_PIXELS_SIZE; max_uniform_size = MISC_MAX_PIXELS_SIZE; } MiscKit/Palettes/MiscTableScroll/MiscRowView.M100444 1750 1750 3230 6757716154 21571 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRowView.M // // View class for the row labels on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRowView.M,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscRowView.M,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #import "MiscRowView.h" @implementation MiscRowView //----------------------------------------------------------------------------- // - initFrame:spreadSheet: //----------------------------------------------------------------------------- - initFrame: (NXRect const*) frameRect scroll: (MiscTableScroll*) i_scroll info: (MiscTableBorder*) i_info { [super initFrame:frameRect scroll:i_scroll info:i_info type:MISC_ROW_BORDER_VIEW]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTracer.cc100444 1750 1750 2533 6757716167 21611 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTracer.h // // Simple C++ class that helps generate function enter/exit // trace messages. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTracer.cc,v 1.1 97/12/22 22:00:33 zarnuk Exp $ // $Log: MiscTracer.cc,v $ // Revision 1.1 97/12/22 22:00:33 zarnuk // v134: Utility class to create function enter/exit messages. // //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscTracer.h" int MiscTracer::TRACE_DEPTH = 0; MiscKit/Palettes/MiscTableScroll/MiscRowView.h100444 1750 1750 2710 6757716154 21626 0ustar sunshinesunshine#ifndef __MiscRowView_h #define __MiscRowView_h //============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRowView.h // // View class for the row labels on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRowView.h,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscRowView.h,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #import "MiscBorderView.h" @interface MiscRowView : MiscBorderView { } - initFrame: (NXRect const*) frameRect scroll: (MiscTableScroll*) scroll info: (MiscTableBorder*) info; @end #endif // __MiscRowView_h MiscKit/Palettes/MiscTableScroll/MiscSortAscend.tiff100444 1750 1750 336 6757716137 22755 0ustar sunshinesunshineMM* :1:"ê€! ?????ÿÿ?ÿ ¾ÆÎÖ(R ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscSparseSet.h100444 1750 1750 7047 6757716154 22145 0ustar sunshinesunshine#ifndef __MiscSparseSet_h #define __MiscSparseSet_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscSparseSet.h // // This object implements a sparse set. The set is represented by an // array of ranges kept in sorted ascending order. Each range is // separated from neighboring ranges by a gap of at least one value. // In other words, ranges do not overlap, and they do not "touch" each // other. The upper and lower bounds in each range are inclusive. A // range might contain a single value. In that case, both the upper and // lower bounds will have the same value. There are no empty ranges. // // NOTE *1* // coerce(x) will return x if x is a member of the set. Otherwise, it // will return the closest previous member of the set, if any. Otherwise // it will return the closest following member of the set. Otherwise // it will return -1 if the set is empty. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscSparseSet.h,v 1.4 96/09/20 10:36:49 zarnuk Exp $ // $Log: MiscSparseSet.h,v $ // Revision 1.4 96/09/20 10:36:49 zarnuk // Added coerce(). // // Revision 1.3 96/08/30 15:00:11 sunshine // Removed "cursor" wart. Now this is a simple generic class. // // Revision 1.2 96/03/30 04:19:35 zarnuk // Totally revamped. Add/Remove operations are simpler. // Fixed bug in getTotalRange(). //----------------------------------------------------------------------------- #include "bool.h" class MiscSparseSet { private: struct Range { int lo; int hi; }; unsigned int num_ranges; unsigned int max_ranges; Range* ranges; void expand( unsigned int new_capacity ); void expand(); int bsearch( int x ) const; void insertAt( unsigned int i, int lo, int hi ); void deleteAt( unsigned int i, unsigned int n ); public: MiscSparseSet():num_ranges(0),max_ranges(0),ranges(0){} MiscSparseSet( MiscSparseSet const& ); ~MiscSparseSet(); MiscSparseSet& operator=( MiscSparseSet const& ); bool operator==( MiscSparseSet const& ) const; bool operator!=( MiscSparseSet const& s ) const { return !operator==(s); } bool contains( int x ) const { return (bsearch( x ) >= 0); } bool isEmpty() const { return (num_ranges == 0); } void empty() { num_ranges = 0; } unsigned int count() const; // # elments in set void add( int lo, int hi ); // add a range void add( int x ); void remove( int lo, int hi ); // remove a range void remove( int x ); void toggle( int x ); void shiftUpAt( int x ); void shiftDownAt( int x ); int coerce( int x ) const; // NOTE *1* unsigned int numRanges() const { return num_ranges; } void getRangeAt( unsigned int i, int& lo, int& hi ) const; void getTotalRange( int& lo, int& hi ) const; void dump( char const* msg ) const; }; #endif // __MiscSparseSet_h MiscKit/Palettes/MiscTableScroll/MiscTableBorder.h100444 1750 1750 42073 6757716154 22437 0ustar sunshinesunshine#ifndef __MiscTableBorder_h #define __MiscTableBorder_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorder.h // // Structure describing border of an MiscTableView. // // NOTE: Many of the sub-arrays in an MiscTableBorder are conditional. // They are not guaranteed to be allocated for every instance. They are // only allocated when the caller tries to store a value in them. Doing // a "set" creates the array, even if the value is the default value. // // "Springy" grow when the total size exceeds the global min total size. // // NOTE *1* These methods return true if the new value is different than // the old value, and the display needs updating. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorder.h,v 1.19 99/06/29 07:38:37 sunshine Exp $ // $Log: MiscTableBorder.h,v $ // Revision 1.19 99/06/29 07:38:37 sunshine // v140: Fixed bug: Incorrect clearCursor() implementation did nothing at all. // Ported back to NextStep 3.2. Compiler could not deal with isSortable() // calling getSortFunc() and getSortType() before they were declared. // A simple textual reorganization fixed this. // // Revision 1.18 98/03/24 04:52:20 sunshine // v138: bool set{Min|Max}UniformSize() {...} was failing to return a value. // // Revision 1.17 98/02/25 13:44:29 zarnuk // v137: Added clearSortDirection(). //----------------------------------------------------------------------------- #include #include "MiscSparseSet.h" #include "MiscTableUtil.h" extern "Objective-C" { #import #import } @class MiscTableScroll; @class Cell; struct MiscTableSlot { MiscPixels offset; // Offset of this slot. MiscPixels adj_size; // Size adjusted for springy-ness. MiscPixels size; // Target size. MiscPixels min_size; // Minimum size. MiscPixels max_size; // Maximum size. MiscTableSizing sizing; // Sizing options. bool isSpringy() const { return ::isSpringy(sizing); } void read( NXTypedStream*, int ver ); void write( NXTypedStream* ); }; class MiscTableBorder { private: MiscBorderType type; // Row / Col. MiscTableScroll* owner; MiscTableSlot def_slot; // Default slot configuration. int max_slots; // Capacity. Allocation size of arrays. int num_slots; // Active number of rows/cols. MiscTableSlot* slots; // Indexed by visual coords. MiscCoord_P* v2p; // Visual -> Physical coord map. MiscCoord_V* p2v; // Physical -> Visual coord map. int def_tag; // Default tag value. int* tags; // Indexed by physical coords. MiscPixels min_uniform_size;// Limits for user resizing. MiscPixels max_uniform_size;// MiscPixels uniform_size; // 0 = not uniform. MiscPixels min_total_size; // Min size for the entire border. int num_springy; // Number of "springy" slots. MiscTableTitleMode title_mode; char** titles; // Indexed by physical coords. MiscTableCellStyle def_style; MiscTableCellStyle* styles; // Indexed by physical coords. id* prototypes; // Indexed by physical coords. MiscCompareEntryFunc* sort_funcs;//Indexed by physical coords. int* sort_info; // ((sort_type << 1) | sort_dir) MiscSparseSet selection; // Selection (visual coordinates). MiscCoord_V selected_slot; // Selected slot. MiscCoord_V cursor; // Keyboard cursor. MiscCoord_V clicked_slot; // Clicked slot. bool selectable; // User can select slot-titles. bool sizeable; // User can resize slots. bool draggable; // User can rearrange slots. bool modifier_drag; // Use modifier key to drag slots. bool needs_recalc; // Offset values are "stale". void global_grow( MiscPixels ); void init_slot( MiscCoord_V, MiscCoord_P ); void destroy_slot( MiscCoord_V, MiscCoord_P ); void do_shift( void*, int, int, int ); void do_shift( MiscCoord_V, MiscCoord_V ); void* do_remap( void*, int, MiscCoord_V const* ); void do_remap( MiscCoord_V const* ); MiscCoord_V find_slot_for_offset( MiscPixels ); void perform_recalc(); void do_recalc(); void recalc_if_needed(); int alloc_size( int rec_size ); void* do_alloc( int ); void* do_alloc_init( int ); void* do_realloc( void*, int ); void do_realloc(); void do_delete( void*, int, int ); void do_delete( MiscCoord_V, MiscCoord_P ); void do_insert( void*, int, int ); void do_insert( MiscCoord_V, MiscCoord_P ); void alloc_slots(); void alloc_vmap(); void alloc_titles(); void dealloc_titles(); void alloc_tags(); void alloc_styles(); void alloc_prototypes(); id new_prototype( MiscCoord_P ); void alloc_sort_funcs(); void alloc_sort_info(); void selected_slots(MiscIntList* list, bool do_tags) const; void select_slots( MiscIntList*, bool clear, bool set ); void select_tags( MiscIntList*, bool clear, bool set ); public: MiscTableBorder( MiscBorderType ); ~MiscTableBorder(); MiscTableScroll* getOwner() const { return owner; } void setOwner( MiscTableScroll* x ) { owner = x; } int count() const { return num_slots; } int capacity() const { return max_slots; } void setCount( int ); void setCapacity( int ); void freeExtraCapacity(); void empty(); void emptyAndFree() { empty(); freeExtraCapacity(); } bool goodPos( int x ) const { return 0 <= x && x < count(); } int numSpringy() const { return num_springy; } MiscTableSlot const* getSlots() const { return slots; } MiscCoord_V const* getP2VMap() const { return p2v; } MiscCoord_P const* getV2PMap() const { return v2p; } void setSlotSizes( MiscPixels const* ); bool setP2VMap( MiscCoord_P const* ); bool setV2PMap( MiscCoord_V const* ); bool good_map( int const* map, bool onescomp ) const; void swapSlots( MiscCoord_P, MiscCoord_P ); MiscBorderType getType() const { return type; } bool isColBorder() const { return type == MISC_COL_BORDER; } bool isRowBorder() const { return type == MISC_ROW_BORDER; } bool isSelectable() const { return selectable; } bool isSizeable() const { return sizeable; } bool isDraggable() const { return draggable; } bool isModifierDrag() const { return modifier_drag; } bool isUniformSize() const { return uniform_size != 0; } MiscPixels getMinUniformSize() const { return min_uniform_size; } MiscPixels getMaxUniformSize() const { return max_uniform_size; } MiscPixels getUniformSize() const { return uniform_size; } MiscTableTitleMode getTitleMode() const { return title_mode; } void setType( MiscBorderType ); void setDraggable( bool x ) { draggable = x; } void setModifierDrag( bool x ) { modifier_drag = x; } void setSelectable( bool x ) { selectable = x; } void setSizeable( bool x ) { sizeable = x; } void setMinUniformSize( MiscPixels x ) { min_uniform_size = x; } void setMaxUniformSize( MiscPixels x ) { max_uniform_size = x; } bool setUniformSize( MiscPixels ); // NOTE *1* bool setTitleMode( MiscTableTitleMode ); // NOTE *1* MiscPixels totalSize(); MiscPixels getMinTotalSize() const { return min_total_size; } void setMinTotalSize( MiscPixels ); MiscCoord_P visualToPhysical( MiscCoord_V x ) const { return (x >= 0 && v2p != 0) ? v2p[x] : (MiscCoord_P)x; } MiscCoord_V physicalToVisual( MiscCoord_P x ) const { return (x >= 0 && p2v != 0) ? p2v[x] : (MiscCoord_V)x; } void visualToPhysical( MiscSparseSet const&, MiscSparseSet& ) const; void physicalToVisual( MiscSparseSet const&, MiscSparseSet& ) const; MiscCoord_V visualForOffset( MiscPixels ); bool needsRecalc() const { return needs_recalc; } void recalcOffsets(); void moveFromTo( MiscCoord_V, MiscCoord_V ); void insertAt( MiscCoord_V, MiscCoord_P ); void add() { insertAt(count(),count()); } void deleteAt( MiscCoord_V ); void deleteAt_P( MiscCoord_P x ){ deleteAt( physicalToVisual(x) ); } MiscPixels getOffset( MiscCoord_V ); MiscPixels getOffset_P( MiscCoord_P x ) { return getOffset( physicalToVisual(x) ); } MiscPixels effectiveSize( MiscCoord_V ); MiscPixels effectiveSize_P( MiscCoord_P x ) { return effectiveSize( physicalToVisual(x) ); } MiscPixels effectiveMinSize( MiscCoord_V ); MiscPixels effectiveMinSize_P( MiscCoord_P x ) { return effectiveMinSize( physicalToVisual(x) ); } MiscPixels getSize( MiscCoord_V ) const; // target size. MiscPixels getSize_P( MiscCoord_P x ) const { return getSize( physicalToVisual(x) ); } void setSize( MiscCoord_V, MiscPixels ); void setSize_P( MiscCoord_P x, MiscPixels y ) { setSize( physicalToVisual(x), y ); } MiscPixels getMinSize( MiscCoord_V ) const; MiscPixels getMinSize_P( MiscCoord_P x ) const { return getMinSize( physicalToVisual(x) ); } void setMinSize( MiscCoord_V, MiscPixels ); void setMinSize_P( MiscCoord_P x, MiscPixels y ) { setMinSize( physicalToVisual(x), y ); } MiscPixels getMaxSize( MiscCoord_V ) const; MiscPixels getMaxSize_P( MiscCoord_P x ) const { return getMaxSize( physicalToVisual(x) ); } void setMaxSize( MiscCoord_V, MiscPixels ); void setMaxSize_P( MiscCoord_P x, MiscPixels y ) { setMaxSize( physicalToVisual(x), y ); } MiscTableSizing getSizing( MiscCoord_V ) const; MiscTableSizing getSizing_P( MiscCoord_P x ) const { return getSizing( physicalToVisual(x) ); } void setSizing( MiscCoord_V, MiscTableSizing ); void setSizing_P( MiscCoord_P x, MiscTableSizing y ) { setSizing( physicalToVisual(x), y ); } int getTag_P( MiscCoord_P ) const; int getTag( MiscCoord_V x ) const { return getTag_P( visualToPhysical(x) ); } void setTag_P( MiscCoord_P, int ); void setTag( MiscCoord_V x, int y ) { setTag_P( visualToPhysical(x), y ); } char const* getTitle_P( MiscCoord_P ) const; char const* getTitle( MiscCoord_V x ) const { return getTitle_P( visualToPhysical(x) ); } bool setTitle_P( MiscCoord_P, char const* ); // NOTE *1* bool setTitle( MiscCoord_V x, char const* y ) // NOTE *1* { return setTitle_P( visualToPhysical(x), y ); } MiscTableCellStyle getStyle_P( MiscCoord_P ) const; MiscTableCellStyle getStyle( MiscCoord_V x ) const { return getStyle_P( visualToPhysical(x) ); } void setStyle_P( MiscCoord_P, MiscTableCellStyle ); void setStyle( MiscCoord_V x, MiscTableCellStyle y ) { setStyle_P( visualToPhysical(x), y ); } id getPrototype_P( MiscCoord_V ); id getPrototype( MiscCoord_V x ) { return getPrototype_P( visualToPhysical(x) ); } void setPrototype_P( MiscCoord_P, id ); void setPrototype( MiscCoord_V x, id y ) { setPrototype_P( visualToPhysical(x), y ); } MiscCompareEntryFunc getSortFunc_P( MiscCoord_P ) const; MiscCompareEntryFunc getSortFunc( MiscCoord_V x ) const { return getSortFunc_P( visualToPhysical(x) ); } void setSortFunc_P( MiscCoord_P, MiscCompareEntryFunc ); void setSortFunc( MiscCoord_V x, MiscCompareEntryFunc y ) { setSortFunc_P( visualToPhysical(x), y ); } MiscSortDirection getSortDirection_P( MiscCoord_P ) const; MiscSortDirection getSortDirection( MiscCoord_V x ) const { return getSortDirection_P( visualToPhysical(x) ); } void setSortDirection_P( MiscCoord_P, MiscSortDirection ); void setSortDirection( MiscCoord_V x, MiscSortDirection y ) { setSortDirection_P( visualToPhysical(x), y ); } void clearSortDirection(); // Set all slots to ascending. MiscSortType getSortType_P( MiscCoord_P ) const; MiscSortType getSortType( MiscCoord_V x ) const { return getSortType_P( visualToPhysical(x) ); } void setSortType_P( MiscCoord_P, MiscSortType ); void setSortType( MiscCoord_V x, MiscSortType y ) { setSortType_P( visualToPhysical(x), y ); } bool isSortable( MiscCoord_V x ) const { return getSortFunc(x) != 0 || getSortType(x) != MISC_SORT_SKIP; } bool isSortable_P( MiscCoord_P x ) const { return isSortable( physicalToVisual(x) ); } bool isFixed( MiscCoord_V x ) const { return ::isFixed(getSizing(x)); } bool isFixed_P( MiscCoord_P x ) const { return ::isFixed(getSizing_P(x)); } bool isSpringy( MiscCoord_V x ) const { return ::isSpringy(getSizing(x)); } bool isSpringy_P( MiscCoord_P x ) const { return ::isSpringy(getSizing_P(x)); } void setSpringy( MiscCoord_V x, bool b ) { setSizing( x, ::setSpringy(getSizing(x),b) ); } void setSpringy_P( MiscCoord_P x, bool y ) { setSpringy( physicalToVisual(x), y ); } bool isSizeable( MiscCoord_V x ) const { return ::isSizeable(getSizing(x)); } bool isSizeable_P( MiscCoord_P x ) const { return ::isSizeable(getSizing_P(x)); } void setSizeable( MiscCoord_V x, bool b ) { setSizing( x, ::setSizeable(getSizing(x),b) ); } void setSizeable_P( MiscCoord_P x, bool y ) { setSizeable( physicalToVisual(x), y ); } // DEFAULT VALUES ARE USED TO INITIALIZE NEW SLOTS. MiscPixels getDefaultSize() const { return def_slot.size; } MiscPixels getDefaultMinSize() const { return def_slot.min_size; } MiscPixels getDefaultMaxSize() const { return def_slot.min_size; } MiscTableSizing getDefaultSizing() const { return def_slot.sizing; } int getDefaultTag() const { return def_tag; } MiscTableCellStyle getDefaultStyle() const{ return def_style; } void setDefaultSize( MiscPixels x ) { needs_recalc = true; def_slot.size = x; } void setDefaultMinSize( MiscPixels x ) { needs_recalc = true; def_slot.min_size = x; } void setDefaultMaxSize( MiscPixels x ) { needs_recalc = true; def_slot.max_size = x; } void setDefaultSizing( MiscTableSizing x ) { needs_recalc = true; def_slot.sizing = x; } void setDefaultTag( int x ) { def_tag = x; } void setDefaultStyle( MiscTableCellStyle x ) { def_style = x; } // SELECTION MiscSparseSet const& selectionSet() const { return selection; } bool hasSelection() const { return !selection.isEmpty(); } bool hasMultipleSelection() const; unsigned int numSelected() const { return selection.count(); } MiscCoord_V selectedSlot() const { return selected_slot; } void clearSelectedSlot() { selected_slot = -1; } void setSelectedSlot( MiscCoord_V x ) { selected_slot = selection.coerce(x);} void fixSelectedSlot() { setSelectedSlot(selectedSlot()); } bool isSelected( MiscCoord_V x ) const { return selection.contains(x);} void toggle( MiscCoord_V x ) {selection.toggle(x); setSelectedSlot(x);} void select( MiscCoord_V x ) {selection.add(x); setSelectedSlot(x);} void select( MiscCoord_V lo, MiscCoord_V hi ) { selection.add(lo,hi); setSelectedSlot(hi); } void unselect( MiscCoord_V x ) { selection.remove(x); fixSelectedSlot(); } void unselect( MiscCoord_V lo, MiscCoord_V hi ) { selection.remove(lo,hi); fixSelectedSlot(); } void selectOne( MiscCoord_V x ) { selection.empty(); select(x); } void selectAll() { if (count() > 0) { selection.add( 0, count() - 1 ); setSelectedSlot( count() - 1 ); } } void selectNone() { selection.empty(); clearSelectedSlot(); } void selectSlots( MiscIntList* l, bool extend ) // Physical coords. { select_slots( l, !extend, true ); } void selectedSlots( MiscIntList* l ) const { selected_slots(l,false); } void selectTags( MiscIntList* l, bool extend ) { select_tags( l, !extend, true ); } void selectedTags( MiscIntList* l ) const { selected_slots(l,true); } void unselectSlots( MiscIntList* l ) // Physical coords. { select_slots( l, false, false ); } void unselectTags( MiscIntList* l ) { select_tags( l, false, false ); } // KEYBOARD CURSOR MiscCoord_V getCursor() const { return cursor; } void setCursor( MiscCoord_V c ) { if (c >= 0 && c < count()) cursor = c; } void clearCursor() { cursor = -1; } bool hasValidCursor() const { return cursor >= 0 && cursor < count(); } // CLICKED SLOT MiscCoord_V clickedSlot() const { return clicked_slot; } void setClickedSlot( MiscCoord_V s ) { clicked_slot = s; } void clearClickedSlot() { setClickedSlot(-1); } // PHYSICAL-COORDINATE CONVENIENCE METHODS. MiscCoord_P selectedSlot_P() const { return visualToPhysical(selected_slot); } void setSelectedSlot_P( MiscCoord_P x ) { setSelectedSlot( physicalToVisual(x) ); } void toggle_P( MiscCoord_P x ) { toggle( physicalToVisual(x) ); } void select_P( MiscCoord_P x ) { select( physicalToVisual(x) ); } void unselect_P( MiscCoord_P x ){ unselect( physicalToVisual(x) ); } bool isSelected_P( MiscCoord_P x ) const { return isSelected( physicalToVisual(x) ); } void selectOne_P( MiscCoord_P x ) { selectOne(physicalToVisual(x)); } void setCursor_P( MiscCoord_P x ) { setCursor(physicalToVisual(x)); } MiscCoord_P getCursor_P() const { return visualToPhysical(getCursor()); } MiscCoord_P clickedSlot_P() const { return visualToPhysical( clickedSlot() ); } void setClickedSlot_P( MiscCoord_P x ) { setClickedSlot( physicalToVisual(x) ); } // ARCHIVING SUPPORT. void write( NXTypedStream* ); void read( NXTypedStream*, int ver ); void read_v1( NXTypedStream*, int ver ); void read_v2( NXTypedStream*, int ver ); }; #endif // __MiscTableBorder_h MiscKit/Palettes/MiscTableScroll/MiscSortDescend.tiff100444 1750 1750 336 6757716140 23117 0ustar sunshinesunshineMM*ÿê88*ÿÿÿÿ???? ? ¾ÆÎÖ(R ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscSortDescendH.tiff100444 1750 1750 336 6757716140 23227 0ustar sunshinesunshineMM*Ì*À ÿÿÿÿ???? ? ¾ÆÎÖ(R ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscTableDimple.tiff100444 1750 1750 406 6757716140 23062 0ustar sunshinesunshineII*8€ P8! Á‹H­€7ÃÍðH € P8#ü°!¨L,‚D`   æª*îöþ(R"€ü '€ü 'MiscKit/Palettes/MiscTableScroll/MiscTableRightArrow.tiff100444 1750 1750 412 6757716140 23735 0ustar sunshinesunshineII*<€ P0”*`Ê¥€VÀ/ Q$V€ P0~Aßìýá †B`°8¤  êª*òú(R"€ü '€ü 'MiscKit/Palettes/MiscTableScroll/MiscTableScroll.tiff100444 1750 1750 14004 6757716140 23145 0ustar sunshinesunshineMM*ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿU_U_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯U_U_U_U_U_ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ª¯ 00ª²º(RB ü€' ü€'ªªªªªªªªªª¿ÿÿÿÿÿÿÿÿüµMMUMUMU5TµMMUMUMU5TµMMUMUMU5T° 0¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ô°îîîîîîîä¿ÿÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÕÿõÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿÕÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿUÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÕýUÿÿ¿ôµOïÿïÿïÿÿô° »»ªª«»»´¿ÿïÿꪯÿÿôµOÿÿéU¯ÿ¿ôµOïÿꪯÿÿô° »»ªª«»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµUUUUUUUUT€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00äìôü(RÂ@@ ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscTableBorderIO.cc100444 1750 1750 25703 6757716167 23032 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorderIO.cc // // Read/write routines for the MiscTableBorder class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorderIO.cc,v 1.4 98/03/24 04:51:24 sunshine Exp $ // $Log: MiscTableBorderIO.cc,v $ // Revision 1.4 98/03/24 04:51:24 sunshine // v138: Declared 'i' multiple times in MiscTableBorder::write(). // // Revision 1.3 97/12/19 00:55:34 zarnuk // v133: Combined sort-dir and sort-type. Eliminated data-sizing entirely. // Eliminated constrain-max functionality. Added min/max uniform size. // Now passes the version to read(). New storage layout. //----------------------------------------------------------------------------- #include "MiscTableBorder.h" #include "MiscTableScrollPrivate.h" #include "MiscTableUtil.h" //----------------------------------------------------------------------------- // MiscTableSlot::write //----------------------------------------------------------------------------- void MiscTableSlot::write( NXTypedStream* stream ) { NXWriteType( stream, @encode(MiscPixels), &size ); NXWriteType( stream, @encode(MiscPixels), &min_size ); NXWriteType( stream, @encode(MiscPixels), &max_size ); NXWriteType( stream, @encode(MiscTableSizing), &sizing ); } //----------------------------------------------------------------------------- // write //----------------------------------------------------------------------------- void MiscTableBorder::write( NXTypedStream* stream ) { register unsigned int m = 0; m = (m << 1) | (prototypes != 0); m = (m << 1) | (titles != 0); m = (m << 1) | (styles != 0); m = (m << 1) | (tags != 0); m = (m << 1) | (sort_info != 0); m = (m << 1) | (p2v != 0); m = (m << 1) | (slots != 0); m = (m << 1) | (modifier_drag != 0); m = (m << 1) | (draggable != 0); m = (m << 1) | (sizeable != 0); m = (m << 1) | (selectable != 0); m = (m << 1) | (type != 0); unsigned int const mbuff = m; NXWriteType( stream, @encode(unsigned int), &mbuff ); NXWriteObjectReference( stream, owner ); def_slot.write( stream ); NXWriteType( stream, @encode(MiscTableCellStyle), &def_style ); NXWriteType( stream, @encode(int), &def_tag ); NXWriteType( stream, @encode(MiscTableTitleMode), &title_mode ); NXWriteType( stream, @encode(MiscPixels), &min_uniform_size ); NXWriteType( stream, @encode(MiscPixels), &max_uniform_size ); NXWriteType( stream, @encode(MiscPixels), &uniform_size ); NXWriteType( stream, @encode(MiscPixels), &min_total_size ); NXWriteType( stream, @encode(int), &num_springy ); NXWriteType( stream, @encode(int), &num_slots ); int i; if (slots != 0) for (i = 0; i < num_slots; i++) slots[i].write( stream ); if (p2v != 0) NXWriteArray( stream, @encode(MiscCoord_V), num_slots, p2v ); if (sort_info != 0) NXWriteArray( stream, @encode(int), num_slots, sort_info ); if (tags != 0) NXWriteArray( stream, @encode(int), num_slots, tags ); if (styles != 0) NXWriteArray( stream, @encode(MiscTableCellStyle), num_slots, styles ); if (titles != 0) NXWriteArray( stream, @encode(char*), num_slots, titles ); if (prototypes != 0) for (i = 0; i < num_slots; i++) NXWriteObject( stream, prototypes[i] ); } //----------------------------------------------------------------------------- // read //----------------------------------------------------------------------------- void MiscTableBorder::read( NXTypedStream* stream, int ver ) { if (ver < MISC_TS_VERSION_2) read_v1( stream, ver ); else read_v2( stream, ver ); } //----------------------------------------------------------------------------- // MiscTableSlot::read //----------------------------------------------------------------------------- void MiscTableSlot::read( NXTypedStream* stream, int version ) { NXReadType( stream, @encode(MiscPixels), &size ); NXReadType( stream, @encode(MiscPixels), &min_size ); NXReadType( stream, @encode(MiscPixels), &max_size ); if (version < MISC_TS_VERSION_2) { MiscPixels data_size; unsigned int x; NXReadType( stream, @encode(MiscPixels), &data_size ); NXReadType( stream, @encode(MiscTableSizing), &x ); sizing = MiscTableSizing( (x & 1) | ((x & 4) >> 1) ); } else NXReadType( stream, @encode(MiscTableSizing), &sizing ); MISC_ENUM_CHECK( sizing, MISC_MAX_SIZING ); offset = 0; adj_size = size; } //----------------------------------------------------------------------------- // read_v2 //----------------------------------------------------------------------------- void MiscTableBorder::read_v2( NXTypedStream* stream, int ver ) { emptyAndFree(); sort_funcs = 0; // Can't archive function addresses. unsigned int mbuff; NXReadType( stream, @encode(unsigned int), &mbuff ); register unsigned int m = mbuff; type = MiscBorderType( m & 1 ); selectable = bool((m >>= 1) & 1); sizeable = bool((m >>= 1) & 1); draggable = bool((m >>= 1) & 1); modifier_drag = bool((m >>= 1) & 1); owner = NXReadObject( stream ); def_slot.read( stream, ver ); NXReadType( stream, @encode(MiscTableCellStyle), &def_style ); NXReadType( stream, @encode(int), &def_tag ); NXReadType( stream, @encode(MiscTableTitleMode), &title_mode ); NXReadType( stream, @encode(MiscPixels), &min_uniform_size ); NXReadType( stream, @encode(MiscPixels), &max_uniform_size ); NXReadType( stream, @encode(MiscPixels), &uniform_size ); NXReadType( stream, @encode(MiscPixels), &min_total_size ); NXReadType( stream, @encode(int), &num_springy ); NXReadType( stream, @encode(int), &num_slots ); max_slots = num_slots; if ((m >>= 1) & 1) { alloc_slots(); for (int i = 0; i < num_slots; i++) slots[i].read( stream, ver ); } if ((m >>= 1) & 1) { alloc_vmap(); NXReadArray( stream, @encode(MiscCoord_V), num_slots, p2v ); for (int i = 0; i < num_slots; i++) v2p[ p2v[i] ] = i; } if ((m >>= 1) & 1) { alloc_sort_info(); NXReadArray( stream, @encode(int), num_slots, sort_info ); } if ((m >>= 1) & 1) { alloc_tags(); NXReadArray( stream, @encode(int), num_slots, tags ); } if ((m >>= 1) & 1) { alloc_styles(); NXReadArray( stream, @encode(MiscTableCellStyle), num_slots, styles ); } if ((m >>= 1) & 1) { alloc_titles(); NXReadArray( stream, @encode(char*), num_slots, titles ); } if ((m >>= 1) & 1) { alloc_prototypes(); for (int i = 0; i < num_slots; i++) prototypes[i] = NXReadObject( stream ); } needs_recalc = true; } //----------------------------------------------------------------------------- // read_v1 //----------------------------------------------------------------------------- void MiscTableBorder::read_v1( NXTypedStream* stream, int ver ) { int n; emptyAndFree(); NXReadType( stream, @encode(MiscBorderType), &type ); MISC_ENUM_CHECK( type, MISC_MAX_BORDER ); owner = NXReadObject( stream ); def_slot.read( stream, ver ); NXReadType( stream, @encode(int), &num_slots ); max_slots = num_slots; NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_slots(); for (int i = 0; i < num_slots; i++) slots[i].read( stream, ver ); } NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_vmap(); for (int i = 0; i < num_slots; i++) NXReadType( stream, @encode(MiscCoord_P), &(v2p[i]) ); for (int j = 0; j < num_slots; j++) NXReadType( stream, @encode(MiscCoord_V), &(p2v[j]) ); } NXReadType( stream, @encode(int), &def_tag ); NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_tags(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); NXReadType( stream, @encode(int), &(tags[j]) ); } } NXReadType( stream, @encode(MiscPixels), &uniform_size ); NXReadType( stream, @encode(MiscPixels), &min_total_size ); MiscPixels max_total_size; // obsolete. NXReadType( stream, @encode(MiscPixels), &max_total_size ); NXReadType( stream, @encode(int), &num_springy ); NXReadType( stream, @encode(MiscTableTitleMode), &title_mode ); MISC_ENUM_CHECK( title_mode, MISC_MAX_TITLE ); NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_titles(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); NXReadType( stream, @encode(char*), &(titles[j]) ); } } NXReadType( stream, @encode(MiscTableCellStyle), &def_style ); MISC_ENUM_CHECK( def_style, MISC_TABLE_CELL_MAX ); NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_styles(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); NXReadType( stream, @encode(MiscTableCellStyle), &(styles[j]) ); MISC_ENUM_CHECK( styles[j], MISC_TABLE_CELL_MAX ); } } NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_prototypes(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); prototypes[j] = NXReadObject(stream); } } sort_funcs = 0; // Can't archive function addresses. NXReadType( stream, @encode(int), &n ); if (n != 0) { alloc_sort_info(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); MiscSortDirection x; NXReadType( stream, @encode(MiscSortDirection), &x ); MISC_ENUM_CHECK( x, MISC_SORT_DIR_MAX ); int const z = sort_info[j]; sort_info[j] = ((z & ~1) | (x & 1)); } } NXReadType( stream, @encode(int), &n ); if (n != 0) { if (sort_info == 0) alloc_sort_info(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); MiscSortType x; NXReadType( stream, @encode(MiscSortType), &x ); MISC_ENUM_CHECK( x, MISC_SORT_TYPE_MAX ); int const z = sort_info[j]; sort_info[j] = ((x << 1) | (z & 1)); } } NXReadType( stream, @encode(bool), &selectable ); NXReadType( stream, @encode(bool), &sizeable ); NXReadType( stream, @encode(bool), &draggable ); NXReadType( stream, @encode(bool), &modifier_drag ); min_uniform_size = MISC_MIN_PIXELS_SIZE; max_uniform_size = MISC_MAX_PIXELS_SIZE; needs_recalc = true; } MiscKit/Palettes/MiscTableScroll/MiscTableCell.M100444 1750 1750 106131 6757716155 22063 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableCell.M // // Default cell class used by MiscTableScroll to display text. // // NOTE *SET-OWNER-VALUE* // We must implement these methods so that MiscTableScroll will call // these methods instead of the explicit instance -setXxx methods. // However, we don't need to do any work. We will ask the owner for // it's value whenever we need it. // // FIXME: optional-allocation stuff does not address alignment requirements. // FIXME: automate most of the optional-allocation stuff. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableCell.M,v 1.16 97/06/10 05:50:46 sunshine Exp $ // $Log: MiscTableCell.M,v $ // Revision 1.16 97/06/10 05:50:46 sunshine // v127: Now scrollable by default (making setup for editable slots simpler). // Fixed bug: Was making allocation from wrong zone in -copyFromZone:. // // Revision 1.15 97/03/14 01:40:05 zarnuk // v125 -- fixed v121 bug: was not restoring fonts properly in // tableScroll:reviveAt::. Also folded-out a lot of unnecessary // and incorrect method-dispatch / function-call overhead in // that routine. // // Revision 1.14 97/02/11 19:26:32 sunshine // v123: Small optimization in high-traffic -tableScroll:reviveAt::. //----------------------------------------------------------------------------- #import #import #import "MiscTableView.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import #import } extern "C" { #import } #define MISC_TC_VERSION_0 0 #define MISC_TC_VERSION_1 1 #define MISC_TC_VERSION MISC_TC_VERSION_1 //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableCell //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (self == [MiscTableCell class]) { [self setVersion:MISC_TC_VERSION]; } return self; } //----------------------------------------------------------------------------- // + defaultFont //----------------------------------------------------------------------------- + (id)defaultFont { return [Font userFontOfSize:12.0 matrix:NX_FLIPPEDMATRIX]; } //----------------------------------------------------------------------------- // initTextCell: // NOTE *1* -[Cell initTextCell:] invokes -setStringValue: which // invokes -setFont:. This means that this cell will get an explicit // -setFont call before we finish initialization, and we need to // restore the useOwnerFont setting. //----------------------------------------------------------------------------- - (id)initTextCell:(char const*)s { [super initTextCell:s]; // NOTE *1* [self setBordered:NO]; [self setWrap:NO]; [self setAlignment:NX_LEFTALIGNED]; [self setScrollable:YES]; [self setUseOwnerFont:YES]; // NOTE *1* [self setOwnerFont:[[self class] defaultFont]]; return self; } //----------------------------------------------------------------------------- // initIconCell: //----------------------------------------------------------------------------- - (id)initIconCell:(char const*)s { [super initIconCell:s]; [self setBordered:NO]; return self; } //----------------------------------------------------------------------------- // isOpaque //----------------------------------------------------------------------------- - (BOOL)isOpaque { return !([self isSelected] ? [self useOwnerHighlightBackgroundColor] : [self useOwnerBackgroundColor]); } //----------------------------------------------------------------------------- // setSelected: //----------------------------------------------------------------------------- - (void)setSelected:(BOOL)flag { if (flag) tc1_flags |= MISC_TC1_IS_SELECTED; else tc1_flags &= ~MISC_TC1_IS_SELECTED; } //----------------------------------------------------------------------------- // isSelected //----------------------------------------------------------------------------- - (BOOL)isSelected { return ((tc1_flags & MISC_TC1_IS_SELECTED) != 0); } //----------------------------------------------------------------------------- // tag //----------------------------------------------------------------------------- - (int)tag { return tag; } //----------------------------------------------------------------------------- // setTag: //----------------------------------------------------------------------------- - (id)setTag:(int)x { tag = x; return self; } //----------------------------------------------------------------------------- // image //----------------------------------------------------------------------------- - (id)image { return ([self type] == NX_ICONCELL ? support : 0); } //----------------------------------------------------------------------------- // setImage: //----------------------------------------------------------------------------- - (id)setImage:(id)image { if ([self type] == NX_ICONCELL) { char const* name = [image name]; if (name) { [self setIcon:name]; } else { support = image; if (contents != 0 && cFlags1.freeText) NXZoneFree( [self zone], contents ); contents = 0; cFlags1.freeText = NO; } } return self; } //----------------------------------------------------------------------------- // owner //----------------------------------------------------------------------------- - (id)owner { return owner; } //----------------------------------------------------------------------------- // setOwner: //----------------------------------------------------------------------------- - (id)setOwner:(id)obj { if (obj != owner) { owner = obj; if (owner != 0) { if ([owner respondsTo:@selector(font)]) [self setOwnerFont:[owner font]]; } } return self; } //----------------------------------------------------------------------------- // font //----------------------------------------------------------------------------- - (id)font { return [super font]; } //----------------------------------------------------------------------------- // setFont: //----------------------------------------------------------------------------- - (id)setFont:(id)fontObj { [self setUseOwnerFont:NO]; [super setFont:fontObj]; return self; } //============================================================================= // TC1 MANIPULATION //============================================================================= //----------------------------------------------------------------------------- // tc1Flags //----------------------------------------------------------------------------- - (unsigned int)tc1Flags { return tc1_flags; } //----------------------------------------------------------------------------- // tc1DataSize //----------------------------------------------------------------------------- - (unsigned int)tc1DataSize { unsigned int size = 0; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) size += [self tc1TextColorLen]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) size += [self tc1BackgroundColorLen]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) size += [self tc1HighlightTextColorLen]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) size += [self tc1HighlightBackgroundColorLen]; return size; } //----------------------------------------------------------------------------- // tc1TextColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1TextColorPos { return 0; } //----------------------------------------------------------------------------- // tc1BackgroundColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1BackgroundColorPos { unsigned int pos = [self tc1TextColorPos]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) pos += [self tc1TextColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1HighlightTextColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1HighlightTextColorPos { unsigned int pos = [self tc1BackgroundColorPos]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) pos += [self tc1BackgroundColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1HighlightBackgroundColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1HighlightBackgroundColorPos { unsigned int pos = [self tc1HighlightTextColorPos]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) pos += [self tc1HighlightTextColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1TextColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1TextColorLen { return sizeof(NXColor); } //----------------------------------------------------------------------------- // tc1BackgroundColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1BackgroundColorLen { return sizeof(NXColor); } //----------------------------------------------------------------------------- // tc1HighlightTextColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1HighlightTextColorLen { return sizeof(NXColor); } //----------------------------------------------------------------------------- // tc1HighlightBackgroundColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1HighlightBackgroundColorLen { return sizeof(NXColor); } //----------------------------------------------------------------------------- // tc1TextColorPtr //----------------------------------------------------------------------------- - (NXColor*)tc1TextColorPtr { return (NXColor*)((char*)tc1_data + [self tc1TextColorPos]); } //----------------------------------------------------------------------------- // tc1BackgroundColorPtr //----------------------------------------------------------------------------- - (NXColor*)tc1BackgroundColorPtr { return (NXColor*)((char*)tc1_data + [self tc1BackgroundColorPos]); } //----------------------------------------------------------------------------- // tc1HighlightTextColorPtr //----------------------------------------------------------------------------- - (NXColor*)tc1HighlightTextColorPtr { return (NXColor*)((char*)tc1_data + [self tc1HighlightTextColorPos]); } //----------------------------------------------------------------------------- // tc1HighlightBackgroundColorPtr //----------------------------------------------------------------------------- - (NXColor*)tc1HighlightBackgroundColorPtr { return (NXColor*)((char*)tc1_data + [self tc1HighlightBackgroundColorPos]); } //----------------------------------------------------------------------------- // tc1InsertData:len:pos: //----------------------------------------------------------------------------- - (void*)tc1InsertData:(void const*)data pos:(unsigned int)pos len:(unsigned int)len { if (len > 0) { unsigned int const old_size = [self tc1DataSize]; unsigned int const new_size = old_size + len; if (old_size == 0) tc1_data = NXZoneMalloc( [self zone], new_size ); else { tc1_data = NXZoneRealloc( [self zone], tc1_data, new_size ); if (pos < old_size) memmove( (char*) tc1_data + pos + len, // Destination (char*) tc1_data + pos, // Source old_size - pos ); // # bytes. } if (data != 0) memcpy( (char*) tc1_data + pos, data, len ); else memset( (char*) tc1_data + pos, 0, len ); return (void*)((char*) tc1_data + pos ); } return 0; } //----------------------------------------------------------------------------- // tc1DeleteDataPos:len: //----------------------------------------------------------------------------- - (void)tc1DeleteDataPos:(unsigned int)pos len:(unsigned int)len { if (len > 0) { unsigned int const old_size = [self tc1DataSize]; unsigned int const new_size = old_size - len; if (new_size == 0) { NXZoneFree( [self zone], tc1_data ); tc1_data = 0; } else { if (pos < new_size) memmove( (char*) tc1_data + pos, // Destination (char*) tc1_data + pos + len, // Source new_size - pos ); // # bytes tc1_data = NXZoneRealloc( [self zone], tc1_data, new_size ); } } } //============================================================================= // *OWNER* CONTROLS //============================================================================= //----------------------------------------------------------------------------- // useOwnerFont //----------------------------------------------------------------------------- - (BOOL)useOwnerFont { return ((tc1_flags & MISC_TC1_SELF_FONT) == 0); } //----------------------------------------------------------------------------- // useOwnerTextColor //----------------------------------------------------------------------------- - (BOOL)useOwnerTextColor { return ((tc1_flags & MISC_TC1_SELF_TEXT_COLOR) == 0); } //----------------------------------------------------------------------------- // useOwnerBackgroundColor //----------------------------------------------------------------------------- - (BOOL)useOwnerBackgroundColor { return ((tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) == 0); } //----------------------------------------------------------------------------- // useOwnerHighlightTextColor //----------------------------------------------------------------------------- - (BOOL)useOwnerHighlightTextColor { return ((tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) == 0); } //----------------------------------------------------------------------------- // useOwnerHighlightBackgroundColor //----------------------------------------------------------------------------- - (BOOL)useOwnerHighlightBackgroundColor { return ((tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) == 0); } //----------------------------------------------------------------------------- // setUseOwnerFont: //----------------------------------------------------------------------------- - (id)setUseOwnerFont:(BOOL)flag { if ([self useOwnerFont] != flag) { if (flag) { tc1_flags &= ~(MISC_TC1_SELF_FONT); if (owner != 0 && [owner respondsTo:@selector(font)]) [self setOwnerFont:[owner font]]; } else // (!flag) { tc1_flags |= MISC_TC1_SELF_FONT; } } return self; } //----------------------------------------------------------------------------- // setUseOwnerTextColor: //----------------------------------------------------------------------------- - (id)setUseOwnerTextColor:(BOOL)flag { if ([self useOwnerTextColor] != flag) { unsigned int const pos = [self tc1TextColorPos]; unsigned int const len = [self tc1TextColorLen]; if (flag) { [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_TEXT_COLOR); } else // (!flag) { NXColor color = [[self class] defaultTextColor]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_TEXT_COLOR; } } return self; } //----------------------------------------------------------------------------- // setUseOwnerBackgroundColor: //----------------------------------------------------------------------------- - (id)setUseOwnerBackgroundColor:(BOOL)flag { if ([self useOwnerBackgroundColor] != flag) { unsigned int const pos = [self tc1BackgroundColorPos]; unsigned int const len = [self tc1BackgroundColorLen]; if (flag) { [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR); } else // (!flag) { NXColor color = [[self class] defaultBackgroundColor]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR; } } return self; } //----------------------------------------------------------------------------- // setUseOwnerHighlightTextColor: //----------------------------------------------------------------------------- - (id)setUseOwnerHighlightTextColor:(BOOL)flag { if ([self useOwnerHighlightTextColor] != flag) { unsigned int const pos = [self tc1HighlightTextColorPos]; unsigned int const len = [self tc1HighlightTextColorLen]; if (flag) { [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_TEXT_COLOR_H); } else // (!flag) { NXColor color = [[self class] defaultHighlightTextColor]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_TEXT_COLOR_H; } } return self; } //----------------------------------------------------------------------------- // setUseOwnerHighlightBackgroundColor: //----------------------------------------------------------------------------- - (id)setUseOwnerHighlightBackgroundColor:(BOOL)flag { if ([self useOwnerHighlightBackgroundColor] != flag) { unsigned int const pos = [self tc1HighlightBackgroundColorPos]; unsigned int const len = [self tc1HighlightBackgroundColorLen]; if (flag) { [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR_H); } else // (!flag) { NXColor color = [[self class] defaultHighlightBackgroundColor]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR_H; } } return self; } //----------------------------------------------------------------------------- // setOwnerFont: //----------------------------------------------------------------------------- - (id)setOwnerFont:(id)fontObj { if ([self useOwnerFont]) [super setFont:fontObj]; return self; } //----------------------------------------------------------------------------- // setOwner values... NOTE *SET-OWNER-VALUE* //----------------------------------------------------------------------------- - (id)setOwnerTextColor:(NXColor)pcolor { return self; } - (id)setOwnerBackgroundColor:(NXColor)pcolor { return self; } - (id)setOwnerHighlightTextColor:(NXColor)pcolor { return self; } - (id)setOwnerHighlightBackgroundColor:(NXColor)pcolor { return self; } //============================================================================= // COLOR MANIPULATION //============================================================================= //----------------------------------------------------------------------------- // textGray //----------------------------------------------------------------------------- - (float)textGray { float gray; NXConvertColorToGray( [self textColor], &gray ); return gray; } //----------------------------------------------------------------------------- // setTextGray: //----------------------------------------------------------------------------- - (id)setTextGray:(float)value { return [self setTextColor:NXConvertGrayToColor( value )]; } //----------------------------------------------------------------------------- // backgroundGray //----------------------------------------------------------------------------- - (float)backgroundGray { float gray; NXConvertColorToGray( [self backgroundColor], &gray ); return gray; } //----------------------------------------------------------------------------- // setBackgroundGray: //----------------------------------------------------------------------------- - (id)setBackgroundGray:(float)value { return [self setBackgroundColor:NXConvertGrayToColor( value ) ]; } //----------------------------------------------------------------------------- // highlightTextGray //----------------------------------------------------------------------------- - (float)highlightTextGray { float gray; NXConvertColorToGray( [self highlightTextColor], &gray ); return gray; } //----------------------------------------------------------------------------- // setHighlightTextGray: //----------------------------------------------------------------------------- - (id)setHighlightTextGray:(float)value { return [self setHighlightTextColor:NXConvertGrayToColor( value )]; } //----------------------------------------------------------------------------- // highlightBackgroundGray //----------------------------------------------------------------------------- - (float)highlightBackgroundGray { float gray; NXConvertColorToGray( [self highlightBackgroundColor], &gray ); return gray; } //----------------------------------------------------------------------------- // setHighlightBackgroundGray: //----------------------------------------------------------------------------- - (id)setHighlightBackgroundGray:(float)value { return [self setHighlightBackgroundColor:NXConvertGrayToColor( value ) ]; } //----------------------------------------------------------------------------- // +defaultBackgroundColor //----------------------------------------------------------------------------- + (NXColor)defaultBackgroundColor { return NX_COLORLTGRAY; } //----------------------------------------------------------------------------- // backgroundColor //----------------------------------------------------------------------------- - (NXColor)backgroundColor { if ([self useOwnerBackgroundColor]) { if (owner != 0 && [owner respondsTo:@selector(backgroundColor)]) return [owner backgroundColor]; return [[self class] defaultBackgroundColor]; } NXColor const* const p = [self tc1BackgroundColorPtr]; return *p; } //----------------------------------------------------------------------------- // setBackgroundColor //----------------------------------------------------------------------------- - (id)setBackgroundColor:(NXColor)c { NXColor* p; [self setUseOwnerBackgroundColor:NO]; p = [self tc1BackgroundColorPtr]; *p = c; return self; } //----------------------------------------------------------------------------- // +defaultHighlightBackgroundColor //----------------------------------------------------------------------------- + (NXColor)defaultHighlightBackgroundColor { return NX_COLORWHITE; } //----------------------------------------------------------------------------- // highlightBackgroundColor //----------------------------------------------------------------------------- - (NXColor)highlightBackgroundColor { if ([self useOwnerHighlightBackgroundColor]) { if (owner && [owner respondsTo:@selector(highlightBackgroundColor)]) return [owner highlightBackgroundColor]; return [[self class] defaultHighlightBackgroundColor]; } NXColor const* const p = [self tc1HighlightBackgroundColorPtr]; return *p; } //----------------------------------------------------------------------------- // setHighlightBackgroundColor //----------------------------------------------------------------------------- - (id)setHighlightBackgroundColor:(NXColor)c { NXColor* p; [self setUseOwnerHighlightBackgroundColor:NO]; p = [self tc1HighlightBackgroundColorPtr]; *p = c; return self; } //----------------------------------------------------------------------------- // +defaultTextColor //----------------------------------------------------------------------------- + (NXColor)defaultTextColor { return NX_COLORBLACK; } //----------------------------------------------------------------------------- // textColor //----------------------------------------------------------------------------- - (NXColor)textColor { if ([self useOwnerTextColor]) { if (owner != 0 && [owner respondsTo:@selector(textColor)]) return [owner textColor]; return [[self class] defaultTextColor]; } NXColor const* const p = [self tc1TextColorPtr]; return *p; } //----------------------------------------------------------------------------- // setTextColor //----------------------------------------------------------------------------- - (id)setTextColor:(NXColor)c { NXColor* p; [self setUseOwnerTextColor:NO]; p = [self tc1TextColorPtr]; *p = c; return self; } //----------------------------------------------------------------------------- // +defaultHighlightTextColor //----------------------------------------------------------------------------- + (NXColor)defaultHighlightTextColor { return NX_COLORBLACK; } //----------------------------------------------------------------------------- // highlightTextColor //----------------------------------------------------------------------------- - (NXColor)highlightTextColor { if ([self useOwnerHighlightTextColor]) { if (owner != 0 && [owner respondsTo:@selector(highlightTextColor)]) return [owner highlightTextColor]; return [[self class] defaultHighlightTextColor]; } NXColor const* const p = [self tc1HighlightTextColorPtr]; return *p; } //----------------------------------------------------------------------------- // setHighlightTextColor //----------------------------------------------------------------------------- - (id)setHighlightTextColor:(NXColor)c { NXColor* p; [self setUseOwnerHighlightTextColor:NO]; p = [self tc1HighlightTextColorPtr]; *p = c; return self; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // ownerDraw //----------------------------------------------------------------------------- - (BOOL)ownerDraw { return !(tc1_flags & MISC_TC1_SELF_DRAW); } //----------------------------------------------------------------------------- // setOwnerDraw: //----------------------------------------------------------------------------- - (id)setOwnerDraw:(BOOL)flag { if (flag) tc1_flags &= ~(MISC_TC1_SELF_DRAW); else // (!flag) tc1_flags |= MISC_TC1_SELF_DRAW; return self; } //----------------------------------------------------------------------------- // bgColor //----------------------------------------------------------------------------- - (NXColor)bgColor { return [self isSelected] ? [self highlightBackgroundColor] : [self backgroundColor]; } //----------------------------------------------------------------------------- // fgColor //----------------------------------------------------------------------------- - (NXColor)fgColor { return [self isSelected] ? [self highlightTextColor] : [self textColor]; } //----------------------------------------------------------------------------- // setTextAttributes: //----------------------------------------------------------------------------- - (id)setTextAttributes:(id)textObject { [super setTextAttributes:textObject]; [textObject setTextColor:[self fgColor]]; [textObject setBackgroundColor:[self bgColor]]; return textObject; } //----------------------------------------------------------------------------- // drawInside:inView: // // NOTE *1*: Our superclass (Cell) swaps white with gray when highlighted. // Since we supply our own highlight colors, we need to subvert Cell's // normal behavior in order to prevent it from munging our colors. //----------------------------------------------------------------------------- - (id)drawInside:(NXRect const*)rect inView:(id)controlView { if ([self isOpaque]) { NXSetColor( [self bgColor] ); NXRectFill( rect ); } int const wasHighlighted = [self isHighlighted]; // NOTE *1* [self setParameter:NX_CELLHIGHLIGHTED to:0]; [super drawInside:rect inView:controlView]; [self setParameter:NX_CELLHIGHLIGHTED to:wasHighlighted]; // NOTE *1* return self; } //----------------------------------------------------------------------------- // drawSelf:inView: //----------------------------------------------------------------------------- - (id)drawSelf:(NXRect const*)cellFrame inView:(id)aView { return [self drawInside:cellFrame inView:aView]; } //----------------------------------------------------------------------------- // highlight:inView:lit: // // No need to do any actual drawing since this class does not display // itself differently when highlighted. //----------------------------------------------------------------------------- - (id)highlight:(NXRect const*)cellFrame inView:(id)aView lit:(BOOL)flag { if (flag != [self isHighlighted]) [self setParameter:NX_CELLHIGHLIGHTED to:flag]; return self; } //============================================================================= // REVIVE / RETIRE //============================================================================= //----------------------------------------------------------------------------- // tableScroll:reviveAt:: // // NOTE *1* // This is a performance-critical method. Therefore, the owner font // setting code has been completely in-lined here. Furthermore, since // the owner's font may have changed after the cell was retired, we // latch the owner's current font unconditionally here. //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)scroll reviveAt:(int)row :(int)col { unsigned int const MASK = MISC_TC1_SELF_DRAW | MISC_TC1_SELF_TEXT_COLOR | MISC_TC1_SELF_BACKGROUND_COLOR | MISC_TC1_SELF_TEXT_COLOR_H | MISC_TC1_SELF_BACKGROUND_COLOR_H; owner = scroll; tc1_flags &= ~(MISC_TC1_SELF_FONT); [super setFont:[scroll font]]; // NOTE *1* if (tc1_flags & MASK) { if (tc1_flags & MISC_TC1_SELF_DRAW) [self setOwnerDraw:YES]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) [self setUseOwnerTextColor:YES]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) [self setUseOwnerBackgroundColor:YES]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) [self setUseOwnerHighlightTextColor:YES]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) [self setUseOwnerHighlightBackgroundColor:YES]; } return self; } //----------------------------------------------------------------------------- // tableScroll:retireAt:: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)scroll retireAt:(int)row :(int)col { if ([self type] == NX_TEXTCELL) [self setStringValueNoCopy:0]; return self; } //============================================================================= // ALLOCATION / DEALLOCATION //============================================================================= //----------------------------------------------------------------------------- // tc1DestroyData //----------------------------------------------------------------------------- - (void)tc1DestroyData { tc1_flags = 0; } //----------------------------------------------------------------------------- // tc1FreeData //----------------------------------------------------------------------------- - (void)tc1FreeData { if (tc1_data != 0) { NXZoneFree( [self zone], tc1_data ); tc1_data = 0; } } //----------------------------------------------------------------------------- // free //----------------------------------------------------------------------------- - (id)free { [self tc1DestroyData]; [self tc1FreeData]; return [super free]; } //----------------------------------------------------------------------------- // copyFromZone: //----------------------------------------------------------------------------- - (id)copyFromZone:(NXZone*)zone { MiscTableCell* clone = [super copyFromZone:zone]; if (tc1_data != 0) { unsigned int const size = [self tc1DataSize]; void* p = NXZoneMalloc( zone, size ); memcpy( p, tc1_data, size ); clone->tc1_data = p; } return clone; } //============================================================================= // ARCHIVING //============================================================================= //----------------------------------------------------------------------------- // read: //----------------------------------------------------------------------------- - (id)read:(NXTypedStream*)stream { [super read:stream]; [self tc1DestroyData]; [self tc1FreeData]; unsigned int x; int ver = NXTypedStreamClassVersion( stream, [[MiscTableCell class] name] ); owner = NXReadObject( stream ); if (ver == MISC_TC_VERSION_0) { NXReadType( stream, @encode(unsigned int), &x ); if (x & MISC_TC1_HAS_TAG) NXReadType( stream, @encode(int), &tag ); else tag = 0; } else if (ver == MISC_TC_VERSION_1) { NXReadType( stream, @encode(int), &tag ); NXReadType( stream, @encode(unsigned int), &x ); } else [self error:"Cannot read: unknown version."]; if (x & MISC_TC1_SELF_TEXT_COLOR) { NXColor c = NXReadColor( stream ); [self setTextColor:c]; } if (x & MISC_TC1_SELF_BACKGROUND_COLOR) { NXColor c = NXReadColor( stream ); [self setBackgroundColor:c]; } if (x & MISC_TC1_SELF_TEXT_COLOR_H) { NXColor c = NXReadColor( stream ); [self setHighlightTextColor:c]; } if (x & MISC_TC1_SELF_BACKGROUND_COLOR_H) { NXColor c = NXReadColor( stream ); [self setHighlightBackgroundColor:c]; } return self; } //----------------------------------------------------------------------------- // write: //----------------------------------------------------------------------------- - (id)write:(NXTypedStream*)stream { [super write:stream]; NXWriteObjectReference( stream, owner ); NXWriteType( stream, @encode(int), &tag ); NXWriteType( stream, @encode(unsigned int), &tc1_flags ); if (![self useOwnerTextColor]) NXWriteColor( stream, [self textColor] ); if (![self useOwnerBackgroundColor]) NXWriteColor( stream, [self backgroundColor] ); if (![self useOwnerHighlightTextColor]) NXWriteColor( stream, [self highlightTextColor] ); if (![self useOwnerHighlightBackgroundColor]) NXWriteColor( stream, [self highlightBackgroundColor] ); return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableViewPS.psw100444 1750 1750 3361 6757716167 22742 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPS.psw // // Fill rectangles with a "dash" pattern. Useful for drawing dotted // outlines which frame focused cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // MISC_TV_initps //----------------------------------------------------------------------------- defineps MISC_TV_initps() 7 dict dup begin /PatternType 1 def /PaintType 1 def /TilingType 1 def /BBox [0 0 2 2] def /XStep 2 def /YStep 2 def /PaintProc { begin 0 setgray 0 0 1 1 rectfill 1 1 1 1 rectfill end } def end matrix makepattern userdict exch /MISC_TV_dottedpattern exch put endps //----------------------------------------------------------------------------- // MISC_TV_dashedrects //----------------------------------------------------------------------------- defineps MISC_TV_dashedrects( float rects[n]; int n ) gsave MISC_TV_dottedpattern setpattern rects rectfill grestore endps MiscKit/Palettes/MiscTableScroll/MiscTableBorderSel.cc100444 1750 1750 12220 6757716167 23234 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorderSel.cc // // Selection management methods for the MiscTableBorder class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorderSel.cc,v 1.3 99/06/29 07:39:06 sunshine Exp $ // $Log: MiscTableBorderSel.cc,v $ // Revision 1.3 99/06/29 07:39:06 sunshine // v140: Ported back to NextStep 3.2. Compiler complained about signed vs. // unsigned comparisons. // // Revision 1.2 97/11/16 17:54:35 zarnuk // v132: Renamed. // // Revision 1.1 97/11/14 20:34:41 zarnuk // v130: selection management routines for MiscTableBorder. //----------------------------------------------------------------------------- #include "MiscTableBorder.h" #include //----------------------------------------------------------------------------- // visualToPhysical // Used to save the selection before sorting. //----------------------------------------------------------------------------- void MiscTableBorder::visualToPhysical( MiscSparseSet const& vset, MiscSparseSet& pset ) const { pset.empty(); unsigned int const lim = vset.numRanges(); for (unsigned int i = 0; i < lim; i++) { int lo, hi; vset.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) pset.add( visualToPhysical( lo ) ); } } //----------------------------------------------------------------------------- // physicalToVisual // Used to restore the selection after sorting. //----------------------------------------------------------------------------- void MiscTableBorder::physicalToVisual( MiscSparseSet const& pset, MiscSparseSet& vset ) const { vset.empty(); unsigned int const lim = pset.numRanges(); for (unsigned int i = 0; i < lim; i++) { int lo, hi; pset.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) vset.add( physicalToVisual( lo ) ); } } //----------------------------------------------------------------------------- // hasMultipleSelection //----------------------------------------------------------------------------- bool MiscTableBorder::hasMultipleSelection() const { MiscCoord_V lo, hi; selection.getTotalRange( lo, hi ); return hi > lo; } //----------------------------------------------------------------------------- // selected_slots //----------------------------------------------------------------------------- void MiscTableBorder::selected_slots( MiscIntList* list, bool do_tags ) const { [list empty]; for (unsigned int i = 0, lim = selection.numRanges(); i < lim; i++) { MiscCoord_V lo, hi; selection.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) [list addInt: (do_tags ? getTag(lo) : visualToPhysical(lo))]; } } //----------------------------------------------------------------------------- // select_slots //----------------------------------------------------------------------------- void MiscTableBorder::select_slots( MiscIntList* list, bool clear, bool set ) { if (clear) selectNone(); int const lim = [list count]; if (lim > 0) { MiscCoord_V last_selected = -1; for (int i = lim; i-- > 0; ) { MiscCoord_P const p_slot = [list intAt:i]; if (goodPos( p_slot )) { MiscCoord_V const v_slot = physicalToVisual( p_slot ); if (v_slot > last_selected) last_selected = v_slot; if (set) selection.add( v_slot ); else selection.remove( v_slot ); } } if (set && last_selected != -1) setSelectedSlot( last_selected ); else fixSelectedSlot(); } } //----------------------------------------------------------------------------- // select_tags //----------------------------------------------------------------------------- void MiscTableBorder::select_tags( MiscIntList* list, bool clear, bool set ) { if (clear) selectNone(); unsigned int const M = [list count]; if (M > 0) { MiscCoord_V last_selected = -1; int const* const v0 = [list rawData]; int const* const vM = v0 + M; unsigned int const N = count(); for (unsigned int i = 0; i < N; i++) { int const t = getTag(i); // MiscCoord_V for (int const* v = v0; v < vM; v++) if (*v == t) { if (int(i) > last_selected) last_selected = (MiscCoord_V)i; if (set) selection.add(i); else selection.remove(i); break; } } if (set && last_selected != -1) setSelectedSlot( last_selected ); else fixSelectedSlot(); } } MiscKit/Palettes/MiscTableScroll/MiscTableConnector.strings100444 1750 1750 1045 6757716170 24366 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableConnector.strings // // Describes which outlet names have "action" variables associated with // them. This tells the MiscTableConnector and MiscTableConnInspector // classes which outlets should be handled like the "target" outlets are // handled by the standard IB connection inspector. // //----------------------------------------------------------------------------- { target = "action"; doubleTarget = "doubleAction"; } MiscKit/Palettes/MiscTableScroll/MiscTableConnInspector.M100444 1750 1750 60270 6757716155 23753 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnInspector.M // // A custom Interface Builder connection inspector so that the // doubleTarget and doubleAction can be set. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnInspector.M,v 1.6 96/08/30 15:09:37 sunshine Exp $ // $Log: MiscTableConnInspector.M,v $ // Revision 1.6 96/08/30 15:09:37 sunshine // Added missing (void) to -initScroll:numCols:. // // Revision 1.5 96/05/05 11:11:34 sunshine // Fixed bug: Was leaking connector object when breaking connections. // Fixed bug: Was allowing non-target/action connection to FirstResponder. // Fixed bug: Was not treating FirstResponder as a special case (and setting // "destination" to 0 when appropriate so archiving would crash with // "IBFirstResponder does not respond to -write:". Now handles FirstResponder // specially. // // Revision 1.4 96/05/02 18:10:57 zarnuk // No longer preselects an action if there is no pre-existing connection. // Cleaned up the init stuff a little bit. //----------------------------------------------------------------------------- #if defined(NX_COMPILER_RELEASE_3_3) // 3.3+ only. Not available for 3.2- #import "MiscTableConnInspector.h" #import "MiscTableConnector.h" #import extern "Objective-C" { #import #import #import #import #import } enum MiscTSOutletSlot { MISC_TS_NAME_OS, MISC_TS_CONN_OS, MISC_TS_PTR_OS }; enum MiscTSActionSlot { MISC_TS_NAME_AS, MISC_TS_CONN_AS }; static char const ICON_DIMPLE[] = "MiscTableDimple"; static char const ICON_ARROW [] = "MiscTableRightArrow"; static char const ICON_BLANK [] = "MiscBlankImage"; static NXImage* IMAGE_DIMPLE; static NXImage* IMAGE_ARROW; static NXImage* IMAGE_BLANK; static NSString* OUTLET_ACTION_FILE = @"MiscTableConnector"; static NSDictionary* OUTLET_ACTION_DICT = 0; static id FIRST_RESP = (id)~0; static NSString* FIRST_RESP_NAME = @"FirstResponder"; //============================================================================= // PRIVATE IB METHODS //============================================================================= @interface Object(MISC_TS_IB) - getIBClassName; // (NSString) - getIBPrintName; // (NSString) @end @interface IBDocument: Object - getDataFor:obj; - objectData; // (IBClassData) - classData; // (IBClassData) - controlConnectorForSource:obj; - connectorForSource:obj outlet:name; @end @interface IBClassData: Object - getOutletsOf:obj; - getActionsOf:obj; - getOutletsOf:obj deep:(BOOL)deep; - getActionsOf:obj deep:(BOOL)deep; @end //============================================================================= // CATEGORIES OF PRIVATE IB CONNECTION CLASSES //============================================================================= @interface IBConnector(MiscTableScroll) - (NSString*) outletName; - (NSString*) actionName; - (NSString*) actionValue; @end @interface IBControlConnector(MiscTableScroll) - (NSString*) outletName; - (NSString*) actionName; - (NSString*) actionValue; @end @implementation IBConnector(MiscTableConnector) - (NSString*) outletName { return [self label]; } - (NSString*) actionName { return 0; } - (NSString*) actionValue { return 0; } @end @implementation IBControlConnector(MiscTableConnector) - (NSString*) outletName { NSString* s = @"target"; return s; } - (NSString*) actionName { NSString* s = @"action"; return s; } - (NSString*) actionValue { return [self label]; } @end //============================================================================= // TABLE SCROLL CATEGORY //============================================================================= @interface MiscTableScroll(IBconnect) - (char const*) getConnectInspectorClassName; @end @implementation MiscTableScroll(IBconnect) - (char const*) getConnectInspectorClassName { return "MiscTableConnInspector"; } @end //============================================================================= // TABLE CONNECTOR CATEGORY //============================================================================= @interface MiscTableConnector(IB) - (NSString*) outletName; - (NSString*) actionName; - initSource:src destination:dst label:lbl outlet:out action:act; - setLabel:lbl; - write:(NXTypedStream*)stream; - getIBPrintName; @end @implementation MiscTableConnector(IB) - (NSString*) outletName { return [NSString stringWithCString:outletName]; } - (NSString*) actionName { return [NSString stringWithCString:actionName]; } - initSource:src destination:dst label:lbl outlet:out action:act { [super initSource:src destination:dst label:lbl]; outletName = 0; actionName = 0; selectorName = 0; [self clone:[out cString] into:&outletName]; [self clone:[act cString] into:&actionName]; [self clone:[lbl cString] into:&selectorName]; return self; } - setLabel:lbl { [self clone:[lbl cString] into:&selectorName]; return [super setLabel:lbl]; } - write:(NXTypedStream*)stream { [super write:stream]; NXWriteType( stream, @encode(char*), &outletName ); NXWriteType( stream, @encode(char*), &actionName ); NXWriteType( stream, @encode(char*), &selectorName ); return self; } - getIBPrintName { return [NSString stringWithFormat: @"%@/%@", [self outletName], [self actionValue] ]; } @end //============================================================================= // TABLE CONNECTOR INSPECTOR IMPLEMENTATION //============================================================================= @implementation MiscTableConnInspector //----------------------------------------------------------------------------- // +initialize //----------------------------------------------------------------------------- + initialize { char path[ MAXPATHLEN + 1 ]; NXBundle* bundle = [NXBundle bundleForClass:self]; [bundle getPath:path forResource:ICON_DIMPLE ofType:"tiff"]; IMAGE_DIMPLE = [[NXImage alloc] initFromFile:path]; [IMAGE_DIMPLE setName:ICON_DIMPLE]; [bundle getPath:path forResource:ICON_ARROW ofType:"tiff"]; IMAGE_ARROW = [[NXImage alloc] initFromFile:path]; [IMAGE_ARROW setName:ICON_ARROW]; IMAGE_BLANK = [[NXImage alloc] init]; [IMAGE_BLANK setName:ICON_BLANK]; NSBundle* nsbundle = [NSBundle bundleForClass:self]; NSString* s = [nsbundle pathForResource:OUTLET_ACTION_FILE ofType:@".strings"]; OUTLET_ACTION_DICT = [[NSDictionary alloc] initWithContentsOfFile:s]; return self; } //----------------------------------------------------------------------------- // +actionForOutlet: //----------------------------------------------------------------------------- + (NSString*) actionForOutlet:(NSString*)name { return [OUTLET_ACTION_DICT objectForKey:name]; } //----------------------------------------------------------------------------- // -actionForOutlet: //----------------------------------------------------------------------------- - (NSString*) actionForOutlet:(NSString*)name { return [OUTLET_ACTION_DICT objectForKey:name]; } //----------------------------------------------------------------------------- // -free //----------------------------------------------------------------------------- - free { [connList free]; [curout release]; return [super free]; } //----------------------------------------------------------------------------- // -initScroll:numCols: //----------------------------------------------------------------------------- - (void) initScroll: (MiscTableScroll*) scroll numCols:(int)numCols { [scroll setAutoSortRows:YES]; [scroll setSelectionMode:MISC_RADIO_MODE]; [scroll setDelegate:self]; [scroll setTarget:self]; [scroll setDoubleTarget:self]; for (int i = 0; i < numCols; i++) [scroll addCol]; } //----------------------------------------------------------------------------- // -init //----------------------------------------------------------------------------- - init { [super init]; connList = [[List alloc] init]; char buf[ MAXPATHLEN + 1 ]; NXBundle* bundle = [NXBundle bundleForClass: [self class]]; [bundle getPath:buf forResource:[[self class] name] ofType:"nib"]; [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]]; [self initScroll:outletScroll numCols:3]; [outletScroll setAction:@selector(outletClick:)]; [outletScroll setDoubleAction:@selector(outletDblClick:)]; [outletScroll setCol:MISC_TS_NAME_OS size:83]; [outletScroll setCol:MISC_TS_NAME_OS title:"Outlets"]; [outletScroll setCol:MISC_TS_CONN_OS size:13]; [outletScroll setCol:MISC_TS_CONN_OS sizeable:NO]; [outletScroll setCol:MISC_TS_CONN_OS cellType:MISC_TABLE_CELL_ICON]; [outletScroll setCol:MISC_TS_CONN_OS sortType:MISC_SORT_TAG]; [outletScroll setCol:MISC_TS_PTR_OS size:13]; [outletScroll setCol:MISC_TS_PTR_OS sizeable:NO]; [outletScroll setCol:MISC_TS_PTR_OS cellType:MISC_TABLE_CELL_ICON]; [outletScroll setCol:MISC_TS_PTR_OS sortType:MISC_SORT_TAG]; [outletScroll setCol:MISC_TS_PTR_OS sortDirection:MISC_SORT_DESCENDING]; [self initScroll:actionScroll numCols:2]; [actionScroll setAction:@selector(actionClick:)]; [actionScroll setDoubleAction:@selector(actionDblClick:)]; [actionScroll setCol:MISC_TS_NAME_AS size:96]; [actionScroll setCol:MISC_TS_NAME_AS title:"Actions"]; [actionScroll setCol:MISC_TS_CONN_AS size:13]; [actionScroll setCol:MISC_TS_CONN_AS sizeable:NO]; [actionScroll setCol:MISC_TS_CONN_AS cellType:MISC_TABLE_CELL_ICON]; [actionScroll setCol:MISC_TS_CONN_AS sortType:MISC_SORT_TAG]; [actionScroll setCol:MISC_TS_CONN_AS sortDirection:MISC_SORT_DESCENDING]; [outletScroll setNextText:actionScroll]; [actionScroll setNextText:outletScroll]; return self; } //----------------------------------------------------------------------------- // -getConnList //----------------------------------------------------------------------------- - (void) getConnList { [[NXApp activeDocument] listConnectors:connList forSource:object]; } //----------------------------------------------------------------------------- // -findConnectionForOutlet: // Note: this method is only accurate when connList is valid. //----------------------------------------------------------------------------- - findConnectionForOutlet:(NSString*) outletName { unsigned int const lim = [connList count]; for (unsigned int i = 0; i < lim; i++) { id conn = [connList objectAt:i]; if ([outletName isEqualToString:[conn outletName]]) return conn; } return 0; } //----------------------------------------------------------------------------- // -connectionForOutlet: //----------------------------------------------------------------------------- - connectionForOutlet:(NSString*) outletName { [self getConnList]; return [self findConnectionForOutlet:outletName]; } //----------------------------------------------------------------------------- // virtualDestFor: //----------------------------------------------------------------------------- - virtualDestFor:dest { if (dest == 0 || [[dest getIBClassName] isEqualToString:FIRST_RESP_NAME]) return FIRST_RESP; return dest; } //----------------------------------------------------------------------------- // realDestFor: //----------------------------------------------------------------------------- - realDestFor:dest { return (dest == FIRST_RESP ? 0 : dest); } //----------------------------------------------------------------------------- // -set:outlet: // Note: this method is only accurate when connList is valid. //----------------------------------------------------------------------------- - (void) set:(int)row outlet:(NSString*)name { id conn = [self findConnectionForOutlet:name]; id dest = (conn == 0 ? 0 : [self virtualDestFor:[conn destination]]); [outletScroll setRow:row tag:int(dest)]; [[outletScroll cellAt:row:MISC_TS_NAME_OS] setStringValue:[name cString]]; BOOL const is_connected = (conn != 0); [[[outletScroll cellAt:row:MISC_TS_CONN_OS] setImage: (is_connected ? IMAGE_DIMPLE : IMAGE_BLANK)] setTag: int(is_connected)]; BOOL const has_action = ([self actionForOutlet:name] != 0); [[[outletScroll cellAt:row:MISC_TS_PTR_OS] setImage: (has_action ? IMAGE_ARROW : IMAGE_BLANK)] setTag: int(has_action)]; } //----------------------------------------------------------------------------- // -loadOutlets // Note: this method is only accurate when connList is valid. // // Note: For some silly reason, the -getOutletsOf:deep: method filters // out the "target" outlet. (Who knows why -- must be more hardcoded // internal IB junk.) Therefore, we need to add it back in, manually. //----------------------------------------------------------------------------- - (void) loadOutlets { NSArray* list = [[[NXApp activeDocument] classData] getOutletsOf:[object getIBClassName]]; [outletScroll setAutodisplay:NO]; unsigned int const lim = [list count]; if (lim > 0) { [outletScroll renewRows:lim+1]; // Add one for target. for (int i = 0; i < lim; i++) [self set:i outlet:[list objectAtIndex:i]]; [self set:lim outlet:@"target"]; [outletScroll sortRows]; } else [outletScroll empty]; [outletScroll setAutodisplay:YES]; } //----------------------------------------------------------------------------- // -selectedOutletName //----------------------------------------------------------------------------- - (NSString*) selectedOutletName { NSString* s = 0; int const r = [outletScroll selectedRow]; if (r >= 0) { char const* const t = [outletScroll stringValueAt:r:MISC_TS_NAME_OS]; s = [NSString stringWithCString:t]; } return s; } //----------------------------------------------------------------------------- // -shouldShowActions: //----------------------------------------------------------------------------- - (BOOL) shouldShowActions:(id*)old_dest { int const r = [outletScroll selectedRow]; if (r >= 0 && [outletScroll tagAt:r:MISC_TS_PTR_OS] != 0) { *old_dest = (id)[outletScroll rowTag:r]; return YES; } return NO; } //----------------------------------------------------------------------------- // -loadActions //----------------------------------------------------------------------------- - (void) loadActions { [actionScroll setAutodisplay:NO]; [actionScroll empty]; id old_dest = 0; if ([self shouldShowActions:&old_dest]) { int sel_row = -1; id dest = (curdst != 0 ? curdst : old_dest); if (dest == 0 && [NXApp isConnecting]) dest = [self virtualDestFor:[NXApp connectDestination]]; if (dest != 0) { id doc = [NXApp activeDocument]; NSString* lbl = 0; if (dest == old_dest) { NSString* oname = [self selectedOutletName]; id conn = [self connectionForOutlet:oname]; if (conn != 0) lbl = [conn label]; } NSString* className = (dest == FIRST_RESP ? FIRST_RESP_NAME : [dest getIBClassName]); NSArray* list = [[doc classData] getActionsOf:className deep:YES]; unsigned int const lim = [list count]; [actionScroll renewRows:lim]; for (unsigned int i = 0; i < lim; i++) { NSString* s = (NSString*) [list objectAtIndex:i]; [[actionScroll cellAt:i:MISC_TS_NAME_AS] setStringValue:[s cString]]; BOOL const connected = lbl != 0 && [lbl isEqualToString:s]; [[[actionScroll cellAt:i:MISC_TS_CONN_AS] setImage: (connected ? IMAGE_DIMPLE : IMAGE_BLANK)] setTag: int(connected)]; if (connected) sel_row = (int) i; } } if ([actionScroll numRows] > 0) { [actionScroll sortRows]; if (sel_row >= 0) { [actionScroll selectRow:sel_row]; [actionScroll scrollRowToVisible:sel_row]; } } } [actionScroll setAutodisplay:YES]; } //----------------------------------------------------------------------------- // -selectOutlet: //----------------------------------------------------------------------------- - (void) selectOutlet:(char const*)name { int row = -1; if (name != 0) { int const lim = [outletScroll numRows]; for (int i = 0; i < lim; i++) { int const j = [outletScroll rowAtPosition:i]; char const* t = [outletScroll stringValueAt:j:MISC_TS_NAME_OS]; if (t != 0 && strcmp( t, name ) == 0) { row = j; break; } } } BOOL const was_auto = [outletScroll isAutodisplay]; [outletScroll setAutodisplay:NO]; [outletScroll selectRow:row]; if (row >= 0) [outletScroll scrollRowToVisible:row]; [self loadActions]; [outletScroll setAutodisplay:was_auto]; } //----------------------------------------------------------------------------- // -setCurout: //----------------------------------------------------------------------------- - (void) setCurout:(NSString*)newout { [curout autorelease]; curout = newout; [curout retain]; } //----------------------------------------------------------------------------- // -outletClick: //----------------------------------------------------------------------------- - outletClick:sender { [window disableFlushWindow]; int const r = [outletScroll selectedRow]; if (r >= 0) { char const* const t = [outletScroll stringValueAt:r:MISC_TS_NAME_OS]; NSString* s = [NSString stringWithCString:t]; cursrc = object; [self setCurout:s]; id conn = [self connectionForOutlet:s]; if (conn != 0) { id dst = [conn destination]; curdst = [self virtualDestFor:dst]; [NXApp displayConnectionBetween:[conn source] and:dst]; } else curdst = 0; } [self loadActions]; [[window reenableFlushWindow] flushWindow]; return self; } //----------------------------------------------------------------------------- // -outletDblClick: // NOTE *1* The only action allowed on the outlet column for // target/action style outlets is breaking "old" connections that // do not have an action set. //----------------------------------------------------------------------------- - outletDblClick:sender { int const r = [outletScroll selectedRow]; if (r >= 0) { [window disableFlushWindow]; id old_dest = 0; id new_dest = 0; id doc = [NXApp activeDocument]; char const* const t = [outletScroll stringValueAt:r:MISC_TS_NAME_OS]; NSString* outletName = [NSString stringWithCString:t]; id conn = [self connectionForOutlet:outletName]; BOOL do_break = NO; BOOL do_make = NO; BOOL const has_action = (BOOL) [outletScroll tagAt:r:MISC_TS_PTR_OS]; if (has_action) { do_break = (conn != 0 && [conn actionName] == 0); // NOTE *1* } else { do_break = (conn != 0); old_dest = [self virtualDestFor:[conn destination]]; new_dest = [self virtualDestFor:[NXApp connectDestination]]; do_make = (new_dest != FIRST_RESP && new_dest != old_dest); } if (do_break) { [doc removeConnector:conn]; [conn free]; } if (do_make) { conn = [[IBOutletConnector alloc] initSource:object destination:[self realDestFor:new_dest] label:outletName]; [doc addConnector:conn]; } if (do_break || do_make) [self ok:0]; [[window reenableFlushWindow] flushWindow]; } return self; } //----------------------------------------------------------------------------- // -actionClick: //----------------------------------------------------------------------------- - actionClick:sender { return self; } //----------------------------------------------------------------------------- // -actionDblClick: // *1* FIXME: Stop this cycle of stupidity! If we can get a better, // more generic subclass to work, that accepts the name of the outlet, // the name of the action-variable as part of the constructor, then we // should do that. //----------------------------------------------------------------------------- - actionDblClick:sender { int const r = [actionScroll selectedRow]; if (r >= 0) { [window disableFlushWindow]; id doc = [NXApp activeDocument]; id dest = [self virtualDestFor:[NXApp connectDestination]]; NSString* outletName = [self selectedOutletName]; id conn = [self connectionForOutlet:outletName]; if (conn != 0) { [doc removeConnector:conn]; [conn free]; } int const tag = [actionScroll tagAt:r:MISC_TS_CONN_AS]; if (tag == 0) { char const* t = [actionScroll stringValueAt:r:MISC_TS_NAME_AS]; NSString* s = [NSString stringWithCString:t]; id realDest = [self realDestFor:dest]; if ([outletName isEqualToString:@"target"]) { conn = [[IBControlConnector alloc] initSource:object destination:realDest label:s]; } else { conn = [[MiscTableConnector alloc] initSource:object destination:realDest label:s outlet:outletName action:[self actionForOutlet:outletName]]; } if (conn != 0) { [self setCurout:outletName]; [doc addConnector:conn]; } } [self ok:0]; [[window reenableFlushWindow] flushWindow]; } return self; } //----------------------------------------------------------------------------- // findRowWithTag // Find the first row (in visual-order) with the given tag. //----------------------------------------------------------------------------- static int findRowWithTag( MiscTableScroll* scroll, int tag ) { unsigned int const lim = [scroll numRows]; for (unsigned int i = 0; i < lim; i++) { int const r = [scroll rowAtPosition:i]; if ([scroll rowTag:r] == tag) return r; } return -1; } //----------------------------------------------------------------------------- // -preselectOutlet //----------------------------------------------------------------------------- - (NSString*) preselectOutlet { int row = findRowWithTag( outletScroll, int(curdst) ); if (row < 0) { row = findRowWithTag( outletScroll, 0 ); if (row < 0) row = 0; } char const* const s = [outletScroll stringValueAt:row:MISC_TS_NAME_OS]; return [NSString stringWithCString:s]; } //----------------------------------------------------------------------------- // -preselect //----------------------------------------------------------------------------- - (void) preselect { if ([outletScroll numRows] > 0) { id oldsrc = cursrc; id olddst = curdst; if ([NXApp isConnecting]) { cursrc = [NXApp connectSource]; curdst = [self virtualDestFor:[NXApp connectDestination]]; } else { cursrc = object; curdst = 0; } if (oldsrc != cursrc || olddst != curdst) [self setCurout:[self preselectOutlet]]; char const* const t = [curout cString]; [self selectOutlet:t]; } } //----------------------------------------------------------------------------- // -revert: //----------------------------------------------------------------------------- - revert:sender { [window disableDisplay]; [super revert:sender]; [self getConnList]; [self loadOutlets]; [self loadActions]; [self preselect]; [[window reenableDisplay] display]; return self; } //----------------------------------------------------------------------------- // -ok: //----------------------------------------------------------------------------- - ok:sender { [super ok:sender]; [self revert:0]; return self; } //----------------------------------------------------------------------------- // -wantsButtons //----------------------------------------------------------------------------- - (BOOL) wantsButtons { return NO; } @end #endif // defined(NX_COMPILER_RELEASE_3_3) MiscKit/Palettes/MiscTableScroll/MiscTableConnInspector.h100444 1750 1750 3536 6757716155 23770 0ustar sunshinesunshine#ifndef __MiscTableConnInspector_h #define __MiscTableConnInspector_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnInspector.h // // A custom Interface Builder connection inspector so that the // doubleTarget and doubleAction can be set. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnInspector.h,v 1.1 96/04/20 01:35:40 zarnuk Exp $ // $Log: MiscTableConnInspector.h,v $ // Revision 1.1 96/04/20 01:35:40 zarnuk // Custom IB connection inspector that supports target/action style // connections for doubleTarget/doubleAction and other such pairs. // //----------------------------------------------------------------------------- #if defined(NX_COMPILER_RELEASE_3_3) extern "Objective-C" { #import } @class MiscTableScroll, List; @interface MiscTableConnInspector:IBInspector { MiscTableScroll* outletScroll; MiscTableScroll* actionScroll; List* connList; id cursrc; id curdst; id curout; } @end #endif // defined(NX_COMPILER_RELEASE_3_3) #endif // __MiscTableConnInspector_h MiscKit/Palettes/MiscTableScroll/MiscTableConnector.M100444 1750 1750 10022 6757716156 23110 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnector.M // // A custom sublcass of the internal Interface Builder // IBControlConnector class that works for doubleTarget / doubleAction. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnector.M,v 1.2 96/04/23 02:32:48 sunshine Exp $ // $Log: MiscTableConnector.M,v $ // Revision 1.2 96/04/23 02:32:48 sunshine // Removed all of the NEXTSTEP 3.3 Foundation Kit specific code. Now default // implementation only contains enough methods to reestablish connections at // nib load time. This is necessary in order for these nibs to be loadable // on 3.2 machines (into applications, but *not* IB). // // Revision 1.1 96/04/20 01:34:26 zarnuk // Custom IB connector that handles target/action style pairs. //----------------------------------------------------------------------------- #import "MiscTableConnector.h" @interface Object(MiscTableConnector) - nibInstantiate; @end @implementation MiscTableConnector //----------------------------------------------------------------------------- // freeString: //----------------------------------------------------------------------------- - (void) freeString:(char*)str { if (str != 0) NXZoneFree( [self zone], str ); } //----------------------------------------------------------------------------- // clone:into: //----------------------------------------------------------------------------- - (void) clone:(char const*)str into:(char**)p { [self freeString: *p]; if (str != 0) { *p = (char*)NXZoneMalloc( [self zone], strlen(str) + 1 ); strcpy( *p, str ); } else { *p = 0; } } //----------------------------------------------------------------------------- // -free //----------------------------------------------------------------------------- - free { [self freeString:outletName]; [self freeString:actionName]; [self freeString:selectorName]; return [super free]; } //----------------------------------------------------------------------------- // -readString:into: //----------------------------------------------------------------------------- - (void) readString:(NXTypedStream*)stream into:(char**)var { char* s; NXReadType( stream, @encode(char*), &s ); *var = 0; [self clone:s into:var]; if (s != 0) free(s); } //----------------------------------------------------------------------------- // -read: //----------------------------------------------------------------------------- - read:(NXTypedStream*)stream { [super read:stream]; [self readString:stream into:&outletName]; [self readString:stream into:&actionName]; [self readString:stream into:&selectorName]; return self; } //----------------------------------------------------------------------------- // -establishConnection //----------------------------------------------------------------------------- - establishConnection { if (source != 0 && destination != 0 && outletName != 0) { object_setInstanceVariable( source, outletName, destination ); if (actionName != 0 && selectorName != 0) { SEL aSel = sel_getUid( selectorName ); if (aSel != 0) object_setInstanceVariable( source, actionName, aSel ); } } return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableConnector.h100444 1750 1750 4252 6757716156 23133 0ustar sunshinesunshine#ifndef __MiscTableConnector_h #define __MiscTableConnector_h //============================================================================= // // Copyright (C) 1996,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnector.h // // A custom subclass of the internal Interface Builder // IBControlConnector class that works for doubleTarget / doubleAction. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnector.h,v 1.3 99/06/29 07:40:18 sunshine Exp $ // $Log: MiscTableConnector.h,v $ // Revision 1.3 99/06/29 07:40:18 sunshine // v140: No longer includes since the included // IBConnector.h now does so. // // Revision 1.2 96/04/23 02:32:33 sunshine // Removed all of the NEXTSTEP 3.3 Foundation Kit specific code. Now default // implementation only contains enough methods to reestablish connections at // nib load time. This is necessary in order for these nibs to be loadable // on 3.2 machines (into applications, but *not* IB). //----------------------------------------------------------------------------- #import "IBConnector.h" @interface MiscTableConnector:IBControlConnector { char* outletName; // Name of "target" outlet. char* actionName; // Name of "action" variable. char* selectorName; // Name of selector sent to "target". } - (id)free; - (id)read:(NXTypedStream*)stream; - (id)establishConnection; - (void)clone:(char const*)s into:(char**)p; - (void)freeString:(char*)s; @end #endif // __MiscTableConnector_h MiscKit/Palettes/MiscTableScroll/MiscTableScroll.M100444 1750 1750 151174 6757716156 22452 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScroll.M // // ScrollView class that displays a 2-D table of cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScroll.M,v 1.40 99/06/29 07:46:35 sunshine Exp $ // $Log: MiscTableScroll.M,v $ // Revision 1.40 99/06/29 07:46:35 sunshine // v140: Added -didBecomeFirstResponder & -didResignFirstResponder. These // are sent by MiscTableView to MiscTableScroll at appropriate times. When // becoming first responder, -didBecomeFirstResponder notifies FontManager of // these current font setting and sends the did-become-first-responder // delegate message. -didResignFirstResponder sends the did-resign-first- // responder delegate message. // Added new delegate messages -tableScrollDidBecomeFirstResponder: and // -tableScrollDidResignFirstResponder:. // Fixed bug: -sizeToFit as not taking intercell grid spacing into account. // Fixed bug: -changeFont: was sending -convertFont: directly to the shared // FontManager rather than the "sender" as documented. // // Revision 1.39 98/03/24 04:50:22 sunshine // v138: Removed unused/junk -calcWidths:heights:maxW:maxH:. // Removed useless 'if' from -borderSetSlotOrder:. // Fixed bug: Wasn't checking -canDraw before applying -lockFocus in: // -drawCellAt::, -drawRow:, -drawCol:, -drawSlotTitle:. // // Revision 1.38 98/02/25 13:46:45 zarnuk // v137: border:setSlotOrder: now accepts a null pointer for // the list argument to "unsort" the slots. //----------------------------------------------------------------------------- #import #import #import #import "MiscColView.h" #import "MiscCornerView.h" #import "MiscRowView.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import extern "Objective-C" { #import #import #import #import #import #import } extern "C" { #import #import } typedef MiscDelegateFlags DF; @implementation MiscTableScroll - (int)tag { return tag; } - (id)setTag:(int)x { tag = x; return self; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (self == [MiscTableScroll class]) [self setVersion: MISC_TS_VERSION]; return self; } //----------------------------------------------------------------------------- // Multicast Messages //----------------------------------------------------------------------------- - (id)sendAction:(SEL)aSel to:(id)obj forAllCells:(BOOL)flag { int const rlim = num_rows; int const clim = num_cols; for (int r = 0; r < rlim; r++) for (int c = 0; c < clim; c++) if (flag || [self cellIsSelected:r:c]) if (![obj perform:aSel with:[self cellAt:r:c]]) return self; return self; } - (int)makeCellsPerform:(SEL)s with:(id)p1 with:(id)p2 selectedOnly:(BOOL)f { int count = 0; int const rlim = num_rows; int const clim = num_cols; for (int r = 0; r < rlim; r++) for (int c = 0; c < clim; c++) if (!f || [self cellIsSelected:r:c]) { id cell = [self cellAt:r:c]; if ([cell respondsTo:s]) if ([cell perform:s with:p1 with:p2]) count++; else return count; } return count; } - (int)makeCellsPerform:(SEL)aSel with:(id)p1 selectedOnly:(BOOL)flag { return [self makeCellsPerform:aSel with:p1 with:0 selectedOnly:flag]; } - (int)makeCellsPerform:(SEL)aSel selectedOnly:(BOOL)flag { return [self makeCellsPerform:aSel with:0 with:0 selectedOnly:flag]; } - (int)makeCellsPerform:(SEL)aSel { return [self makeCellsPerform:aSel selectedOnly:NO]; } - (int)makeCellsPerform:(SEL)aSel with:(id)p1 { return [self makeCellsPerform:aSel with:p1 selectedOnly:NO]; } - (int)makeCellsPerform:(SEL)aSel with:(id)p1 with:(id)p2 { return [self makeCellsPerform:aSel with:p1 with:p2 selectedOnly:NO];} //----------------------------------------------------------------------------- // FINDING CELLS //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b findSlotWithTag:(int)x { int const lim = (int) [self numSlots:b]; for (int i = 0; i < lim; i++) if ([self border:b slotTag:i] == x) return i; return -1; } - (int)findColWithTag:(int)x { return [self border:MISC_COL_BORDER findSlotWithTag:x]; } - (int)findRowWithTag:(int)x { return [self border:MISC_ROW_BORDER findSlotWithTag:x]; } - (id)findCell:(id)cell row:(int*)row col:(int*)col { int const NRows = [self numRows]; int const NCols = [self numCols]; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) if ([self cellAt:r:c] == cell) { *row = r; *col = c; return self; } *row = -1; *col = -1; return 0; } - (id)findCellWithTag:(int)x row:(int*)row col:(int*)col { int const NRows = [self numRows]; int const NCols = [self numCols]; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) { id const cell = [self cellAt:r:c]; if (cell && [cell respondsTo:@selector(tag)] && [cell tag] == x) { *row = r; *col = c; return cell; } } *row = -1; *col = -1; return 0; } - (id)findCellWithTag:(int)x { int r, c; return [self findCellWithTag:x row:&r col:&c]; } //----------------------------------------------------------------------------- // - getDocClipFrame: //----------------------------------------------------------------------------- - (void)getDocClipFrame:(NXRect*)rect { [contentView getFrame:rect]; } //----------------------------------------------------------------------------- // Delegate Stuff //----------------------------------------------------------------------------- - (id)delegate { return delegate; } - (id)dataDelegate { return dataDelegate; } - (id)setDelegate:(id)obj { delegate = obj; delegateFlags->setDelegate( obj ); return self; } - (id)setDataDelegate:(id)obj { dataDelegate = obj; dataDelegateFlags->setDelegate( obj ); return self; } - (id)responsibleDelegate:(DF::Selector)cmd { id del = 0; if (delegate != 0 && delegateFlags->respondsTo(cmd)) del = delegate; else if (dataDelegate != 0 && dataDelegateFlags->respondsTo(cmd)) del = dataDelegate; return del; } //----------------------------------------------------------------------------- // - freeBorder: //----------------------------------------------------------------------------- - (void)freeBorder:(MiscBorderInfo*)p { [p->view removeFromSuperview]; [p->view free]; [p->clip removeFromSuperview]; [p->clip free]; delete p->border; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { [self setAutodisplay:NO]; // Don't do any drawing! [self emptyAndFreeCells]; [self freeBorder:&colInfo]; [self freeBorder:&rowInfo]; [cornerView removeFromSuperview]; [cornerView free]; [tableView removeFromSuperview]; [tableView free]; delete delegateFlags; delete dataDelegateFlags; return [super free]; } //----------------------------------------------------------------------------- // - totalSize / totalWidth / totalHeight //----------------------------------------------------------------------------- - (NXCoord)totalSize:(MiscBorderType)b { return (NXCoord) info[b]->border->totalSize(); } - (NXCoord)totalWidth { return [self totalSize:MISC_COL_BORDER]; } - (NXCoord)totalHeight { return [self totalSize:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - constrainSize //----------------------------------------------------------------------------- - (void)constrainSize { MiscTableBorder* b; NXRect r; [self getDocClipFrame:&r]; b = colInfo.border; if (b->numSpringy() != 0) b->setMinTotalSize( (MiscPixels) r.size.width ); b = rowInfo.border; if (b->numSpringy() != 0) b->setMinTotalSize( (MiscPixels) r.size.height ); [rowInfo.view adjustSize]; [colInfo.view adjustSize]; [tableView adjustSize]; } //----------------------------------------------------------------------------- // - sizeToCells //----------------------------------------------------------------------------- - (id)sizeToCells { [self constrainSize]; return self; } //----------------------------------------------------------------------------- // set_sizes //----------------------------------------------------------------------------- static void set_sizes( MiscTableBorder* b, NXCoord const* v, NXCoord lim ) { int const n = b->count(); if (!b->isUniformSize()) { for (int i = 0; i < n; i++) { MiscPixels x = (MiscPixels) v[i]; MiscPixels const xmin = b->getMinSize_P(i); MiscPixels const xmax = b->getMaxSize_P(i); if (x < xmin) x = xmin; if (x > xmax) x = xmax; b->setSize_P( i, (MiscPixels) x ); } } else if (lim != 0) b->setUniformSize( (MiscPixels) lim ); } //----------------------------------------------------------------------------- // - sizeToFit //----------------------------------------------------------------------------- - (id)sizeToFit { NXCoord const BORDER_THICKNESS = 1; NXCoord* const vw = (NXCoord*)calloc( (num_rows + num_cols), sizeof(*vw) ); NXCoord* const vh = vw + num_cols; NXCoord max_h = 0; NXCoord max_w = 0; for (int r = 0; r < num_rows; r++) { NXCoord h = 0; for (int c = 0; c < num_cols; c++) { id const cell = [self cellAt:r:c]; if (cell != 0 && [cell respondsTo:@selector(calcCellSize:)]) { NXSize sz; [cell calcCellSize:&sz]; sz.width = ceil( sz.width + BORDER_THICKNESS ); sz.height = ceil( sz.height + BORDER_THICKNESS ); if (vw[c] < sz.width) vw[c] = sz.width; if (max_w < sz.width) max_w = sz.width; if (h < sz.height) h = sz.height; } } if (vh[r] < h) vh[r] = h; if (max_h < h) max_h = h; } set_sizes( colInfo.border, vw, max_w ); set_sizes( rowInfo.border, vh, max_h ); free( vw ); return [self sizeToCells]; } //----------------------------------------------------------------------------- // - sizeTo:: //----------------------------------------------------------------------------- - (id)sizeTo:(NXCoord)width :(NXCoord)height { [super sizeTo:width:height]; [self constrainSize]; return self; } //----------------------------------------------------------------------------- // - forwardBGColor //----------------------------------------------------------------------------- - (void)forwardBGColor { [super setBackgroundColor:backgroundColor]; [colInfo.clip setBackgroundColor:backgroundColor]; [rowInfo.clip setBackgroundColor:backgroundColor]; } //----------------------------------------------------------------------------- // - initBorder:type: //----------------------------------------------------------------------------- - (void)initBorder:(MiscBorderInfo*)p type:(MiscBorderType)type { NXRect emptyRect = {{0,0},{0,0}}; NXZone* const z = [self zone]; if (p->border == 0) p->border = new( NXZoneMalloc(z,sizeof(*(p->border))) ) MiscTableBorder( type ); p->border->setOwner( self ); if (type == MISC_COL_BORDER) p->view = [[MiscColView allocFromZone:z] initFrame:&emptyRect scroll:self info:p->border]; else p->view = [[MiscRowView allocFromZone:z] initFrame:&emptyRect scroll:self info:p->border]; p->clip = [[ClipView allocFromZone:z] initFrame:0]; [p->clip setDocView:p->view]; if (p->isOn) { [self addSubview: p->clip]; [window invalidateCursorRectsForView: p->view]; } } //----------------------------------------------------------------------------- // - doInit:cornerTitle: //----------------------------------------------------------------------------- - (void)doInit:(int)ver cornerTitle:(char const*)s { editInfo.editing = NO; tracking = NO; [window disableDisplay]; [self setBorderType: NX_BEZEL]; [super setHorizScrollerRequired: YES]; [super setVertScrollerRequired: YES]; info[ MISC_COL_BORDER ] = &colInfo; info[ MISC_ROW_BORDER ] = &rowInfo; [self initBorder:&colInfo type:MISC_COL_BORDER]; [self initBorder:&rowInfo type:MISC_ROW_BORDER]; NXZone* const z = [self zone]; delegateFlags = new( NXZoneMalloc(z,sizeof(*delegateFlags)) ) MiscDelegateFlags; dataDelegateFlags = new( NXZoneMalloc(z,sizeof(*dataDelegateFlags)) ) MiscDelegateFlags; NXRect emptyRect = {{0,0},{0,0}}; tableView = [[MiscTableView allocFromZone:z] initFrame:&emptyRect scroll:self colInfo:colInfo.border rowInfo:rowInfo.border]; cornerView = [[MiscCornerView allocFromZone:z] initFrame:&emptyRect]; [self setCornerTitle:s]; if (colInfo.isOn && rowInfo.isOn) [self addSubview:cornerView]; id oldView = [self setDocView: tableView]; [oldView free]; [self tile]; [self constrainSize]; [self forwardBGColor]; [self registerServicesTypes]; [window reenableDisplay]; } //----------------------------------------------------------------------------- // - initFrame: //----------------------------------------------------------------------------- - (id)initFrame:(NXRect const*)frameRect { [super initFrame: frameRect]; tag = 0; enabled = YES; delegate = 0; dataDelegate = 0; colInfo.border = 0; colInfo.isOn = YES; rowInfo.border = 0; rowInfo.isOn = NO; id classObj = [self class]; font = [classObj defaultFont]; textColor = [classObj defaultTextColor]; backgroundColor = [classObj defaultBackgroundColor]; highlightTextColor = [classObj defaultHighlightTextColor]; highlightBackgroundColor = [classObj defaultHighlightBackgroundColor]; [self doInit:MISC_TS_VERSION cornerTitle:0]; return self; } //----------------------------------------------------------------------------- // - setFrame: //----------------------------------------------------------------------------- - (id)setFrame:(NXRect const*)frameRect { [super setFrame:frameRect]; [self constrainSize]; return self; } //----------------------------------------------------------------------------- // - tile //----------------------------------------------------------------------------- - (id)tile { [window disableDisplay]; static View* dummy = 0; if (dummy == 0) { NXRect const r = {{0,0},{1,1}}; dummy = [[View alloc] initFrame:&r]; } View* const old = contentView; contentView = dummy; [super tile]; contentView = old; NXRect docRect; [dummy getFrame:&docRect]; if (colInfo.isOn != rowInfo.isOn) // One on, one off. { MiscBorderInfo& b = (colInfo.isOn ? colInfo : rowInfo); int const edge = (colInfo.isOn ? NX_YMIN : NX_XMIN); NXCoord height = [b.view frameHeight]; NXRect rect; NXDivideRect( &docRect, &rect, height, edge ); [b.clip setFrame: &rect]; [contentView setFrame: &docRect]; [window invalidateCursorRectsForView: b.view]; } else if (colInfo.isOn && rowInfo.isOn) // Both on. { NXCoord colHeight = [colInfo.view frameHeight]; NXCoord rowWidth = [rowInfo.view frameHeight]; NXRect gapRect; NXRect colRect; NXRect rowRect; NXDivideRect( &docRect, &colRect, colHeight, NX_YMIN ); NXDivideRect( &colRect, &gapRect, rowWidth, NX_XMIN ); NXDivideRect( &docRect, &rowRect, rowWidth, NX_XMIN ); [cornerView setFrame: &gapRect]; [colInfo.clip setFrame: &colRect]; [rowInfo.clip setFrame: &rowRect]; [contentView setFrame: &docRect]; [window invalidateCursorRectsForView: colInfo.view]; [window invalidateCursorRectsForView: rowInfo.view]; } else // Both off. { [contentView setFrame: &docRect]; } [window reenableDisplay]; return self; } //----------------------------------------------------------------------------- // - reflectScroll: //----------------------------------------------------------------------------- - (id)reflectScroll:(id)aView { if (aView == contentView) // only reflect position of contentView [super reflectScroll: aView]; return self; } //----------------------------------------------------------------------------- // - scrollClip:to: //----------------------------------------------------------------------------- - (id)scrollClip:(id)aClipView to:(NXPoint const*)aPoint { if (aClipView == contentView) // contentView only. { NXRect rect; [window disableFlushWindow]; [aClipView rawScroll: aPoint]; // Scroll content if (colInfo.isOn) { [colInfo.clip getBounds: &rect]; // Maybe scroll col headings. if (rect.origin.x != aPoint->x) { rect.origin.x = aPoint->x; [colInfo.clip rawScroll: &rect.origin]; [window invalidateCursorRectsForView: colInfo.view]; } } if (rowInfo.isOn) { [rowInfo.clip getBounds: &rect]; // Maybe scroll row labels. if (rect.origin.y != aPoint->y) { rect.origin.y = aPoint->y; [rowInfo.clip rawScroll: &rect.origin]; [window invalidateCursorRectsForView: rowInfo.view]; } } [[window reenableFlushWindow] flushWindow]; } else { BOOL ok = YES; NXRect rect; [contentView getBounds: &rect]; if (aClipView == (id)colInfo.clip) rect.origin.x = aPoint->x; else if (aClipView == (id)rowInfo.clip) rect.origin.y = aPoint->y; else ok = NO; if (ok) { [self scrollClip:contentView to:&(rect.origin)]; [self reflectScroll:contentView]; } } return self; } //----------------------------------------------------------------------------- // First Responder notifications //----------------------------------------------------------------------------- - (void)didBecomeFirstResponder { [[FontManager new] setSelFont:[self font] isMultiple:NO]; id const del = [self responsibleDelegate:DF::DEL_DID_BECOME_FIRST_RESP]; if (del != 0) [del tableScrollDidBecomeFirstResponder:self]; } - (void)didResignFirstResponder { id const del = [self responsibleDelegate:DF::DEL_DID_RESIGN_FIRST_RESP]; if (del != 0) [del tableScrollDidResignFirstResponder:self]; } //----------------------------------------------------------------------------- // Border stuff //----------------------------------------------------------------------------- - (char const*)border:(MiscBorderType)b getDelegateSlotTitle:(int)slot { id del = [self responsibleDelegate:DF::DEL_SLOT_TITLE]; if (del != 0) return [del tableScroll:self border:b slotTitle:slot]; return 0; } - (id)border:(MiscBorderType)b getDelegateSlotPrototype:(int)s { id del = [self responsibleDelegate:DF::DEL_SLOT_PROTOTYPE]; if (del != 0) return [del tableScroll:self border:b slotPrototype:s]; return 0; } - (void)border:(MiscBorderType)b slotDraggedFrom:(int)fromPos to:(int)toPos { MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) { int slot = [self border:b slotAtPosition:toPos]; if ([self border:b slotSortType:slot] != MISC_SORT_SKIP || [self border:b slotSortFunc:slot] != 0) [self sortSlots:ob]; // Don't resort if it doesn't affect ordering. } id del = [self responsibleDelegate:DF::DEL_SLOT_DRAGGED]; if (del != 0) [del tableScroll:self border:b slotDraggedFrom:fromPos to:toPos]; } - (void)border:(MiscBorderType)b slotSortReversed:(int)n { MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) [self sortSlots:ob]; // Assume it affects sorting. id del = [self responsibleDelegate:DF::DEL_SLOT_REVERSED]; if (del != 0) { int const phys = [self border:b slotAtPosition:n]; [del tableScroll:self border:b slotSortReversed:phys]; } } - (void)border:(MiscBorderType)b slotResized:(int)n { id del = [self responsibleDelegate:DF::DEL_SLOT_RESIZED]; if (del != 0) { int const phys = [self border:b slotAtPosition:n]; [del tableScroll:self border:b slotResized:phys]; } } //----------------------------------------------------------------------------- // Target / Action //----------------------------------------------------------------------------- - (id)target { return target; } - (id)setTarget:(id)obj { target = obj; return self; } - (id)doubleTarget { return doubleTarget; } - (id)setDoubleTarget:(id)obj { doubleTarget = obj; return self; } - (SEL)action { return action; } - (id)setAction:(SEL)new_sel { action = new_sel; return self; } - (id)setDoubleAction:(SEL)new_sel { doubleAction = new_sel; return self; } - (SEL)doubleAction { return doubleAction; } - (id)sendAction:(SEL)aSel to:(id)obj { if (aSel == 0) aSel = action; if (obj == 0) obj = target; return ([NXApp sendAction:aSel to:obj from:self] ? self : 0); } - (id)sendAction { return [self sendAction:action to:target]; } - (id)sendDoubleAction { return [self sendAction:doubleAction to:doubleTarget]; } - (id)sendActionIfEnabled { if ([self isEnabled]) return [self sendAction]; return 0; } - (id)sendDoubleActionIfEnabled { if ([self isEnabled]) return [self sendDoubleAction]; return 0; } //----------------------------------------------------------------------------- // FONT //----------------------------------------------------------------------------- + (Font*)defaultFont { return [Font userFontOfSize:12.0 matrix:NX_FLIPPEDMATRIX]; } - (id)font { return font; } static double get_height( Font* font ) { double const LINE_SPACING = 1.20; double const size = [font pointSize]; return size * LINE_SPACING; } - (id)setFont:(id)newFont { if (newFont != 0 && newFont != (id)font && [newFont isKindOf:[Font class]]) { [window disableDisplay]; Font* oldFont = font; font = newFont; NXCoord old_size = [self uniformSizeRows]; if (old_size != 0) { // FIXME: Handle this better. Different cell-types will have // different amounts of "fixed-size" border stuff. NXCoord const BORDER_THICKNESS = 1; old_size -= BORDER_THICKNESS; NXCoord const new_size = floor( 0.5 + (double(old_size) * (get_height( newFont ) / get_height( oldFont )))); if (new_size != old_size) [self setUniformSizeRows:(new_size + BORDER_THICKNESS)]; } // FIXME: Set font in all existing prototype cells. // WARNING: Currently, just asking the border for a prototype // in a given slot allocates and initializes an array of prototypes. if (![self isLazy]) // Eager beaver sets all cells now. { int const NRows = num_rows; int const NCols = num_cols; for (int r = 0; r < NRows; r++) { for (int c = 0; c < NCols; c++) { id cell = [self cellAt:r:c]; if (cell != 0) { if ([cell respondsTo:@selector(setOwnerFont:)]) [cell setOwnerFont:newFont]; else if ([cell respondsTo:@selector(setFont:)]) [cell setFont:newFont]; } } } } id del = [self responsibleDelegate:DF::DEL_FONT_CHANGED]; if (del != 0) [del tableScroll:self fontChangedFrom:oldFont to:newFont]; [window reenableDisplay]; [self update]; } return self; } - (id)changeFont:(id)sender { Font* newFont = [sender convertFont:[sender selFont]]; if (newFont != 0 && newFont != font) { [self suspendEditing]; [window disableDisplay]; Font* oldFont = font; [self setFont:newFont]; id del = [self responsibleDelegate:DF::DEL_CHANGE_FONT]; if (del != 0) [del tableScroll:self changeFont:oldFont to:newFont]; if (editInfo.editing) [editInfo.cell setFont:newFont]; [window reenableDisplay]; [self update]; [self resumeEditing]; } return self; } //----------------------------------------------------------------------------- // COLOR // // The following macros expand into the implementations for these functions. // Their names are listed so they can be found when searched for. // setBackgroundColor:, setTextColor:, // setHighlightBackgroundColor:, setHighlightTextColor: // setBackgroundGray:, setTextGray:, // setHighlightBackgroundGray:, setHighlightTextGray: // backgroundGray:, textGray:, highlightBackgroundGray:, highlightTextGray: //----------------------------------------------------------------------------- + (NXColor)defaultBackgroundColor { return NX_COLORLTGRAY; } + (NXColor)defaultTextColor { return NX_COLORBLACK; } + (NXColor)defaultHighlightBackgroundColor { return NX_COLORWHITE; } + (NXColor)defaultHighlightTextColor { return NX_COLORBLACK; } - (NXColor)backgroundColor { return backgroundColor; } - (NXColor)textColor { return textColor; } - (NXColor)highlightBackgroundColor { return highlightBackgroundColor; } - (NXColor)highlightTextColor { return highlightTextColor; } - (id)setColor:(NXColor)value { return [self setBackgroundColor:value]; } - (NXColor)color { return [self backgroundColor]; } - (id)setColor:(NXColor)x // New color value. var:(NXColor*)v // Instance variable for the color. sel1:(SEL)sel1 // "setOwner...Color:" message for cell. sel2:(SEL)sel2 // "set...Color:" message for cell. notifySel:(DF::Selector)notifySel // "..ColorChangedTo:" { if (!NXEqualColor( x, *v )) { BOOL const was_auto = [self isAutodisplay]; [self setAutodisplay:NO]; *v = x; if (v == &backgroundColor) [self forwardBGColor]; if (![self isLazy]) { int const NRows = num_rows; int const NCols = num_cols; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) { id cell = [self cellAt:r:c]; if (cell != 0) { if ([cell respondsTo:sel1]) (*[cell methodFor:sel1])( cell, sel1, x ); else if ([cell respondsTo:sel2]) (*[cell methodFor:sel2])( cell, sel2, x ); } } } id del = [self responsibleDelegate:notifySel]; if (del != 0) { SEL objcSel = DF::selToObjc( notifySel ); (*[del methodFor:objcSel])( del, objcSel, self, x ); } [self setNeedsDisplay:YES]; [self setAutodisplay:was_auto]; // Will display if needed. } return self; } #define MISC_SET_COLOR_FUNC(LNAME,CNAME,UNAME)\ - (id)set##CNAME##Color:(NXColor) value\ { return [self setColor:value\ var:& LNAME##Color\ sel1:@selector(setOwner##CNAME##Color:)\ sel2:@selector(set##CNAME##Color:)\ notifySel:DF::DEL_##UNAME##_COLOR_CHANGED]; } MISC_SET_COLOR_FUNC( background, Background, BACK ) MISC_SET_COLOR_FUNC( text, Text, TEXT ) MISC_SET_COLOR_FUNC( highlightBackground, HighlightBackground, BACKH ) MISC_SET_COLOR_FUNC( highlightText, HighlightText, TEXTH ) #undef MISC_SET_COLOR_FUNC static inline float color_to_gray( NXColor x ) { float gray; NXConvertColorToGray( x, &gray ); return gray; } #define MISC_GET_GRAY_FUNC( LNAME )\ - (float)LNAME##Gray { return color_to_gray( [self LNAME##Color] ); } MISC_GET_GRAY_FUNC( background ) MISC_GET_GRAY_FUNC( text ) MISC_GET_GRAY_FUNC( highlightBackground ) MISC_GET_GRAY_FUNC( highlightText ) #undef MISC_GET_GRAY_FUNC #define MISC_SET_GRAY_FUNC( CNAME )\ - (id)set##CNAME##Gray:(float)x\ { return [self set##CNAME##Color: NXConvertGrayToColor(x)]; } MISC_SET_GRAY_FUNC( Background ) MISC_SET_GRAY_FUNC( Text ) MISC_SET_GRAY_FUNC( HighlightBackground ) MISC_SET_GRAY_FUNC( HighlightText ) #undef MISC_SET_GRAY_FUNC //============================================================================= // SAVE / RESTORE //============================================================================= //----------------------------------------------------------------------------- // SLOT ORDER //----------------------------------------------------------------------------- - (id)border:(MiscBorderType)b slotOrder:(MiscIntList*)list { if (list != 0) { MiscTableBorder const* const bp = info[b]->border; MiscCoord_P const* const vmap = bp->getP2VMap(); int const lim = bp->count(); [list empty]; for (int i = 0; i < lim; i++) { int v = (vmap ? vmap[i] : i); if (bp->getSortDirection(v) == MISC_SORT_DESCENDING) v = ~v; [list addInt:v]; } return self; } return 0; } - (id)colOrder:(MiscIntList*)list { return [self border:MISC_COL_BORDER slotOrder:list]; } - (id)rowOrder:(MiscIntList*)list { return [self border:MISC_ROW_BORDER slotOrder:list]; } - (id)border:(MiscBorderType)b setSlotOrder:(MiscIntList*)list { id ret = 0; MiscTableBorder* const bp = info[b]->border; if (list != 0) { int const lim = bp->count(); if ([list count] == lim) { unsigned int const nbytes = lim * sizeof(int) + lim * sizeof(bool); int* const map = (int*) malloc( nbytes ); MiscAssert( map != 0 ); bool* const desc = (bool*) (map + lim); for (int i = 0; i < lim; i++) { int const j = [list intAt:i]; map[i] = (desc[i] = (j < 0)) ? ~j : j; } if (bp->setP2VMap( map )) { for (int i = 0; i < lim; i++) { MiscSortDirection const dir = (desc[i] ? MISC_SORT_DESCENDING : MISC_SORT_ASCENDING); if (dir != bp->getSortDirection( map[i] )) bp->setSortDirection( map[i], dir ); } MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) [self sortSlots:ob]; ret = self; } free( map ); } } else { bp->setP2VMap( 0 ); bp->clearSortDirection(); ret = self; } return ret; } - (id)setColOrder:(MiscIntList*)list { return [self border:MISC_COL_BORDER setSlotOrder:list]; } - (id)setRowOrder:(MiscIntList*)list { return [self border:MISC_ROW_BORDER setSlotOrder:list]; } - (char*)border:(MiscBorderType)b slotOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { char* retval; MiscIntList* list = [[MiscIntList alloc] init]; [self border:b slotOrder:list]; retval = [list writeToString:buff size:buff_size canExpand:canExpand]; [list free]; return retval; } - (char*)colOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { return [self border:MISC_COL_BORDER slotOrderAsString:buff size:buff_size canExpand:canExpand]; } - (char*)rowOrderAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { return [self border:MISC_ROW_BORDER slotOrderAsString:buff size:buff_size canExpand:canExpand]; } - (id)border:(MiscBorderType)b setSlotOrderFromString:(char const*)s { id retval; MiscIntList* list = [[MiscIntList alloc] init]; [list readFromString:s]; retval = [self border:b setSlotOrder:list]; [list free]; return retval; } - (id)setColOrderFromString:(char const*)s { return [self border:MISC_COL_BORDER setSlotOrderFromString:s]; } - (id)setRowOrderFromString:(char const*)s { return [self border:MISC_ROW_BORDER setSlotOrderFromString:s]; } //----------------------------------------------------------------------------- // SLOT SIZES //----------------------------------------------------------------------------- - (id)border:(MiscBorderType)b slotSizes:(MiscIntList*)list { if (list != 0) { MiscTableBorder const* const bp = info[b]->border; int const lim = bp->count(); [list empty]; for (int i = 0; i < lim; i++) [list addInt: (int) bp->getSize_P( i ) ]; return self; } return 0; } - (id)colSizes:(MiscIntList*)list { return [self border:MISC_COL_BORDER slotSizes:list]; } - (id)rowSizes:(MiscIntList*)list { return [self border:MISC_ROW_BORDER slotSizes:list]; } - (id)border:(MiscBorderType)b setSlotSizes:(MiscIntList*)list { if (list != 0) { MiscTableBorder* const bp = info[b]->border; int const lim = bp->count(); if ([list count] == lim) { for (int i = 0; i < lim; i++) { NXCoord const min_size = [self border:b slotMinSize:i]; NXCoord const max_size = [self border:b slotMaxSize:i]; int s = [list intAt:i]; if (s < min_size) s = (int)min_size; else if (s > max_size) s = (int)max_size; bp->setSize_P( i, (MiscPixels)s ); } [self constrainSize]; return self; } } return 0; } - (id)setColSizes:(MiscIntList*)list { return [self border:MISC_COL_BORDER setSlotSizes:list]; } - (id)setRowSizes:(MiscIntList*)list { return [self border:MISC_ROW_BORDER setSlotSizes:list]; } - (char*)border:(MiscBorderType)b slotSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { char* retval; MiscIntList* list = [[MiscIntList alloc] init]; [self border:b slotSizes:list]; retval = [list writeToString:buff size:buff_size canExpand:canExpand]; [list free]; return retval; } - (char*)colSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { return [self border:MISC_COL_BORDER slotSizesAsString:buff size:buff_size canExpand:canExpand]; } - (char*)rowSizesAsString:(char*)buff size:(int)buff_size canExpand:(BOOL)canExpand { return [self border:MISC_ROW_BORDER slotSizesAsString:buff size:buff_size canExpand:canExpand]; } - (id)border:(MiscBorderType)b setSlotSizesFromString:(char const*)s { id retval; MiscIntList* list = [[MiscIntList alloc] init]; [list readFromString:s]; retval = [self border:b setSlotSizes:list]; [list free]; return retval; } - (id)setColSizesFromString:(char const*)s { return [self border:MISC_COL_BORDER setSlotSizesFromString:s]; } - (id)setRowSizesFromString:(char const*)s { return [self border:MISC_ROW_BORDER setSlotSizesFromString:s]; } //----------------------------------------------------------------------------- // Border Views //----------------------------------------------------------------------------- - (MiscCornerView*)cornerView { return cornerView; } - (char const*)cornerTitle { return [cornerView title]; } - (void)setCornerTitle:(char const*)s { [cornerView setTitle:s]; } - (BOOL)setBorder:(MiscBorderType)type on:(BOOL)on { MiscBorderInfo& b = *(info[type]); if (b.isOn != on) { [window disableDisplay]; BOOL const other_border_is_on = info[otherBorder(type)]->isOn; b.isOn = on; if (on) { if (other_border_is_on) [self addSubview: cornerView]; [self addSubview: b.clip]; NXRect r,c; [b.clip getBounds:&r]; [contentView getBounds:&c]; if (type == MISC_COL_BORDER) { if (r.origin.x != c.origin.x) { r.origin.x = c.origin.x; [b.clip rawScroll:&r.origin]; } } else { if (r.origin.y != c.origin.y) { r.origin.y = c.origin.y; [b.clip rawScroll:&r.origin]; } } } else { [b.clip removeFromSuperview]; if (other_border_is_on) [cornerView removeFromSuperview]; } [self tile]; [self constrainSize]; [window reenableDisplay]; [self update]; return YES; } return NO; } //----------------------------------------------------------------------------- // SLOT methods //----------------------------------------------------------------------------- - (MiscTableBorder*)border:(MiscBorderType)b { return info[b]->border; } - (BOOL)border:(MiscBorderType)b setTitlesOn:(BOOL)on_off { return [self setBorder:b on:on_off]; } - (BOOL)borderTitlesOn:(MiscBorderType)b { return info[b]->isOn; } - (MiscTableTitleMode)borderTitleMode:(MiscBorderType)b { return info[b]->border->getTitleMode(); } - (void)border:(MiscBorderType)b setTitleMode:(MiscTableTitleMode)x { MiscBorderInfo* const ip = info[b]; if (ip->border->setTitleMode(x) && ip->isOn && ip->border->count() > 0) [ip->view update]; } - (NXCoord)borderTitlesSize:(MiscBorderType)b { return info[b]->isOn ? [info[b]->view frameHeight] : 0; } - (void)border:(MiscBorderType)b setTitlesSize:(NXCoord)x { [info[b]->view setFrameHeight:(MiscPixels)floor(x)]; [self tile]; } - (id)border:(MiscBorderType)b moveSlotFrom:(int)fromPos to:(int)toPos { info[b]->border->moveFromTo(fromPos,toPos); [self selectionChanged]; return self; } - (int)border:(MiscBorderType)b slotPosition:(int)n { return info[b]->border->physicalToVisual(n); } - (int)border:(MiscBorderType)b slotAtPosition:(int)n { return info[b]->border->visualToPhysical(n); } - (void)border:(MiscBorderType)b physicalToVisual:(MiscIntList*)list { for (unsigned int i = [list count]; i-- > 0; ) { MiscCoord_P const p = [list intAt:i]; [list replaceIntAt:i with:[self border:b slotPosition:p]]; } } - (void)border:(MiscBorderType)b visualToPhysical:(MiscIntList*)list { for (unsigned int i = [list count]; i-- > 0; ) { MiscCoord_V const v = [list intAt:i]; [list replaceIntAt:i with:[self border:b slotAtPosition:v]]; } } - (BOOL)sizeableSlots:(MiscBorderType)b { return info[b]->border->isSizeable(); } - (BOOL)draggableSlots:(MiscBorderType)b { return info[b]->border->isDraggable(); } - (BOOL)modifierDragSlots:(MiscBorderType)b { return info[b]->border->isModifierDrag(); } - (NXCoord)uniformSizeSlots:(MiscBorderType)b { return (NXCoord) info[b]->border->getUniformSize(); } - (NXCoord)minUniformSizeSlots:(MiscBorderType)b { return (NXCoord) info[b]->border->getMinUniformSize(); } - (NXCoord)maxUniformSizeSlots:(MiscBorderType)b { return (NXCoord) info[b]->border->getMaxUniformSize(); } - (NXCoord)border:(MiscBorderType)b slotAdjustedSize:(int)n { return (NXCoord) info[b]->border->effectiveSize_P(n); } - (NXCoord)border:(MiscBorderType)b slotSize:(int)n { return (NXCoord) info[b]->border->getSize_P(n); } - (NXCoord)border:(MiscBorderType)b slotMinSize:(int)n { return (NXCoord) info[b]->border->getMinSize_P(n); } - (NXCoord)border:(MiscBorderType)b slotMaxSize:(int)n { return (NXCoord) info[b]->border->getMaxSize_P(n); } - (BOOL)border:(MiscBorderType)b slotIsSizeable:(int)n { return info[b]->border->isSizeable_P(n); } - (BOOL)border:(MiscBorderType)b slotIsAutosize:(int)n { return info[b]->border->isSpringy_P(n); } - (char const*)border:(MiscBorderType)b slotTitle:(int)n { return info[b]->border->getTitle_P(n); } - (int)border:(MiscBorderType)b slotTag:(int)n { return info[b]->border->getTag_P(n); } - (MiscTableCellStyle)border:(MiscBorderType)b slotCellType:(int)n { return info[b]->border->getStyle_P(n); } - (id)border:(MiscBorderType)b slotCellPrototype:(int)n { return info[b]->border->getPrototype_P(n); } - (void)border:(MiscBorderType)b setSizeableSlots:(BOOL)flag { info[b]->border->setSizeable( flag ); } - (void)border:(MiscBorderType)b setDraggableSlots:(BOOL)flag { info[b]->border->setDraggable( flag ); } - (void)border:(MiscBorderType)b setModifierDragSlots:(BOOL)flag { info[b]->border->setModifierDrag( flag ); } - (void)border:(MiscBorderType)b setUniformSizeSlots:(NXCoord)uniform_size { MiscBorderInfo* const ip = info[b]; if (ip->border->setUniformSize( (MiscPixels)floor(uniform_size) )) { [self constrainSize]; if (b == MISC_ROW_BORDER) { NXCoord const scr_size = uniform_size != 0 ? uniform_size : ip->border->getDefaultSize(); [self setLineScroll:scr_size]; [self setPageScroll:scr_size]; } [self update]; } } - (void)border:(MiscBorderType)b setMinUniformSizeSlots:(NXCoord)size { info[b]->border->setMinUniformSize( (MiscPixels)floor(size) ); } - (void)border:(MiscBorderType)b setMaxUniformSizeSlots:(NXCoord)size { info[b]->border->setMaxUniformSize( (MiscPixels)floor(size) ); } - (void)border:(MiscBorderType)b setSlot:(int)n size:(NXCoord)size { info[b]->border->setSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; // FIXME: [self update]; } - (void)border:(MiscBorderType)b setSlot:(int)n minSize:(NXCoord)size { info[b]->border->setMinSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n maxSize:(NXCoord)size { info[b]->border->setMaxSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n sizeable:(BOOL)flag { info[b]->border->setSizeable_P( n, flag ); } - (void)border:(MiscBorderType)b setSlot:(int)n autosize:(BOOL)flag { info[b]->border->setSpringy_P( n, flag ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n title:(char const*)title { MiscBorderInfo* const ip = info[b]; if (ip->border->setTitle_P( n, title ) && ip->isOn) [self border:b drawSlotTitle:n]; } - (void)border:(MiscBorderType)b setSlot:(int)n tag:(int)x { info[b]->border->setTag_P( n, x ); } - (void)border:(MiscBorderType)b setSlot:(int)n cellType:(MiscTableCellStyle)type { info[b]->border->setStyle_P(n,type); } - (void)border:(MiscBorderType)b setSlot:(int)n cellPrototype:(id)p { info[b]->border->setPrototype_P(n,p); } //----------------------------------------------------------------------------- // COL methods //----------------------------------------------------------------------------- - (MiscTableBorder*)colBorder { return colInfo.border; } - (BOOL)colTitlesOn { return [self borderTitlesOn:MISC_COL_BORDER]; } - (BOOL)setColTitlesOn:(BOOL)x { return [self setBorder:MISC_COL_BORDER on:x]; } - (MiscTableTitleMode)colTitleMode { return [self borderTitleMode:MISC_COL_BORDER]; } - (void)setColTitleMode:(MiscTableTitleMode)x { [self border:MISC_COL_BORDER setTitleMode:x]; } - (NXCoord)colTitlesHeight { return [self borderTitlesSize:MISC_COL_BORDER]; } - (void)setColTitlesHeight:(NXCoord)x { [self border:MISC_COL_BORDER setTitlesSize:x]; } - (MiscBorderView*)colTitles { return ([self colTitlesOn] ? colInfo.view : 0); } - (id)moveColFrom:(int)fromPos to:(int)toPos { return [self border:MISC_COL_BORDER moveSlotFrom:fromPos to:toPos]; } - (int)colPosition:(int)n { return [self border:MISC_COL_BORDER slotPosition:n]; } - (int)colAtPosition:(int)n { return [self border:MISC_COL_BORDER slotAtPosition:n]; } - (BOOL)sizeableCols { return [self sizeableSlots:MISC_COL_BORDER]; } - (BOOL)draggableCols { return [self draggableSlots:MISC_COL_BORDER]; } - (BOOL)modifierDragCols { return [self modifierDragSlots:MISC_COL_BORDER]; } - (NXCoord)uniformSizeCols { return [self uniformSizeSlots:MISC_COL_BORDER]; } - (NXCoord)minUniformSizeCols { return [self minUniformSizeSlots:MISC_COL_BORDER]; } - (NXCoord)maxUniformSizeCols { return [self maxUniformSizeSlots:MISC_COL_BORDER]; } - (NXCoord)colAdjustedSize:(int)n { return [self border:MISC_COL_BORDER slotAdjustedSize:n]; } - (NXCoord)colSize:(int)n { return [self border:MISC_COL_BORDER slotSize:n]; } - (NXCoord)colMinSize:(int)n { return [self border:MISC_COL_BORDER slotMinSize:n]; } - (NXCoord)colMaxSize:(int)n { return [self border:MISC_COL_BORDER slotMaxSize:n]; } - (BOOL)colIsSizeable:(int)n { return [self border:MISC_COL_BORDER slotIsSizeable:n]; } - (BOOL)colIsAutosize:(int)n { return [self border:MISC_COL_BORDER slotIsAutosize:n]; } - (char const*)colTitle:(int)n { return [self border:MISC_COL_BORDER slotTitle:n]; } - (int)colTag:(int)n { return [self border:MISC_COL_BORDER slotTag:n]; } - (MiscTableCellStyle)colCellType:(int)n { return [self border:MISC_COL_BORDER slotCellType:n]; } - (id)colCellPrototype:(int)n { return [self border:MISC_COL_BORDER slotCellPrototype:n]; } - (void)setSizeableCols:(BOOL)flag { [self border:MISC_COL_BORDER setSizeableSlots:flag]; } - (void)setDraggableCols:(BOOL)flag { [self border:MISC_COL_BORDER setDraggableSlots:flag]; } - (void)setModifierDragCols:(BOOL)flag { [self border:MISC_COL_BORDER setModifierDragSlots:flag]; } - (void)setUniformSizeCols:(NXCoord)size { [self border:MISC_COL_BORDER setUniformSizeSlots:size]; } - (void)setMinUniformSizeCols:(NXCoord)size { [self border:MISC_COL_BORDER setMinUniformSizeSlots:size]; } - (void)setMaxUniformSizeCols:(NXCoord)size { [self border:MISC_COL_BORDER setMaxUniformSizeSlots:size]; } - (void)setCol:(int)n size:(NXCoord)size { [self border:MISC_COL_BORDER setSlot:n size:size]; } - (void)setCol:(int)n minSize:(NXCoord)size { [self border:MISC_COL_BORDER setSlot:n minSize:size]; } - (void)setCol:(int)n maxSize:(NXCoord)size { [self border:MISC_COL_BORDER setSlot:n maxSize:size]; } - (void)setCol:(int)n sizeable:(BOOL)flag { [self border:MISC_COL_BORDER setSlot:n sizeable:flag]; } - (void)setCol:(int)n autosize:(BOOL)flag { [self border:MISC_COL_BORDER setSlot:n autosize:flag]; } - (void)setCol:(int)n title:(char const*)title { [self border:MISC_COL_BORDER setSlot:n title:title]; } - (void)setCol:(int)n tag:(int)x { [self border:MISC_COL_BORDER setSlot:n tag:x]; } - (void)setCol:(int)n cellType:(MiscTableCellStyle)x { [self border:MISC_COL_BORDER setSlot:n cellType:x]; } - (void)setCol:(int)n cellPrototype:p { [self border:MISC_COL_BORDER setSlot:n cellPrototype:p]; } //----------------------------------------------------------------------------- // ROW methods //----------------------------------------------------------------------------- - (MiscTableBorder*)rowBorder { return rowInfo.border; } - (BOOL)rowTitlesOn { return [self borderTitlesOn:MISC_ROW_BORDER]; } - (BOOL)setRowTitlesOn:(BOOL)x { return [self setBorder:MISC_ROW_BORDER on:x]; } - (MiscTableTitleMode)rowTitleMode { return [self borderTitleMode:MISC_ROW_BORDER]; } - (void)setRowTitleMode:(MiscTableTitleMode)x { [self border:MISC_ROW_BORDER setTitleMode:x]; } - (NXCoord)rowTitlesWidth { return [self borderTitlesSize:MISC_ROW_BORDER]; } - (void)setRowTitlesWidth:(NXCoord)x { [self border:MISC_ROW_BORDER setTitlesSize:x]; } - (MiscBorderView*)rowTitles { return ([self rowTitlesOn] ? rowInfo.view : 0); } - (id)moveRowFrom:(int)fromPos to:(int)toPos { return [self border:MISC_ROW_BORDER moveSlotFrom:fromPos to:toPos]; } - (int)rowPosition:(int)n { return [self border:MISC_ROW_BORDER slotPosition:n]; } - (int)rowAtPosition:(int)n { return [self border:MISC_ROW_BORDER slotAtPosition:n]; } - (BOOL)sizeableRows { return [self sizeableSlots:MISC_ROW_BORDER]; } - (BOOL)draggableRows { return [self draggableSlots:MISC_ROW_BORDER]; } - (BOOL)modifierDragRows { return [self modifierDragSlots:MISC_ROW_BORDER]; } - (NXCoord)uniformSizeRows { return [self uniformSizeSlots:MISC_ROW_BORDER]; } - (NXCoord)minUniformSizeRows { return [self minUniformSizeSlots:MISC_ROW_BORDER]; } - (NXCoord)maxUniformSizeRows { return [self maxUniformSizeSlots:MISC_ROW_BORDER]; } - (NXCoord)rowAdjustedSize:(int)n { return [self border:MISC_ROW_BORDER slotAdjustedSize:n]; } - (NXCoord)rowSize:(int)n { return [self border:MISC_ROW_BORDER slotSize:n]; } - (NXCoord)rowMinSize:(int)n { return [self border:MISC_ROW_BORDER slotMinSize:n]; } - (NXCoord)rowMaxSize:(int)n { return [self border:MISC_ROW_BORDER slotMaxSize:n]; } - (BOOL)rowIsSizeable:(int)n { return [self border:MISC_ROW_BORDER slotIsSizeable:n]; } - (BOOL)rowIsAutosize:(int)n { return [self border:MISC_ROW_BORDER slotIsAutosize:n]; } - (char const*)rowTitle:(int)n { return [self border:MISC_ROW_BORDER slotTitle:n]; } - (int)rowTag:(int)n { return [self border:MISC_ROW_BORDER slotTag:n]; } - (MiscTableCellStyle)rowCellType:(int)n { return [self border:MISC_ROW_BORDER slotCellType:n]; } - (id)rowCellPrototype:(int)n { return [self border:MISC_ROW_BORDER slotCellPrototype:n]; } - (void)setSizeableRows:(BOOL)flag { [self border:MISC_ROW_BORDER setSizeableSlots:flag]; } - (void)setDraggableRows:(BOOL)flag { [self border:MISC_ROW_BORDER setDraggableSlots:flag]; } - (void)setModifierDragRows:(BOOL)flag { [self border:MISC_ROW_BORDER setModifierDragSlots:flag]; } - (void)setUniformSizeRows:(NXCoord)size { [self border:MISC_ROW_BORDER setUniformSizeSlots:size]; } - (void)setMinUniformSizeRows:(NXCoord)size { [self border:MISC_ROW_BORDER setMinUniformSizeSlots:size]; } - (void)setMaxUniformSizeRows:(NXCoord)size { [self border:MISC_ROW_BORDER setMaxUniformSizeSlots:size]; } - (void)setRow:(int)n size:(NXCoord)size { [self border:MISC_ROW_BORDER setSlot:n size:size]; } - (void)setRow:(int)n minSize:(NXCoord)size { [self border:MISC_ROW_BORDER setSlot:n minSize:size]; } - (void)setRow:(int)n maxSize:(NXCoord)size { [self border:MISC_ROW_BORDER setSlot:n maxSize:size]; } - (void)setRow:(int)n sizeable:(BOOL)flag { [self border:MISC_ROW_BORDER setSlot:n sizeable:flag]; } - (void)setRow:(int)n autosize:(BOOL)flag { [self border:MISC_ROW_BORDER setSlot:n autosize:flag]; } - (void)setRow:(int)n title:(char const*)title { [self border:MISC_ROW_BORDER setSlot:n title:title]; } - (void)setRow:(int)n tag:(int)x { [self border:MISC_ROW_BORDER setSlot:n tag:x]; } - (void)setRow:(int)n cellType:(MiscTableCellStyle)x { [self border:MISC_ROW_BORDER setSlot:n cellType:x]; } - (void)setRow:(int)n cellPrototype:p { [self border:MISC_ROW_BORDER setSlot:n cellPrototype:p]; } //----------------------------------------------------------------------------- // DRAWING // FIXME: This should all be routed through the -display::: mechanism // so that the lockFocus can be done automatically, and so that // subviews will have an opportunity to draw themselves. //----------------------------------------------------------------------------- - (id)drawCellAt:(int)row :(int)col { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawCellAt:row:col]; [tableView unlockFocus]; [window flushWindow]; } return self; } - (id)drawRow:(int)row { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawRow:row]; [tableView unlockFocus]; [window flushWindow]; } return self; } - (id)drawCol:(int)col { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawCol:col]; [tableView unlockFocus]; [window flushWindow]; } return self; } - (id)border:(MiscBorderType)b drawSlot:(int)n { return (b == MISC_COL_BORDER) ? [self drawCol:n] : [self drawRow:n]; } - (id)border:(MiscBorderType)b drawSlotTitle:(int)n // physical position. { MiscBorderInfo* const ip = info[b]; if (ip->isOn) // visual position. { MiscBorderView* const v= ip->view; if ([v canDraw]) { [v lockFocus]; [v drawSlot: [self border:b slotPosition:n]]; [v unlockFocus]; [window flushWindow]; } } return self; } - (id)drawRowTitle:(int)n { return [self border:MISC_ROW_BORDER drawSlotTitle:n]; } - (id)drawColTitle:(int)n { return [self border:MISC_COL_BORDER drawSlotTitle:n]; } - (id)setAutodisplay:(BOOL)x { [rowInfo.view setAutodisplay:x]; [colInfo.view setAutodisplay:x]; [tableView setAutodisplay:x]; return [super setAutodisplay:x]; } - (BOOL)drawClippedText { return drawClippedText; } - (void)setDrawClippedText:(BOOL)x { if (drawClippedText != x) { drawClippedText = x; [self update]; } } //----------------------------------------------------------------------------- // VISIBLE / SCROLLING //----------------------------------------------------------------------------- - (void)scrollCellToVisible:(int)row :(int)col { [tableView scrollCellToVisible: row:col]; } - (void)scrollRowToVisible:(int)row { [tableView scrollRowToVisible:row]; } - (void)scrollColToVisible:(int)col { [tableView scrollColToVisible:col]; } - (id)scrollSelToVisible { if ([self hasRowSelection]) [self scrollRowToVisible: [self selectedRow]]; else if ([self hasColSelection]) [self scrollColToVisible: [self selectedCol]]; return self; } - (int)numVisibleSlots:(MiscBorderType)b { return [tableView numVisibleSlots:b]; } - (int)firstVisibleSlot:(MiscBorderType)b { return [tableView firstVisibleSlot:b]; } - (int)lastVisibleSlot:(MiscBorderType)b { return [tableView lastVisibleSlot:b]; } - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n { return [tableView border:b slotIsVisible:n]; } - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n { [tableView border:b setFirstVisibleSlot:n]; } - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n { [tableView border:b setLastVisibleSlot:n]; } - (int)numVisibleCols { return [self numVisibleSlots: MISC_COL_BORDER]; } - (int)firstVisibleCol { return [self firstVisibleSlot:MISC_COL_BORDER]; } - (int)lastVisibleCol { return [self lastVisibleSlot: MISC_COL_BORDER]; } - (BOOL)colIsVisible:(int)n { return [self border:MISC_COL_BORDER slotIsVisible:n]; } - (void)setFirstVisibleCol:(int)n { [self border:MISC_COL_BORDER setFirstVisibleSlot:n]; } - (void)setLastVisibleCol:(int)n { [self border:MISC_COL_BORDER setLastVisibleSlot:n]; } - (int)numVisibleRows { return [self numVisibleSlots: MISC_ROW_BORDER]; } - (int)firstVisibleRow { return [self firstVisibleSlot:MISC_ROW_BORDER]; } - (int) lastVisibleRow { return [self lastVisibleSlot: MISC_ROW_BORDER]; } - (BOOL)rowIsVisible:(int)n { return [self border:MISC_ROW_BORDER slotIsVisible:n]; } - (void)setFirstVisibleRow:(int)n { [self border:MISC_ROW_BORDER setFirstVisibleSlot:n]; } - (void)setLastVisibleRow:(int)n { [self border:MISC_ROW_BORDER setLastVisibleSlot:n]; } @end MiscKit/Palettes/MiscTableScroll/bool.h100444 1750 1750 2501 6757716134 20337 0ustar sunshinesunshine#ifndef __bool_h #define __bool_h //============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // bool.h // // A header to supplement NeXT's lack of bool type in their C++ compiler. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: bool.h,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: bool.h,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #ifdef __NeXT__ typedef char bool; #define false ((bool)0) #define true ((bool)1) #endif #endif // __bool_h MiscKit/Palettes/MiscTableScroll/MiscVertResizeCursor.tiff100444 1750 1750 512 6757716140 24176 0ustar sunshinesunshineMM*ˆÀ 00 ÀÀü?Àÿü?ÿÀÿü?ÿü?ÀÀÀ0 0ÀÀð?üÿÿÿÿÀÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÀÿÿ?üðÀ *2:B(RH@@ ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscBorderCell.M100444 1750 1750 16657 6757716145 22245 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderCell.M // // Cell class used by MiscBorderView to manage column headings and row // labels for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderCell.M,v 1.5 96/09/13 12:32:36 zarnuk Exp $ // $Log: MiscBorderCell.M,v $ // Revision 1.5 96/09/13 12:32:36 zarnuk // Added the image instance variable, and support for drawing it. // // Revision 1.4 96/08/30 14:49:20 sunshine // No longer directly accesses cFlags. //----------------------------------------------------------------------------- #import "MiscBorderCell.h" extern "Objective-C" { #import #import #import #import } extern "C" { #import } #define BORDER_TOP 2 // 2 pixels for top border #define BORDER_BOTTOM 1 // 1 pixel for bottom border #define BORDER_LEFT 2 // 2 pixels for left border #define BORDER_RIGHT 1 // 1 pixel for right border #define BORDER_WIDTH (BORDER_LEFT + BORDER_RIGHT) #define BORDER_HEIGHT (BORDER_TOP + BORDER_BOTTOM) #define RESIZE_WIDTH 3 // Resize zone is 4 pixels on right. @implementation MiscBorderCell //----------------------------------------------------------------------------- // -setImage: //----------------------------------------------------------------------------- - setImage:img { image = img; return self; } //----------------------------------------------------------------------------- // -initTextCell: //----------------------------------------------------------------------------- - initTextCell: (char const*) s { [super initTextCell:s]; [self setBordered:NO]; [self setWrap:NO]; [self setAlignment: NX_CENTERED]; [self setFont: [Font boldSystemFontOfSize:12.0 matrix:NX_FLIPPEDMATRIX]]; return self; } //----------------------------------------------------------------------------- // -backgroundGray //----------------------------------------------------------------------------- - (float) backgroundGray { return [self state] ? (1.0/6.0) : NX_DKGRAY; } //----------------------------------------------------------------------------- // -setTextAttributes: //----------------------------------------------------------------------------- - setTextAttributes:textObject { [super setTextAttributes:textObject]; [textObject setTextGray:NX_WHITE]; [textObject setBackgroundGray: [self backgroundGray]]; return textObject; } //----------------------------------------------------------------------------- // -calcCellSize:inRect: //----------------------------------------------------------------------------- - calcCellSize:(NXSize*)theSize inRect:(NXRect const*)aRect { [super calcCellSize:theSize inRect:aRect]; theSize->width += BORDER_WIDTH + RESIZE_WIDTH; theSize->height += BORDER_HEIGHT; if (image != 0) { NXSize sz; [image getSize:&sz]; theSize->width += sz.width; } return self; } //----------------------------------------------------------------------------- // -drawInside:inView: //----------------------------------------------------------------------------- - drawInside:(NXRect const*)p inView:v { // Assume the view is flipped. NXRect r; PSsetgray( [self backgroundGray] ); NXSetRect( &r, NX_X(p) + BORDER_LEFT, NX_Y(p) + BORDER_TOP, NX_WIDTH(p) - BORDER_WIDTH, NX_HEIGHT(p) - BORDER_HEIGHT ); NXRectFill( &r ); if (image != 0) { NXSize sz; [image getSize:&sz]; NXPoint pt; pt.x = NX_MAXX(p) - BORDER_RIGHT - RESIZE_WIDTH; pt.y = NX_MAXY(p) - BORDER_BOTTOM; NXCoord max_height = floor( NX_HEIGHT(p) - BORDER_HEIGHT ); NXCoord max_width = floor( NX_WIDTH(p) - BORDER_WIDTH - RESIZE_WIDTH ); BOOL const too_high = sz.height > max_height; BOOL const too_wide = sz.width > max_width; if (too_high || too_wide) { NXRect q = { {0,0}, {sz.width, sz.height} }; if (too_high) { q.size.height = max_height; q.origin.y = floor( (sz.height - max_height) / 2 ); } else { // Center image vertically. pt.y = floor( pt.y - ((max_height - sz.height) / 2) ); } if (too_wide) { q.size.width = max_width; q.origin.x = floor( (sz.width - max_width) / 2 ); } sz = q.size; pt.x -= sz.width; [image composite:NX_SOVER fromRect:&q toPoint:&pt]; } else { // Center image vertically. pt.y = floor( pt.y - ((max_height - sz.height) / 2) ); pt.x -= sz.width; [image composite:NX_SOVER toPoint:&pt]; } r.size.width -= (sz.width + RESIZE_WIDTH); } [super drawInside:&r inView:v]; return self; } //----------------------------------------------------------------------------- // -drawSelf:inView: // // Draw light gray lines at top and left edges. Draw white lines just // inside light gray lines at top and left edges. Draw black lines at // bottom and right edges. Draw dark gray pixel at junction of white // and black lines (in lower-left and upper-right corners). // // The lines are derived from a table of scalers and constants which are // applied to the cellFrame(cf) using the following formulas: // x = cf.x * xScaler + cf.maxx * maxxScaler + xConst // y = cf.y * yScaler + cf.maxy * maxyScaler + yConst // w = cf.w * wScaler + wConst // h = cf.h * hScaler + hConst // //----------------------------------------------------------------------------- - drawSelf:(NXRect const*)cellFrame inView:aView { int const NUM_RECTS = 8; float const grays[ NUM_RECTS ] = { NX_LTGRAY, NX_LTGRAY, NX_WHITE, NX_WHITE, NX_BLACK, NX_BLACK, NX_DKGRAY, NX_DKGRAY }; struct BC_Lines { char xs, maxxs, xc, ys, maxys, yc, ws, wc, hs, hc; }; static BC_Lines const LINES[ NUM_RECTS ] = { { 1, 0, 0, 1, 0, 0, 0, 1, 1, 0 }, // ltgray, left edge { 1, 0, 1, 1, 0, 0, 1, -1, 0, 1 }, // ltgray, top edge { 1, 0, 1, 1, 0, 1, 0, 1, 1, -2 }, // white, left edge + 1 { 1, 0, 2, 1, 0, 1, 1, -3, 0, 1 }, // white, top edge + 1 { 0, 1, -1, 1, 0, 2, 0, 1, 1, -2 }, // black, right edge { 1, 0, 2, 0, 1, -1, 1, -3, 0, 1 }, // black, bottom edge { 1, 0, 1, 0, 1, -1, 0, 1, 0, 1 }, // dkgray, lower left corner { 0, 1, -1, 1, 0, 1, 0, 1, 0, 1 } // dkgray, upper right corner }; NXRect rects[ NUM_RECTS ]; for (int i = 0; i < NUM_RECTS; i++) { BC_Lines const& r = LINES[i]; NXSetRect( &(rects[i]), r.xs * NX_X(cellFrame) + r.maxxs * NX_MAXX(cellFrame) + r.xc, r.ys * NX_Y(cellFrame) + r.maxys * NX_MAXY(cellFrame) + r.yc, r.ws * NX_WIDTH(cellFrame) + r.wc, r.hs * NX_HEIGHT(cellFrame) + r.hc ); } NXRectFillListWithGrays( rects, grays, NUM_RECTS ); return [self drawInside:cellFrame inView:aView]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollData.M100444 1750 1750 53647 6757716157 23233 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollData.M // // The (DATA) category of MiscTableScroll. Implements the management // of the cells of the table. // // FIXME *SELECTION* // The current selection architecture is imposing undesirable overhead // on a *highly* used function, -cellAt::. We need to come up with a // better way to handle this. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollData.M,v 1.17 97/06/10 05:39:17 sunshine Exp $ // $Log: MiscTableScrollData.M,v $ // Revision 1.17 97/06/10 05:39:17 sunshine // v127: Uses new MiscAssert. // // Revision 1.16 97/02/05 07:59:03 sunshine // v122: Now takes into account new "tracking" flag to ensure that cells have // correct highlight setting in lazy-mode. // // Revision 1.15 97/01/24 08:13:40 sunshine // v0.119: Fixed bug: Wasn't resetting the "remembered" selection in // BorderView or TableView. Now calls -resetSelection when appropriate. //----------------------------------------------------------------------------- #import #import #import "MiscAssert.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import } extern "C" { #import #import #import } #define EAGER_CELL_AT(R,C) (cells[ (R) * num_cols + (C) ]) @implementation MiscTableScroll(DATA) //----------------------------------------------------------------------------- // - lazyCellAt:: //----------------------------------------------------------------------------- - (id)lazyCellAt:(int)row :(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_CELL_AT]; if (del != 0) { id c = [del tableScroll:self cellAt:row :col]; if (c != 0 && [c respondsTo:@selector(setParameter:to:)]) [c setParameter:NX_CELLHIGHLIGHTED to:([self tracking] && row == [self clickedRow] && col == [self clickedCol])]; return c; } return 0; } //----------------------------------------------------------------------------- // - eagerCellAt:: //----------------------------------------------------------------------------- - (id)eagerCellAt:(int)row :(int)col { return EAGER_CELL_AT( row, col ); } //----------------------------------------------------------------------------- // - cellAt:: //----------------------------------------------------------------------------- - (id)cellAt:(int)row :(int)col { id cell = 0; if ((unsigned int) row < (unsigned int) num_rows && (unsigned int) col < (unsigned int) num_cols) { if (!lazy) cell = EAGER_CELL_AT( row, col ); else cell = [self lazyCellAt:row:col]; if ([cell respondsTo:@selector(setSelected:)]) // FIXME *SELECTION* { MiscCoord_V const vr = rowInfo.border->physicalToVisual(row); MiscCoord_V const vc = colInfo.border->physicalToVisual(col); [cell setSelected:colInfo.border->selectionSet().contains(vc) || rowInfo.border->selectionSet().contains(vr)]; } } return cell; } //----------------------------------------------------------------------------- // tagAt::, intValueAt::, floatValueAt::, doubleValueAt::, // stringValueAt::, titleAt::, stateAt:: //----------------------------------------------------------------------------- #define MISC_CELL_VAL( DATA_TYPE, NAME, CMD )\ - (DATA_TYPE) NAME##At:(int)r :(int)c\ {\ id del = [self responsibleDelegate:MiscDelegateFlags::DEL_##CMD##_AT];\ if (del != 0)\ return [del tableScroll:self NAME##At:r:c];\ id cell = (!lazy ? EAGER_CELL_AT(r,c) : [self lazyCellAt:r:c]);\ if (cell != 0 && [cell respondsTo:@selector(NAME)])\ return [cell NAME];\ return 0;\ } MISC_CELL_VAL( int, tag, TAG ) // tagAt:: MISC_CELL_VAL( int, intValue, INT_VALUE ) // intValueAt:: MISC_CELL_VAL( float, floatValue, FLOAT_VALUE ) // floatValueAt:: MISC_CELL_VAL( double, doubleValue, DOUBLE_VALUE ) // doubleValueAt:: MISC_CELL_VAL( char const*, stringValue, STRING_VALUE ) // stringValueAt:: MISC_CELL_VAL( int, state, STATE ) // stateAt:: MISC_CELL_VAL( char const*, title, TITLE ) // titleAt:: #undef MISC_CELL_VAL //----------------------------------------------------------------------------- // - buffCount // For lazy-mode tables that perform multiple-buffering. This can // avoid copying when accessing more than one cell at a time (such // as during sorting.) //----------------------------------------------------------------------------- - (int)buffCount { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_BUFF_COUNT]; if (del != 0) return [del tableScrollBuffCount:self]; return 1; } //----------------------------------------------------------------------------- // - expandIfNeeded //----------------------------------------------------------------------------- - (void)expandIfNeeded { int const num_cells = max_rows * num_cols; if (num_cells > max_cells) { NXZone* const z = [self zone]; int const nbytes = num_cells * sizeof(*cells); if (max_cells == 0) cells = (id*) NXZoneMalloc( z, nbytes ); else cells = (id*) NXZoneRealloc( z, cells, nbytes ); max_cells = num_cells; } } //----------------------------------------------------------------------------- // - extendMaxRows: //----------------------------------------------------------------------------- - (void)extendMaxRows:(int)new_max { int const old_max = max_rows; max_rows = new_max; [self expandIfNeeded]; NXZone* const z = [self zone]; MiscTableBorder* const bp = colInfo.border; id* p = cells + old_max * num_cols; for (int r = old_max; r < new_max; r++) for (int c = 0; c < num_cols; c++) *p++ = [bp->getPrototype_P(c) copyFromZone:z]; } //----------------------------------------------------------------------------- // - lazyInsertColAt: //----------------------------------------------------------------------------- - (void)lazyInsertColAt:(int)n { colInfo.border->insertAt(n,n); // FIXME: Check this. num_cols++; } //----------------------------------------------------------------------------- // - eagerInsertColAt: //----------------------------------------------------------------------------- - (void)eagerInsertColAt:(int)n { MiscAssert( 0 <= n ); MiscAssert( n <= num_cols ); MiscAssert( 0 < num_cols ); // lazyInsert must increment num_cols. if (max_rows > 0 || num_rows > 0) { if (max_rows == 0) max_rows = num_rows; [self expandIfNeeded]; int const num_new = num_cols; int const num_old = num_cols - 1; if (num_old > 0) // Shift old, existing cells. { int const frag = num_old - n; // #cols right of insert col. id* src = cells + (max_rows * num_old) - frag; id* dst = cells + (max_rows * num_new) - frag; if (frag > 0) // Last partial row. memmove( dst, src, frag * sizeof(*dst) ); int const nbytes = num_old * sizeof(*dst); src -= num_old; dst -= num_new; while (src > cells) // All full rows. { memmove( dst, src, nbytes ); src -= num_old; dst -= num_new; } } int row = 0; NXZone* const z = [self zone]; id const proto = colInfo.border->getPrototype_P(n); id* const plim = cells + (max_rows * num_new); id* p = cells + n; while (p < plim) // Initialize cells in new column. { *p = [self reviveCell:[proto copyFromZone:z] at:row++ :n]; p += num_new; } } } //----------------------------------------------------------------------------- // - insertColAt: //----------------------------------------------------------------------------- - (id)insertColAt:(int)n { if (0 <= n && n <= num_cols) { [self lazyInsertColAt:n]; if (!lazy) [self eagerInsertColAt:n]; [self constrainSize]; [self resetSelection]; [self update]; return self; } return 0; } //----------------------------------------------------------------------------- // - addCol //----------------------------------------------------------------------------- - (id)addCol { return [self insertColAt: num_cols]; } //----------------------------------------------------------------------------- // - lazyDeleteColAt: //----------------------------------------------------------------------------- - (void)lazyDeleteColAt:(int)n { colInfo.border->deleteAt_P(n); num_cols--; } //----------------------------------------------------------------------------- // - eagerDeleteColAt: //----------------------------------------------------------------------------- - (void)eagerDeleteColAt:(int)n { MiscAssert( 0 < num_cols ); MiscAssert( 0 <= n ); MiscAssert( n < num_cols ); if (max_rows > 0) { int const num_old = num_cols; int const num_new = num_cols - 1; id* dst = cells + n; id* src = dst + 1; id* const dst_lim = cells + (num_old * max_rows); int row = 0; while (dst < dst_lim) // Destroy deleted cells. { if (row < num_rows) [[self retireCell:*dst at:row++:n] free]; else [*dst free]; dst += num_old; } if (num_new > 0) // Shift remaining columns. { dst = cells + n; int const nbytes = num_new * sizeof(*dst); id* const src_lim = cells + (max_rows - 1) * num_old + n; while (src < src_lim) { memmove( dst, src, nbytes ); dst += num_new; src += num_old; } if (n < num_new) // Shift last partial row. memmove( dst, src, (num_new - n) * sizeof(*dst) ); } else // (num_new <= 0) { max_rows = 0; } } } //----------------------------------------------------------------------------- // - deleteColAt: //----------------------------------------------------------------------------- - (id)deleteColAt:(int)n { if (0 <= n && n < num_cols) { if (!lazy) [self eagerDeleteColAt:n]; [self lazyDeleteColAt:n]; [self constrainSize]; [self resetSelection]; [self update]; return self; } return 0; } //----------------------------------------------------------------------------- // - numCols //----------------------------------------------------------------------------- - (int)numCols { return num_cols; } //----------------------------------------------------------------------------- // - lazyInsertRowAt: //----------------------------------------------------------------------------- - (void)lazyInsertRowAt:(int)n { rowInfo.border->insertAt(n,n); // FIXME. Check this. num_rows++; } //----------------------------------------------------------------------------- // - eagerInsertRowAt: //----------------------------------------------------------------------------- - (void)eagerInsertRowAt:(int)n { MiscAssert( 0 < num_rows ); // lazy-insert must increment num_rows MiscAssert( 0 <= n ); MiscAssert( n < num_rows ); if (num_cols > 0) { max_rows++; // Incremental growth. MiscAssert( num_rows <= max_rows ); [self expandIfNeeded]; int const old_max = max_rows - 1; id* p = cells + n * num_cols; if (n < old_max) // Shift other rows. { id* src = p; id* dst = src + num_cols; memmove( dst, src, (old_max - n) * num_cols * sizeof(*dst) ); } NXZone* const z = [self zone]; MiscTableBorder* const bp = colInfo.border; for (int c = 0; c < num_cols; c++) // Initialize new cells. *p++ = [self reviveCell:[bp->getPrototype_P(c) copyFromZone:z] at:n:c]; } } //----------------------------------------------------------------------------- // - insertRowAt: //----------------------------------------------------------------------------- - (id)insertRowAt:(int)n { if (0 <= n && n <= num_rows) { [self lazyInsertRowAt:n]; if (!lazy) [self eagerInsertRowAt:n]; [self constrainSize]; [self resetSelection]; [self update]; return self; } return 0; } //----------------------------------------------------------------------------- // - eagerAddRow //----------------------------------------------------------------------------- - (void)eagerAddRow { MiscAssert( 0 < num_rows ); // lazy insertRowAt: must increment num_rows. if (num_cols > 0) { if (num_rows >= max_rows) { MiscAssert( num_rows < (INT_MAX >> 1) ); int n = (max_rows != 0 ? max_rows : 16); while (n < num_rows) n <<= 1; [self extendMaxRows:n]; } int const r = num_rows - 1; id* p = cells + (num_cols * r); for (int c = 0; c < num_cols; c++) *p++ = [self reviveCell:*p at:r:c]; } } //----------------------------------------------------------------------------- // - addRow // // NOTE: We explicitly do NOT -constrainSize and -update here, because we // expect that the user will call this routine many times successively. //----------------------------------------------------------------------------- - (id)addRow { [self lazyInsertRowAt:num_rows]; if (!lazy) [self eagerAddRow]; return self; } //----------------------------------------------------------------------------- // - lazyDeleteRowAt: //----------------------------------------------------------------------------- - (void)lazyDeleteRowAt:(int)n { rowInfo.border->deleteAt_P(n); num_rows--; } //----------------------------------------------------------------------------- // - eagerDeleteRowAt: //----------------------------------------------------------------------------- - (void)eagerDeleteRowAt:(int)n { MiscAssert( 0 < num_rows ); MiscAssert( 0 <= n ); MiscAssert( n < num_rows ); if (num_cols > 0) { MiscAssert( num_rows <= max_rows ); max_rows--; id* const dst = cells + (n * num_cols ); id* p = dst; id* const plim = p + num_cols; int col = 0; while (p < plim) // Destroy the cells. { [[self retireCell:*p at:n:col++] free]; p++; } if (n < max_rows) memmove( dst, plim, (max_rows - n) * num_cols * sizeof(*dst) ); } } //----------------------------------------------------------------------------- // - deleteRowAt: //----------------------------------------------------------------------------- - (id)deleteRowAt:(int)n { if (0 <= n && n < num_rows) { if (!lazy) [self eagerDeleteRowAt:n]; [self lazyDeleteRowAt:n]; [self constrainSize]; [self resetSelection]; [self update]; return self; } return 0; } //----------------------------------------------------------------------------- // - numRows //----------------------------------------------------------------------------- - (int)numRows { return num_rows; } //----------------------------------------------------------------------------- // - lazyRenewRows: //----------------------------------------------------------------------------- - (void)lazyRenewRows:(int)n { rowInfo.border->setCount(n); num_rows = n; } //----------------------------------------------------------------------------- // - eagerRenewRows: //----------------------------------------------------------------------------- - (void)eagerRenewRows:(int)n { MiscAssert( 0 <= n ); if (num_cols > 0) { int const old_num_rows = num_rows; int const new_num_rows = n; if (n > max_rows) [self extendMaxRows:n]; if (old_num_rows < new_num_rows) // Growing { id* p = cells + old_num_rows * num_cols; for (int r = old_num_rows; r < new_num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = [self reviveCell:*p at:r:c]; } else if (old_num_rows > new_num_rows) // Shrinking { id* p = cells + new_num_rows * num_cols; for (int r = new_num_rows; r < old_num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = [self retireCell:*p at:r:c]; } } } //----------------------------------------------------------------------------- // - renewRows: //----------------------------------------------------------------------------- - (id)renewRows:(int)n { [self clearSelection]; if (0 <= n && n != num_rows) { if (!lazy) [self eagerRenewRows:n]; [self lazyRenewRows:n]; } [self constrainSize]; [self update]; return self; } //----------------------------------------------------------------------------- // - empty //----------------------------------------------------------------------------- - (id)empty { return [self renewRows:0]; } //----------------------------------------------------------------------------- // - freeCells //----------------------------------------------------------------------------- - (void)freeCells { if (max_rows > 0 && num_cols > 0) { id* p = cells; id* const plim = p + (max_rows * num_cols); while (p < plim) [*p++ free]; } if (cells != 0) NXZoneFree( [self zone], cells ); cells = 0; max_cells = 0; max_rows = 0; } //----------------------------------------------------------------------------- // - emptyAndFreeCells //----------------------------------------------------------------------------- - (id)emptyAndFreeCells { [self empty]; [self freeCells]; return self; } //----------------------------------------------------------------------------- // - setLazy: //----------------------------------------------------------------------------- - (void)setLazy:(BOOL)flag { if (lazy != flag) { lazy = flag; if (lazy) [self emptyAndFreeCells]; else [self eagerRenewRows:num_rows]; } } //----------------------------------------------------------------------------- // - isLazy //----------------------------------------------------------------------------- - (BOOL)isLazy { return lazy; } //----------------------------------------------------------------------------- // Generic Slot methods //----------------------------------------------------------------------------- - (id)addSlot:(MiscBorderType)b { return (b == MISC_COL_BORDER) ? [self addCol] : [self addRow]; } - (id)border:(MiscBorderType)b insertSlotAt:(int)n { return (b == MISC_COL_BORDER) ? [self insertColAt:n] : [self insertRowAt:n]; } - (id)border:(MiscBorderType)b deleteSlotAt:(int)n { return (b == MISC_COL_BORDER) ? [self deleteColAt:n] : [self deleteRowAt:n]; } - (int)numSlots:(MiscBorderType)b { return (b == MISC_COL_BORDER) ? [self numCols] : [self numRows]; } //----------------------------------------------------------------------------- // REVIVE //----------------------------------------------------------------------------- - (id)doReviveCell:(id)cell at:(int)row:(int)col { if (cell != 0) { if ([cell respondsTo:@selector(setOwner:)]) [cell setOwner:self]; if ([cell respondsTo:@selector(setUseOwnerFont:)]) [cell setUseOwnerFont:YES]; if ([cell respondsTo:@selector(setUseOwnerTextColor:)]) [cell setUseOwnerTextColor:YES]; if ([cell respondsTo:@selector(setUseOwnerBackgroundColor:)]) [cell setUseOwnerBackgroundColor:YES]; if ([cell respondsTo:@selector(setUseOwnerHighlightTextColor:)]) [cell setUseOwnerHighlightTextColor:YES]; if ([cell respondsTo:@selector(setUseOwnerHighlightBackgroundColor:)]) [cell setUseOwnerHighlightBackgroundColor:YES]; if ([cell respondsTo:@selector(setOwnerFont:)]) [cell setOwnerFont:[self font]]; else if ([cell respondsTo:@selector(setFont:)]) [cell setFont:[self font]]; if ([cell respondsTo:@selector(setOwnerTextColor:)]) [cell setOwnerTextColor:[self textColor]]; else if ([cell respondsTo:@selector(setTextColor:)]) [cell setTextColor:[self textColor]]; if ([cell respondsTo:@selector(setOwnerBackgroundColor:)]) [cell setOwnerBackgroundColor:[self backgroundColor]]; else if ([cell respondsTo:@selector(setBackgroundColor:)]) [cell setBackgroundColor:[self backgroundColor]]; if ([cell respondsTo:@selector(setOwnerHighlightTextColor:)]) [cell setOwnerHighlightTextColor:[self highlightTextColor]]; else if ([cell respondsTo:@selector(setHighlightTextColor:)]) [cell setHighlightTextColor:[self highlightTextColor]]; if ([cell respondsTo:@selector(setOwnerHighlightBackgroundColor:)]) [cell setOwnerHighlightBackgroundColor: [self highlightBackgroundColor]]; else if ([cell respondsTo:@selector(setHighlightBackgroundColor:)]) [cell setHighlightBackgroundColor:[self highlightBackgroundColor]]; } return cell; } - (id)reviveCell:(id)cell at:(int)row :(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_REVIVE_CELL]; if (del != 0) return [del tableScroll:self reviveCell:cell at:row :col]; if (cell != 0 && [cell respondsTo:@selector(tableScroll:reviveAt: :)]) return [cell tableScroll:self reviveAt:row :col]; return [self doReviveCell:cell at:row :col]; } //----------------------------------------------------------------------------- // RETIRE //----------------------------------------------------------------------------- - (id)doRetireCell:(id)cell at:(int)row:(int)col { if ([cell respondsTo:@selector(setTitle:)]) [cell setTitle:0]; else if ([cell respondsTo:@selector(setStringValueNoCopy:)]) [cell setStringValueNoCopy:0]; else if ([cell respondsTo:@selector(setStringValue:)]) [cell setStringValue:0]; return cell; } - (id)retireCell:(id)cell at:(int)row:(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_RETIRE_CELL]; if (del != 0) return [del tableScroll:self retireCell:cell at:row :col]; if (cell != 0 && [cell respondsTo:@selector(tableScroll:retireAt: :)]) return [cell tableScroll:self retireAt:row :col]; return [self doRetireCell:cell at:row :col]; } @end MiscKit/Palettes/MiscTableScroll/MiscExporterAccessoryView.M100444 1750 1750 21400 6757716150 24521 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporter.M // // Object that exports the contents of an MiscTableScroll in // various useful formats. // // BUGS: // * Enable / disable save controls based on format. // TODO: // * Add more export formats: rtf0, Lotus 1-2-3, Quattro, Excel, etc. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterAccessoryView.M,v 1.2 99/06/29 07:35:15 sunshine Exp $ // $Log: MiscExporterAccessoryView.M,v $ // Revision 1.2 99/06/29 07:35:15 sunshine // v140: Rewrote so that layout of controls is dynamic, based upon their sizes // rather than using hard-coded coordinates. No longer abbreviates box titles // as "Col Titles" & "Col Grids"; now uses "Column Titles" & "Column Grid". // //----------------------------------------------------------------------------- #import "MiscExporterAccessoryView.h" extern "Objective-C" { #import #import #import #import #import } extern "C" { #import #import // strerror() } static char const* const MISC_FORMAT_NAME[] = { "ASCII-Fixed", "ASCII-Tab", "ASCII-Delimited", "dBASE III (.DBF)" }; static char const* const MISC_TITLE_MODE_NAME[] = { "Off", "On", "Wrap", "Truncate" }; static char const* const MISC_GRID_MODE_NAME[] = { "Off", "Line", "Space" }; //----------------------------------------------------------------------------- // name_to_tag //----------------------------------------------------------------------------- static int name_to_tag( char const* nm, char const* const* nm_array, int first, int last, int fallback ) { int const n = (last - first) + 1; for (int i = 0; i < n; i++) if (strcmp( nm_array[i], nm ) == 0) return i + first; return fallback; } inline static MiscExportFormat name_to_format( char const* nm ) { return (MiscExportFormat) name_to_tag( nm, MISC_FORMAT_NAME, MISC_EXPORT_FORMAT_FIRST, MISC_EXPORT_FORMAT_LAST, MISC_EXPORT_FORMAT_DEFAULT ); } inline static MiscExportTitleMode name_to_title_mode ( char const* nm, MiscExportTitleMode fallback ) { return (MiscExportTitleMode) name_to_tag( nm, MISC_TITLE_MODE_NAME, MISC_EXPORT_TITLES_FIRST, MISC_EXPORT_TITLES_LAST, (int) fallback ); } inline static MiscExportTitleMode name_to_row_title_mode( char const* nm ) { return name_to_title_mode( nm, MISC_EXPORT_TITLES_ROW_DEFAULT ); } inline static MiscExportTitleMode name_to_col_title_mode( char const* nm ) { return name_to_title_mode( nm, MISC_EXPORT_TITLES_COL_DEFAULT ); } inline static MiscExportGridMode name_to_grid_mode ( char const* nm, MiscExportGridMode fallback ) { return (MiscExportGridMode) name_to_tag( nm, MISC_GRID_MODE_NAME, MISC_EXPORT_GRID_FIRST, MISC_EXPORT_GRID_LAST, (int)fallback ); } inline static MiscExportGridMode name_to_row_grid_mode( char const* nm ) { return name_to_grid_mode( nm, MISC_EXPORT_GRID_ROW_DEFAULT ); } inline static MiscExportGridMode name_to_col_grid_mode( char const* nm ) { return name_to_grid_mode( nm, MISC_EXPORT_GRID_COL_DEFAULT ); } //----------------------------------------------------------------------------- // new_popup //----------------------------------------------------------------------------- static Button* new_popup( char const* const* names, int first, int last, int init_choice ) { int const n = (last - first) + 1; PopUpList* popup = [[PopUpList alloc] init]; for (int i = 0; i < n; i++) [popup addItem:names[i]]; [[popup itemList] selectCellAt:(init_choice - first):0]; return (Button*)NXCreatePopUpListButton( popup ); } //----------------------------------------------------------------------------- // new_box //----------------------------------------------------------------------------- static Box* new_box( Button* button, char const* title ) { NXCoord const OFFSET = 3; NXRect const r = {{ 0, 0 }, { 10, 10 }}; Box* const box = [[Box alloc] initFrame:&r]; [box setContentView:button]; [box setOffsets:OFFSET:OFFSET]; [box setTitle:title]; [box sizeToFit]; return box; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscExporterAccessoryView - (MiscExportFormat)format { return name_to_format( [formatPop title] ); } - (MiscExportTitleMode)rowTitleMode; { return name_to_row_title_mode( [rowTitlePop title] ); } - (MiscExportTitleMode)colTitleMode; { return name_to_col_title_mode( [colTitlePop title] ); } - (MiscExportGridMode)rowGrid; { return name_to_row_grid_mode( [rowGridPop title] ); } - (MiscExportGridMode)colGrid; { return name_to_col_grid_mode( [colGridPop title] ); } //----------------------------------------------------------------------------- // unifyWidths:: //----------------------------------------------------------------------------- - (NXCoord)unifyWidths:(View*)v1 :(View*)v2 { NXRect r1, r2; [v1 getFrame:&r1]; [v2 getFrame:&r2]; NXCoord w = r1.size.width > r2.size.width ? r1.size.width : r2.size.width; [v1 sizeTo:w:r1.size.height]; [v2 sizeTo:w:r2.size.height]; return w; } //----------------------------------------------------------------------------- // -initFrame:format:rowTitle:colTitle:rowGrid:colGrid: // // Layout of boxes containing pop-up lists is as follows: // // ******** FORMAT ******** // *ROW TITLES* *ROW GRID* // *COL TITLES* *COL GRID* // // The origin of the column titles box is at (0,BOX_SPACING) within the // accessory view. BOX_SPACING provides a needed gap between the bottom of // the column titles box and the standard buttons (Okay, Cancel) on the Save // Panel. //----------------------------------------------------------------------------- - (id)initFrame:(NXRect const*)rect format:(MiscExportFormat)format rowTitle:(MiscExportTitleMode)rowTitle colTitle:(MiscExportTitleMode)colTitle rowGrid:(MiscExportGridMode)rowGrid colGrid:(MiscExportGridMode)colGrid { [super initFrame:rect]; formatPop = new_popup( MISC_FORMAT_NAME, MISC_EXPORT_FORMAT_FIRST, MISC_EXPORT_FORMAT_LAST, format ); rowTitlePop = new_popup( MISC_TITLE_MODE_NAME, MISC_EXPORT_TITLES_FIRST, MISC_EXPORT_TITLES_LAST, rowTitle ); colTitlePop = new_popup( MISC_TITLE_MODE_NAME, MISC_EXPORT_TITLES_FIRST, MISC_EXPORT_TITLES_LAST, colTitle ); rowGridPop = new_popup( MISC_GRID_MODE_NAME, MISC_EXPORT_GRID_FIRST, MISC_EXPORT_GRID_LAST, rowGrid ); colGridPop = new_popup( MISC_GRID_MODE_NAME, MISC_EXPORT_GRID_FIRST, MISC_EXPORT_GRID_LAST, colGrid ); formatBox = new_box( formatPop, "Format" ); rowTitleBox = new_box( rowTitlePop, "Row Titles" ); colTitleBox = new_box( colTitlePop, "Column Titles" ); rowGridBox = new_box( rowGridPop, "Row Grid" ); colGridBox = new_box( colGridPop, "Column Grid" ); int const BOX_SPACING = 3; NXRect r; [formatBox getFrame:&r]; // Choose one box to represent NXCoord const boxHeight = r.size.height; // height of all boxes. NXCoord const titleWidth = [self unifyWidths:rowTitleBox:colTitleBox]; NXCoord const gridWidth = [self unifyWidths:rowGridBox :colGridBox ]; NXCoord const formatWidth = titleWidth + BOX_SPACING + gridWidth; NXCoord y = BOX_SPACING; [colTitleBox moveTo:0:y]; [colGridBox moveTo:titleWidth + BOX_SPACING:y]; y += boxHeight + BOX_SPACING; [rowTitleBox moveTo:0:y]; [rowGridBox moveTo:titleWidth + BOX_SPACING:y]; y += boxHeight + BOX_SPACING; [formatBox moveTo:0:y]; [formatBox sizeTo:formatWidth:boxHeight]; [self sizeTo:formatWidth:y + boxHeight]; [self addSubview:formatBox]; [self addSubview:rowTitleBox]; [self addSubview:colTitleBox]; [self addSubview:rowGridBox]; [self addSubview:colGridBox]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollEdit.M100444 1750 1750 32752 6757716157 23241 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollEdit.M // // Text cell editing support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollEdit.M,v 1.4 97/12/22 21:57:15 zarnuk Exp $ // $Log: MiscTableScrollEdit.M,v $ // Revision 1.4 97/12/22 21:57:15 zarnuk // v134: Added suspendEditing / resumeEditing. Eliminated delegate // -tableScroll:edit:at:: methods. // // Revision 1.3 97/06/10 05:49:00 sunshine // v127: Fixed bug: Was not returning 'nil' from -getRow:col:forPoint: when // point was out of bounds. // Fixed bug: Wasn't grabbing a copy of cell when initiating editing; only // referenced it. In lazy mode, scrolling around would cause the contents // of the referenced cell to change (even just the inital scroll-to-visible), // thus causing a bus-load of bugs. Now grabs copy of cell instead. // Fixed bug: Keyboard cursor was lagging behind as TAB was used to change // from cell to cell during editing. // First-responder is now returned to TableScroll when cell editing ends via // Return key, rather than reverting uselessly to the window. //----------------------------------------------------------------------------- #import "MiscTableScrollPrivate.h" #import "MiscTableBorder.h" #import "MiscTableView.h" extern "Objective-C" { #import #import } extern "C" { #import // malloc(), free() } typedef MiscDelegateFlags DF; @implementation MiscTableScroll(Edit) - (BOOL)isEditing { return editInfo.editing; } //----------------------------------------------------------------------------- // getCellFrame:at:: //----------------------------------------------------------------------------- - (id)getCellFrame:(NXRect*)rect at:(int)row :(int)col { [tableView getCellFrame:rect at:row:col]; [self convertRect:rect fromView:tableView]; return self; } //----------------------------------------------------------------------------- // getRow:andCol:forPoint: //----------------------------------------------------------------------------- - (id)getRow:(int*)row andCol:(int*)col forPoint:(NXPoint const*)point { NXPoint pt = *point; [tableView convertPoint:&pt fromView:self]; return ([tableView getRow:row andCol:col forPoint:&pt] != 0 ? self : 0); } //----------------------------------------------------------------------------- // resumeEditing //----------------------------------------------------------------------------- - (void)resumeEditing { if (editInfo.editing && --editInfo.suspended == 0) { int const row = editInfo.row; int const col = editInfo.col; Text* const editor = [[self window] getFieldEditor:YES for:self]; [editor setOpaque:YES]; editInfo.editor = editor; id const cell = editInfo.cell; NXRect rect; [tableView getCellInside:&rect at:row:col]; [tableView scrollRectToVisible:&rect]; char const* const s = [cell stringValue]; int const len = (s != 0 ? strlen(s) : 0); [cell select:&rect inView:tableView editor:editor delegate:self start:0 length:len]; [editor display]; [self setClickedRow:row col:col]; } } //----------------------------------------------------------------------------- // suspendEditing //----------------------------------------------------------------------------- - (void)suspendEditing { if (editInfo.editing && editInfo.suspended++ == 0) { Text* const editor = editInfo.editor; int const len = [editor textLength] + 1; char* const s = (char*) malloc( len ); [editor getSubstring:s start:0 length:len]; [editInfo.cell endEditing:editor]; [editInfo.cell setStringValueNoCopy:s shouldFree:YES]; editInfo.editor = 0; } } //----------------------------------------------------------------------------- // cleanupEditing //----------------------------------------------------------------------------- - (void)cleanupEditing { [editInfo.cell free]; editInfo.cell = 0; editInfo.editor = 0; editInfo.editing = NO; editInfo.suspended = 0; } //----------------------------------------------------------------------------- // finishEditing //----------------------------------------------------------------------------- - (BOOL)finishEditing { if ([self isEditing] && [window makeFirstResponder:window]) [window endEditingFor:editInfo.editor]; return ![self isEditing]; } //----------------------------------------------------------------------------- // abortEditing //----------------------------------------------------------------------------- - (void)abortEditing { if (editInfo.editing) { editInfo.editing = NO; int const r = editInfo.row; int const c = editInfo.col; if (editInfo.editor != 0) [editInfo.cell endEditing:editInfo.editor]; [self cleanupEditing]; id d; if ((d = [self responsibleDelegate:DF::DEL_ABORT_EDIT_AT]) != 0) [d tableScroll:self abortEditAt:r:c]; if ((d = [self responsibleDelegate:DF::DEL_DID_EDIT_AT]) != 0) [d tableScroll:self didEdit:NO at:r:c]; [self drawCellAt:r:c]; } } //----------------------------------------------------------------------------- // getNext:editRow:andCol: //----------------------------------------------------------------------------- - (BOOL)getNext:(BOOL)foreward editRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col { MiscCoord_P pr = *p_row; MiscCoord_P pc = *p_col; MiscTableBorder const* const br = rowInfo.border; MiscTableBorder const* const bc = colInfo.border; MiscCoord_V const v_row = br->physicalToVisual( pr ); // Start pos. MiscCoord_V const v_col = bc->physicalToVisual( pc ); MiscCoord_V vr = v_row; MiscCoord_V vc = v_col; do { if (foreward) { if (++vc >= num_cols) { vc = 0; if (++vr >= num_rows) vr = 0; pr = br->visualToPhysical( vr ); } } else { if (--vc < 0) { vc = num_cols - 1; if (--vr < 0) vr = num_rows - 1; pr = br->visualToPhysical( vr ); } } if (vc == v_col && vr == v_row) // Wrapped to start pos. return NO; pc = bc->visualToPhysical( vc ); } while (![self canEdit:0 at:pr:pc]); *p_row = pr; *p_col = pc; return YES; } //----------------------------------------------------------------------------- // getPreviousEditRow:andCol: //----------------------------------------------------------------------------- - (BOOL)getPreviousEditRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col { return [self getNext:NO editRow:p_row andCol:p_col]; } //----------------------------------------------------------------------------- // getNextEditRow:andCol: //----------------------------------------------------------------------------- - (BOOL)getNextEditRow:(MiscCoord_P*)p_row andCol:(MiscCoord_P*)p_col { return [self getNext:YES editRow:p_row andCol:p_col]; } //----------------------------------------------------------------------------- // textDidEnd:endChar: //----------------------------------------------------------------------------- - (id)textDidEnd:(id)sender endChar:(unsigned short)whyEnd { id d; editInfo.editing = NO; int const len = [sender textLength] + 1; char* const s = (char*) malloc( len ); [sender getSubstring:s start:0 length:len]; [editInfo.cell endEditing:editInfo.editor]; int const r = editInfo.row; int const c = editInfo.col; char const* const t = [self stringValueAt:r:c]; BOOL changed = (strcmp( s, (t != 0 ? t : "") ) != 0); if (changed) { if ((d = [self responsibleDelegate:DF::DEL_SET_STRINGVALUE_AT]) != 0) changed = [d tableScroll:self setStringValue:s at:r:c]; else [[self cellAt:r:c] setStringValue:s]; } free(s); [self cleanupEditing]; if ((d = [self responsibleDelegate:DF::DEL_DID_EDIT_AT]) != 0) [d tableScroll:self didEdit:changed at:r:c]; [self drawCellAt:r:c]; if (changed) { if ([self autoSortRows]) [self sortRow:r]; if ([self autoSortCols]) [self sortCol:c]; } if ((d = [self responsibleDelegate:DF::DEL_TEXT_DID_END]) != 0) [d textDidEnd:sender endChar:whyEnd]; else { MiscCoord_P row = (MiscCoord_P) r; MiscCoord_P col = (MiscCoord_P) c; switch (whyEnd) { case NX_RETURN: [self selectText:self]; [self sendAction]; break; case NX_TAB: if ([self getNext:YES editRow:&row andCol:&col]) [self editCellAt:row:col]; else [[self nextText] selectText:self]; break; case NX_BACKTAB: if ([self getNext:NO editRow:&row andCol:&col]) [self editCellAt:row:col]; else [[self previousText] selectText:self]; break; // FIXME: CTRL-TAB => nextText, CTRL-SHIFT-TAB => previousText default: break; } } return self; } //----------------------------------------------------------------------------- // textDidChange: //----------------------------------------------------------------------------- - (id)textDidChange:(id)sender { id d = [self responsibleDelegate:DF::DEL_TEXT_DID_CHANGE]; if (d != 0) [d textDidChange:sender]; return self; } //----------------------------------------------------------------------------- // textDidGetKeys:isEmpty: //----------------------------------------------------------------------------- - (id)textDidGetKeys:(id)sender isEmpty:(BOOL)flag { id d = [self responsibleDelegate:DF::DEL_TEXT_DID_GET_KEYS]; if (d != 0) [d textDidGetKeys:sender isEmpty:flag]; return self; } //----------------------------------------------------------------------------- // textWillChange: //----------------------------------------------------------------------------- - (BOOL)textWillChange:(id)sender { id d = [self responsibleDelegate:DF::DEL_TEXT_WILL_CHANGE]; if (d != 0) return [d textWillChange:sender]; return NO; // allow change (reverse boolean logic) } //----------------------------------------------------------------------------- // textWillEnd: //----------------------------------------------------------------------------- - (BOOL)textWillEnd:(id)sender { id d = [self responsibleDelegate:DF::DEL_TEXT_WILL_END]; if (d != 0) return [d textWillEnd:sender]; return NO; // allow end-of-editing (reverse boolean logic) } //----------------------------------------------------------------------------- // edit:at:: //----------------------------------------------------------------------------- - (void)edit:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col { id d; if ((d = [self responsibleDelegate:DF::DEL_WILL_EDIT_AT]) != 0) [d tableScroll:self willEditAt:row:col]; id const cell = [[self cellAt:row:col] copyFromZone:[self zone]]; id const editor = [[self window] getFieldEditor:YES for:self]; [editor setOpaque:YES]; editInfo.editing = YES; editInfo.row = row; editInfo.col = col; editInfo.editor = editor; editInfo.cell = cell; NXRect rect; [tableView getCellInside:&rect at:row:col]; [tableView scrollRectToVisible:&rect]; if (ev != 0) { NXEvent tmp = *ev; [cell edit:&rect inView:tableView editor:editor delegate:self event:&tmp]; } else { char const* const s = [cell stringValue]; int const len = (s != 0 ? strlen(s) : 0); [cell select:&rect inView:tableView editor:editor delegate:self start:0 length:len]; } } //----------------------------------------------------------------------------- // canEdit:at:: //----------------------------------------------------------------------------- - (BOOL)canEdit:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col { id d = [self responsibleDelegate:DF::DEL_CAN_EDIT_AT]; if (d != 0) return [d tableScroll:self canEdit:ev at:row:col]; id const cell = [self cellAt:row:col]; if ([cell respondsTo:@selector(tableScroll:canEdit:at: :)]) return [cell tableScroll:self canEdit:ev at:row:col]; return (ev == 0 || ev->data.mouse.click == 2) && [cell respondsTo:@selector(isEditable)] && [cell respondsTo:@selector(isEnabled)] && [cell isEditable] && [cell isEnabled]; } //----------------------------------------------------------------------------- // editIfAble:at:: //----------------------------------------------------------------------------- - (BOOL)editIfAble:(NXEvent const*)ev at:(MiscCoord_P)row :(MiscCoord_P)col { if ([self canEdit:ev at:row:col]) { [self edit:ev at:row:col]; return YES; } return NO; } //----------------------------------------------------------------------------- // editCellAt:: //----------------------------------------------------------------------------- - (void)editCellAt:(MiscCoord_P)row :(MiscCoord_P)col { [self clearSelection]; if ([self trackingBy] == MISC_ROW_BORDER) { [self selectRow:row]; [self setCursorRow:row]; } else { [self selectCol:col]; [self setCursorCol:col]; } [self setClickedRow:row col:col]; [self edit:0 at:row:col]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollIO.M100444 1750 1750 24374 6757716157 22664 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollIO.M // // Input and Output (IO) methods for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollIO.M,v 1.2 98/03/24 04:47:32 sunshine Exp $ // $Log: MiscTableScrollIO.M,v $ // Revision 1.2 98/03/24 04:47:32 sunshine // v138: Removed many unnecessary header imports. // // Revision 1.1 97/12/19 01:06:28 zarnuk // v133: Broke off MiscTableScrollIO.M. New storage layout. //----------------------------------------------------------------------------- #import #import "MiscCornerView.h" #import "MiscDelegateFlags.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import extern "Objective-C" { #import } @implementation MiscTableScroll(IO) //----------------------------------------------------------------------------- // - awakeFromNib //----------------------------------------------------------------------------- - (id)awakeFromNib { delegateFlags->setDelegate( [self delegate] ); dataDelegateFlags->setDelegate( [self dataDelegate] ); return self; } //----------------------------------------------------------------------------- // - read:selector: //----------------------------------------------------------------------------- - (SEL)read:(int)ver selector:(NXTypedStream*)stream { SEL cmd = 0; char* str; NXReadType( stream, @encode(char*), &str ); if (str != 0) { if (*str != '\0') cmd = sel_getUid( str ); free( str ); } return cmd; } //----------------------------------------------------------------------------- // - read:cornerTitle:globalInfo: // NOTE: Cannot archive sort_entry_func and sort_slot_func because they // are function addresses. //----------------------------------------------------------------------------- - (void)read:(int)ver cornerTitle:(char**)p globalInfo:(NXTypedStream*)stream { NXReadType( stream, @encode(int), &tag ); NXReadType( stream, @encode(BOOL), &enabled ); NXReadType( stream, @encode(BOOL), &lazy ); if (ver < MISC_TS_VERSION_2) drawClippedText = NO; else NXReadType( stream, @encode(BOOL), &drawClippedText ); NXReadType( stream, @encode(MiscSelectionMode), &mode ); font = NXReadObject( stream ); textColor = NXReadColor( stream ); backgroundColor = NXReadColor( stream ); highlightTextColor = NXReadColor( stream ); highlightBackgroundColor = NXReadColor( stream ); nextText = NXReadObject( stream ); previousText= NXReadObject( stream ); delegate = NXReadObject( stream ); dataDelegate= NXReadObject( stream ); target = NXReadObject( stream ); doubleTarget= NXReadObject( stream ); action = [self read:ver selector:stream]; doubleAction = [self read:ver selector:stream]; if (ver < MISC_TS_VERSION_2) *p = 0; else NXReadType( stream, @encode(char*), p ); } //----------------------------------------------------------------------------- // - read:border:stream: //----------------------------------------------------------------------------- - (void)read:(int)ver border:(MiscBorderInfo*)p stream:(NXTypedStream*)stream { NXZone* const z = [self zone]; int n; if (p->sort_vector != 0) NXZoneFree( z, p->sort_vector ); NXReadType( stream, @encode(int), &(n) ); if (n > 0) { p->sort_vector_len = n; p->sort_vector = (int*) NXZoneMalloc( z, n * sizeof(int) ); for (int i = 0; i < n; i++) NXReadType( stream, @encode(int), &(p->sort_vector[i]) ); } else { p->sort_vector_len = 0; p->sort_vector = 0; } NXReadType( stream, @encode(BOOL), &(p->isOn) ); NXReadType( stream, @encode(BOOL), &(p->autoSort) ); if (ver < MISC_TS_VERSION_2) { BOOL b; NXReadType( stream, @encode(BOOL), &b ); // obsolete. NXReadType( stream, @encode(BOOL), &b ); } if (p->border == 0) p->border = new( NXZoneMalloc( z, sizeof(*(p->border)) ) ) MiscTableBorder( MISC_ROW_BORDER ); p->border->read( stream, ver ); } //----------------------------------------------------------------------------- // - read:cells: // FIXME: What happens when a non-empty non-lazy TableScroll reads the data // from a lazy, empty one. Does the memory get freed? //----------------------------------------------------------------------------- - (void)read:(int)ver cells:(NXTypedStream*)stream { NXReadType( stream, @encode(int), &num_cols ); NXReadType( stream, @encode(int), &num_rows ); if (lazy) { max_rows = 0; // No rows have been allocated. max_cells = 0; cells = 0; } else // (!lazy) { max_rows = num_rows; max_cells = max_rows * num_cols; if (max_cells == 0) cells = 0; else { int const nbytes = max_cells * sizeof(*cells); cells = (id*) NXZoneMalloc( [self zone], nbytes ); id* p = cells; for (int r = 0; r < num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = NXReadObject( stream ); } } } //----------------------------------------------------------------------------- // - read: //----------------------------------------------------------------------------- - (id)read:(NXTypedStream*)stream { [super read:stream]; char const* class_name = [[MiscTableScroll class] name]; int ver = NXTypedStreamClassVersion( stream, class_name ); if (((unsigned int)ver) > ((unsigned int)MISC_TS_VERSION)) [self error:"%s: old library (version %d), can't -read: " "new object (version %d).\n", class_name, MISC_TS_VERSION, ver ]; char* s = 0; [self read:ver cornerTitle:&s globalInfo:stream]; [self read:ver border:&colInfo stream:stream]; [self read:ver border:&rowInfo stream:stream]; [self read:ver cells:stream]; [self doInit:ver cornerTitle:s]; if (s != 0) free( s ); return self; } //----------------------------------------------------------------------------- // - writeSelector:stream: //----------------------------------------------------------------------------- - (void)writeSelector:(SEL)cmd stream:(NXTypedStream*)stream { char const* str = 0; if (cmd != 0) str = sel_getName( cmd ); if (str == 0) // not an 'else if' str = ""; NXWriteType( stream, @encode(char*), &str ); } //----------------------------------------------------------------------------- // - writeGlobalInfo: // NOTE: Cannot archive sort_entry_func and sort_slot_func because they // are function addresses. //----------------------------------------------------------------------------- - (void)writeGlobalInfo:(NXTypedStream*)stream { NXWriteType( stream, @encode(int), &tag ); NXWriteType( stream, @encode(BOOL), &enabled ); NXWriteType( stream, @encode(BOOL), &lazy ); NXWriteType( stream, @encode(BOOL), &drawClippedText ); NXWriteType( stream, @encode(MiscSelectionMode), &mode ); NXWriteObject( stream, font ); NXWriteColor( stream, textColor ); NXWriteColor( stream, backgroundColor ); NXWriteColor( stream, highlightTextColor ); NXWriteColor( stream, highlightBackgroundColor ); NXWriteObjectReference( stream, nextText ); NXWriteObjectReference( stream, previousText ); NXWriteObjectReference( stream, delegate ); NXWriteObjectReference( stream, dataDelegate ); NXWriteObjectReference( stream, target ); NXWriteObjectReference( stream, doubleTarget ); [self writeSelector: action stream: stream]; [self writeSelector: doubleAction stream: stream]; char const* const s = [self cornerTitle]; NXWriteType( stream, @encode(char*), &s ); } //----------------------------------------------------------------------------- // - writeBorder:stream: //----------------------------------------------------------------------------- - (void)writeBorder:(MiscBorderInfo*)p stream:(NXTypedStream*)stream { int const n = p->sort_vector_len; NXWriteType( stream, @encode(int), &(n) ); if (n > 0) for (int i = 0; i < n; i++) NXWriteType( stream, @encode(int), &(p->sort_vector[i]) ); NXWriteType( stream, @encode(BOOL), &(p->isOn) ); NXWriteType( stream, @encode(BOOL), &(p->autoSort) ); p->border->write( stream ); } //----------------------------------------------------------------------------- // - writeCells: //----------------------------------------------------------------------------- - (void)writeCells:(NXTypedStream*)stream { NXWriteType( stream, @encode(int), &num_cols ); NXWriteType( stream, @encode(int), &num_rows ); if (!lazy) for (int r = 0; r < num_rows; r++) for (int c = 0; c < num_cols; c++) NXWriteObject( stream, [self cellAt:r:c] ); } //----------------------------------------------------------------------------- // - write: //----------------------------------------------------------------------------- - (id)write:(NXTypedStream*)stream { // Ensure that subviews are NOT archived. if (colInfo.isOn) [colInfo.clip removeFromSuperview]; if (rowInfo.isOn) [rowInfo.clip removeFromSuperview]; if (rowInfo.isOn && colInfo.isOn) [cornerView removeFromSuperview]; [tableView removeFromSuperview]; [super write:stream]; [self writeGlobalInfo:stream]; [self writeBorder:&colInfo stream:stream]; [self writeBorder:&rowInfo stream:stream]; [self writeCells:stream]; // Restore state. [self setDocView: tableView]; if (colInfo.isOn) [self addSubview:colInfo.clip]; if (rowInfo.isOn) [self addSubview:rowInfo.clip]; if (rowInfo.isOn && colInfo.isOn) [self addSubview:cornerView]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollInspector.M100444 1750 1750 56375 6757716157 24331 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollInspector.M // // Interface Builder inspector for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollInspector.M,v 1.14 99/06/29 07:52:00 sunshine Exp $ // $Log: MiscTableScrollInspector.M,v $ // Revision 1.14 99/06/29 07:52:00 sunshine // v140: Converted slot list from matrix of button cells to MiscTableScroll. // Reworked color controls so user can preview color combinations. Added // two text fields; one which previews foreground and background colors for // unselected slots, and one for selected slots. This makes better use of // screen real-estate. // // Revision 1.13 98/02/17 14:14:14 zarnuk // v135: Fixed v130 bug: up/down arrows stopped working. // // Revision 1.12 97/12/19 13:57:46 zarnuk // v133: Moved the images into the nib directory itself. //----------------------------------------------------------------------------- #import "MiscTableScrollInspector.h" #import "MiscTableBorder.h" #import //============================================================================= // IB-ONLY METHODS FOR MiscTableScroll //============================================================================= @interface MiscTableScroll(IB) - (char const*)getInspectorClassName; - (id)editSelf:(id)sender in:(id)owner; @end @implementation MiscTableScroll(IB) - (char const*)getInspectorClassName { return "MiscTableScrollInspector"; } // Prevent IB from allowing double-click to edit Scroll View - (id)editSelf:(id)sender in:(id)owner { return 0; } @end //============================================================================= // CONVENIENCE CATAGORIES //============================================================================= @interface Matrix(MiscPopUpList) - (int)popUpTag; @end @implementation Matrix(MiscPopUpList) - (int)popUpTag { return [[self selectedCell] tag]; } @end @interface Button(MiscPopUpList) - (int)popUpTag; - (void)setPopUpTag:(int)new_tag; @end @implementation Button(MiscPopUpList) - (int)popUpTag { id popUp = [self target]; return [[[popUp itemList] selectedCell] tag]; } - (void)setPopUpTag:(int)new_tag { id popUp = [self target]; Matrix* matrix = [popUp itemList]; MenuCell* m_cell = [matrix findCellWithTag: new_tag]; [matrix selectCell: m_cell]; [self setTitle: [m_cell title]]; } @end //============================================================================= // IMPLEMENTATION //============================================================================= @interface MiscTableScrollInspector(Forward) - (id)doSlot:(id)sender; - (id)doTitleMode:(id)sender; @end @implementation MiscTableScrollInspector - (BOOL) wantsButtons { return NO; } - (id)ok:(id)sender { return [super ok:sender]; } //----------------------------------------------------------------------------- // initSlotScroll //----------------------------------------------------------------------------- - (void)initSlotScroll { [slotScroll setAutoSortRows:NO]; [slotScroll setSelectionMode:MISC_RADIO_MODE]; [slotScroll setDraggableCols:NO]; [slotScroll setDelegate:self]; [slotScroll setTarget:self]; [slotScroll setAction:@selector(doSlot:)]; [slotScroll addCol]; [slotScroll setCol:0 title:"Slots"]; [slotScroll setCol:0 autosize:YES]; [slotScroll setNextText:[uniformSizeField nextText]]; [uniformSizeField setNextText:slotScroll]; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; char buf[ MAXPATHLEN + 1 ]; id bundle = [NXBundle bundleForClass: [MiscTableScrollInspector class]]; [bundle getPath: buf forResource: [[self class] name] ofType: "nib"]; [NXApp loadNibFile: buf owner: self withNames: NO fromZone: [self zone]]; [self initSlotScroll]; border_type = MISC_COL_BORDER; dirty = NO; return self; } //----------------------------------------------------------------------------- // setTitleControls //----------------------------------------------------------------------------- - (void)setTitleControls { if ([object borderTitlesOn:border_type]) { [titlesSwitch setState:1]; [[sizableSwitch setEnabled: YES] setState:border->isSizeable()]; [[draggableSwitch setEnabled:YES] setState:border->isDraggable()]; [[titleModePopUp setEnabled:YES] setPopUpTag:(int)[object borderTitleMode:border_type]]; } else { [titlesSwitch setState:0]; [[sizableSwitch setEnabled:NO] setState:0]; [[draggableSwitch setEnabled:NO] setState:0]; [[titleModePopUp setEnabled:NO] setPopUpTag:(int)[object borderTitleMode:border_type]]; } [[uniformSizeField setEnabled: YES] setIntValue: int([object uniformSizeSlots:border_type])]; } //----------------------------------------------------------------------------- // fillScroll //----------------------------------------------------------------------------- - (void)fillScroll { [window disableFlushWindow]; num_slots = [object numSlots:border_type]; if (num_slots == 0) [slotScroll empty]; else { [slotScroll renewRows:num_slots]; for (int i = 0; i < num_slots; i++) { int const pslot = [object border:border_type slotAtPosition:i]; [[slotScroll cellAt:i:0] setStringValue:[object border:border_type slotTitle:pslot]]; } } [slotScroll sizeToCells]; [slotScroll display]; if (num_slots > 0) { if (slot < 0) slot = 0; [slotScroll selectRow:slot]; [slotScroll scrollRowToVisible:slot]; } else { slot = -1; } [self doSlot:self]; [[window reenableFlushWindow] flushWindow]; } //----------------------------------------------------------------------------- // doEnabled: //----------------------------------------------------------------------------- - (id)doEnabled:(id)sender { [object setEnabled: [enabledSwitch state]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doLazy: //----------------------------------------------------------------------------- - (id)doLazy:(id)sender { [object setLazy: [lazySwitch state]]; [self ok:sender]; [self revert:self]; return self; } //----------------------------------------------------------------------------- // doMode: //----------------------------------------------------------------------------- - (id)doMode:(id)sender { [object setSelectionMode: MiscSelectionMode([modePopUp popUpTag])]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doBorder: //----------------------------------------------------------------------------- - (id)doBorder:(id)sender { MiscBorderType bt = MiscBorderType([borderPopUp popUpTag]); if (bt != border_type) { border_type = bt; [self revert:sender]; } return self; } //----------------------------------------------------------------------------- // doTitles: //----------------------------------------------------------------------------- - (id)doTitles:(id)sender { BOOL const isOn = [titlesSwitch state]; [object border:border_type setTitlesOn:isOn]; [self setTitleControls]; [self doSlot:self]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doSizable: //----------------------------------------------------------------------------- - (id)doSizable:(id)sender { [object border:border_type setSizeableSlots:[sizableSwitch state]]; [self doSlot:0]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doDraggable: //----------------------------------------------------------------------------- - (id)doDraggable:(id)sender { [object border:border_type setDraggableSlots:[draggableSwitch state]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doAutoSort: //----------------------------------------------------------------------------- - (id)doAutoSort:(id)sender { [object border:border_type setAutoSortSlots:[autoSortSwitch state]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doTitleMode: //----------------------------------------------------------------------------- - (id)doTitleMode:(id)sender { [object border:border_type setTitleMode: (MiscTableTitleMode) [titleModePopUp popUpTag]]; [self fillScroll]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doDelete: //----------------------------------------------------------------------------- - (id)doDelete:(id)sender { [object border:border_type deleteSlotAt:[object border:border_type slotAtPosition:slot]]; [object tile]; [object display]; slot--; num_slots--; if (slot < 0 && num_slots > 0) slot = 0; [self fillScroll]; [self ok:sender]; return self; } //----------------------------------------------------------------------------- // doNew: //----------------------------------------------------------------------------- - (id)doNew:(id)sender { [object addSlot:border_type]; [object sizeToCells]; slot = num_slots; [self fillScroll]; [titleField selectText:0]; [self ok:sender]; return self; } //----------------------------------------------------------------------------- // doUserSizeable: //----------------------------------------------------------------------------- - (id)doUserSizeable:(id)sender { [object border:border_type setSlot:[object border:border_type slotAtPosition:slot] sizeable:[userSizeableSwitch state]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doAlign: //----------------------------------------------------------------------------- - (id)doAlign:(id)sender { int const pslot = [object border:border_type slotAtPosition:slot]; if ([object border:border_type slotCellType:pslot] == MISC_TABLE_CELL_TEXT) { id const proto = [object border:border_type slotCellPrototype:pslot]; id const cell = [alignMatrix selectedCell]; [proto setAlignment:[cell tag]]; } return [self ok:sender]; } //----------------------------------------------------------------------------- // doAutosize: //----------------------------------------------------------------------------- - (id)doAutosize:(id)sender { [object border:border_type setSlot:[object border:border_type slotAtPosition:slot] autosize:[autosizeSwitch state]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doCellClass: //----------------------------------------------------------------------------- - (id)doCellClass:(id)sender { int const pslot = [object border:border_type slotAtPosition:slot]; int const old_val = (int)[object border:border_type slotCellType:pslot]; int const new_val = [cellClassPopUp popUpTag]; if (old_val != new_val) { [object border:border_type setSlot:pslot cellType: (MiscTableCellStyle) new_val]; if (new_val == MISC_TABLE_CELL_TEXT) { [alignTitle setTextColor:NX_COLORBLACK]; [alignMatrix setEnabled:YES]; id const cell = [object border:border_type slotCellPrototype:pslot]; [alignMatrix selectCellWithTag:[cell alignment]]; } else if (old_val == MISC_TABLE_CELL_TEXT) { [alignTitle setTextColor:NX_COLORDKGRAY]; [alignMatrix setEnabled:NO]; } } return [self ok:sender]; } //----------------------------------------------------------------------------- // doSortType: //----------------------------------------------------------------------------- - (id)doSortType:(id)sender { [object border:border_type setSlot:[object border:border_type slotAtPosition:slot] sortType: (MiscSortType) [sortTypePopUp popUpTag]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doSortDirection: //----------------------------------------------------------------------------- - (id)doSortDirection:(id)sender { [object border:border_type setSlot:[object border:border_type slotAtPosition:slot] sortDirection: (MiscSortDirection) [sortDirectionPopUp popUpTag]]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doSlot: //----------------------------------------------------------------------------- - (id)doSlot:(id)sender { slot = [slotScroll selectedRow]; if (slot >= 0) { BOOL const titlesOn = [object borderTitlesOn:border_type]; BOOL const notUniform = ([object uniformSizeSlots:border_type] == 0); int pslot = [object border:border_type slotAtPosition:slot]; [deleteButton setEnabled:YES]; [upButton setEnabled:(slot > 0)]; [downButton setEnabled:(slot < num_slots - 1)]; int const ctype = (int)[object border:border_type slotCellType:pslot]; [[cellClassPopUp setEnabled:YES] setPopUpTag:ctype]; [[sortTypePopUp setEnabled:YES] setPopUpTag: (int)[object border:border_type slotSortType:pslot]]; [[sortDirectionPopUp setEnabled:YES] setPopUpTag: (int)[object border:border_type slotSortDirection:pslot]]; if (ctype == MISC_TABLE_CELL_TEXT) { [alignTitle setTextColor:NX_COLORBLACK]; [alignMatrix setEnabled:YES]; id const cell = [object border:border_type slotCellPrototype:pslot]; [alignMatrix selectCellWithTag:[cell alignment]]; } else { [alignTitle setTextColor:NX_COLORDKGRAY]; [alignMatrix setEnabled:NO]; } [[autosizeSwitch setEnabled:notUniform] setState:[object border:border_type slotIsAutosize:pslot]]; BOOL const enabled = titlesOn && notUniform && [object sizeableSlots:border_type]; [[userSizeableSwitch setEnabled: enabled] setState: enabled && [object border:border_type slotIsSizeable:pslot]]; [[sizeField setEnabled:notUniform] setIntValue: (int)[object border:border_type slotSize:pslot]]; [[sizeMinField setEnabled:notUniform] setIntValue: (int)[object border:border_type slotMinSize:pslot]]; [[sizeMaxField setEnabled:notUniform] setIntValue: (int)[object border:border_type slotMaxSize:pslot]]; [[titleField setEnabled: titlesOn && ([object borderTitleMode:border_type] == MISC_CUSTOM_TITLE)] setStringValue: [object border:border_type slotTitle:pslot]]; } else { [deleteButton setEnabled:NO]; [upButton setEnabled:NO]; [downButton setEnabled:NO]; [[cellClassPopUp setEnabled:NO] setPopUpTag:0]; [[sortTypePopUp setEnabled:NO] setPopUpTag:0]; [[sortDirectionPopUp setEnabled:NO] setPopUpTag:0]; [alignTitle setTextColor:NX_COLORDKGRAY]; [alignMatrix setEnabled:NO]; [alignMatrix selectCellWithTag:0]; [[autosizeSwitch setEnabled:NO] setState:0]; [[userSizeableSwitch setEnabled:NO] setState:0]; [[sizeField setEnabled:NO] setStringValue:""]; [[sizeMinField setEnabled:NO] setStringValue:""]; [[sizeMaxField setEnabled:NO] setStringValue:""]; [[titleField setEnabled:NO] setStringValue:""]; } return self; } //----------------------------------------------------------------------------- // swapSlots:: //----------------------------------------------------------------------------- - (void)swapSlots:(int)from_slot :(int)to_slot { border->swapSlots( from_slot, to_slot ); [object display]; slot = to_slot; [self fillScroll]; [self ok:self]; } //----------------------------------------------------------------------------- // doUp: //----------------------------------------------------------------------------- - (id)doUp:(id)sender { if (slot > 0) [self swapSlots:slot :slot-1]; return self; } //----------------------------------------------------------------------------- // doDown: //----------------------------------------------------------------------------- - (id)doDown:(id)sender { if (slot < num_slots - 1) [self swapSlots:slot :slot+1]; return self; } //----------------------------------------------------------------------------- // get_pslot // Get the physical slot-id of the current slot. //----------------------------------------------------------------------------- - (int) get_pslot { return [object border:border_type slotAtPosition:slot]; } //----------------------------------------------------------------------------- // textDidChange: //----------------------------------------------------------------------------- - (id)textDidChange:(id)sender { dirty = YES; return [super textDidChange:sender]; } //----------------------------------------------------------------------------- // textDidEnd:endChar: //----------------------------------------------------------------------------- - (id)textDidEnd:(id)sender endChar:(unsigned short)whyEnd { if (dirty) { dirty = NO; id field = 0; if ([sender respondsTo:@selector(delegate)]) field = [sender delegate]; if (field == (id)titleField) { int const pslot = [self get_pslot]; [object border:border_type setSlot:pslot title:[titleField stringValue]]; [[slotScroll cellAt:slot:0] setStringValue:[titleField stringValue]]; [slotScroll drawCellAt:slot:0]; } else if (field == (id)uniformSizeField) { int old_size = (int) [object uniformSizeSlots:border_type]; int new_size = [uniformSizeField intValue]; if (new_size != 0) { if (new_size < MISC_MIN_PIXELS_SIZE) new_size = MISC_MIN_PIXELS_SIZE; if (new_size > MISC_MAX_PIXELS_SIZE) new_size = MISC_MAX_PIXELS_SIZE; [uniformSizeField setIntValue:new_size]; } if (old_size != new_size) { [object border:border_type setUniformSizeSlots:(NXCoord)new_size]; [self ok:sender]; [self revert:0]; } } else if (field == (id)sizeField) { int const pslot = [self get_pslot]; int i = [sizeField intValue]; int const imin = (int)[object border:border_type slotMinSize:pslot]; int const imax = (int)[object border:border_type slotMaxSize:pslot]; if (i < imin || i > imax) { if (i < imin) i = imin; if (i > imax) i = imax; [sizeField setIntValue:i]; } [object border:border_type setSlot:pslot size:(NXCoord)i]; } else if (field == (id)sizeMinField) { int const pslot = [self get_pslot]; int const i = (int)[object border:border_type slotSize:pslot]; int imin = [sizeMinField intValue]; int const imax = (int)[object border:border_type slotMaxSize:pslot]; if (imin < MISC_MIN_PIXELS_SIZE) imin = MISC_MIN_PIXELS_SIZE; else if (imin > imax) imin = imax; if (imin > i) // Not an 'else if' imin = i; [sizeMinField setIntValue:imin]; [object border:border_type setSlot:pslot minSize:(NXCoord)imin]; } else if (field == (id)sizeMaxField) { int const pslot = [self get_pslot]; int const i = (int)[object border:border_type slotSize:pslot]; int const imin = (int)[object border:border_type slotMinSize:pslot]; int imax = [sizeMaxField intValue]; if (imax > MISC_MAX_PIXELS_SIZE) imax = MISC_MAX_PIXELS_SIZE; else if (imax < imin) imax = imin; if (imax < i) // Not an 'else if' imax = i; [sizeMaxField setIntValue:imax]; [object border:border_type setSlot:pslot maxSize:(NXCoord)imax]; } [self ok: sender]; } return self; } //----------------------------------------------------------------------------- // doColorText //----------------------------------------------------------------------------- - (id)doColorText:(id)sender { NXColor const c = [sender color]; [object setTextColor:c]; [sampleTextNormal setTextColor:c]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doColorBack //----------------------------------------------------------------------------- - (id)doColorBack:(id)sender { NXColor const c = [sender color]; [object setBackgroundColor:c]; [sampleTextNormal setBackgroundColor:c]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doColorTextHighlighted //----------------------------------------------------------------------------- - (id)doColorTextHighlighted:(id)sender { NXColor const c = [sender color]; [object setHighlightTextColor:c]; [sampleTextHighlight setTextColor:c]; return [self ok:sender]; } //----------------------------------------------------------------------------- // doColorBackHighlighted //----------------------------------------------------------------------------- - (id)doColorBackHighlighted:(id)sender { NXColor const c = [sender color]; [object setHighlightBackgroundColor:c]; [sampleTextHighlight setBackgroundColor:c]; return [self ok:sender]; } //----------------------------------------------------------------------------- // -FG::: //----------------------------------------------------------------------------- - (void)FG:(NXColor)c :(TextField*)f :(NXColorWell*)w { [f setTextColor:c]; [w setColor:c]; } //----------------------------------------------------------------------------- // -BG::: //----------------------------------------------------------------------------- - (void)BG:(NXColor)c :(TextField*)f :(NXColorWell*)w { [f setBackgroundColor:c]; [w setColor:c]; } //----------------------------------------------------------------------------- // revert: //----------------------------------------------------------------------------- - (id)revert:(id)sender { dirty = NO; [super revert: sender]; [window disableFlushWindow]; border = [object border:border_type]; [autoSortSwitch setState:[object autoSortSlots:border_type]]; [self setTitleControls]; [enabledSwitch setState: [object isEnabled]]; [lazySwitch setState: [object isLazy]]; [modePopUp setPopUpTag:(int) [object selectionMode]]; [self FG:[object textColor]:sampleTextNormal:colorText]; [self BG:[object backgroundColor]:sampleTextNormal:colorBack]; [self FG:[object highlightTextColor]:sampleTextHighlight: colorTextHighlight]; [self BG:[object highlightBackgroundColor]:sampleTextHighlight: colorBackHighlight]; slot = -1; [self fillScroll]; id fr = [window firstResponder]; if (fr == 0 || fr == window) [titleField selectText: self]; [[window reenableFlushWindow] flushWindow]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollInspector.h100444 1750 1750 6727 6757716160 24332 0ustar sunshinesunshine#ifndef __MiscTableScrollInspector_h #define __MiscTableScrollInspector_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollInspector.h // // Interface Builder inspector for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollInspector.h,v 1.5 99/06/29 07:52:03 sunshine Exp $ // $Log: MiscTableScrollInspector.h,v $ // Revision 1.5 99/06/29 07:52:03 sunshine // v140: Converted slot list from matrix of button cells to MiscTableScroll. // Reworked color controls so user can preview color combinations. Added // two text fields; one which previews foreground and background colors for // unselected slots, and one for selected slots. This makes better use of // screen real-estate. // // Revision 1.4 97/12/19 13:12:04 zarnuk // v133: Eliminated constrain-max, constrain-min is now implicit based on // presence/absence of auto-size slots. Eliminated data-sizing. // Added alignment control. // // Revision 1.3 95/10/03 23:20:07 zarnuk // Now keeps internal "dirty" flag and only does work in // "-textDidEnd:endChar:" if the text is "dirty". This // should suppress most of the -border:slotAtPosition: // sent to freed object errors from IB. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import @class Button, Matrix, NXColorWell, TextField; @class MiscTableScroll; class MiscTableBorder; @interface MiscTableScrollInspector : IBInspector { Button* autosizeSwitch; Button* autoSortSwitch; Button* borderPopUp; Button* cellClassPopUp; Button* deleteButton; Button* downButton; Button* draggableSwitch; Button* enabledSwitch; Button* lazySwitch; Button* modePopUp; Button* sizableSwitch; Button* sortTypePopUp; Button* sortDirectionPopUp; Button* titleModePopUp; Button* titlesSwitch; Button* upButton; Button* userSizeableSwitch; Matrix* alignMatrix; MiscTableScroll* slotScroll; TextField* alignTitle; TextField* sizeField; TextField* sizeMaxField; TextField* sizeMinField; TextField* titleField; TextField* uniformSizeField; NXColorWell* colorText; NXColorWell* colorTextHighlight; NXColorWell* colorBack; NXColorWell* colorBackHighlight; TextField* sampleTextNormal; TextField* sampleTextHighlight; int slot; // Currently selected slot, or -1. int num_slots; // Total number of columns. MiscBorderType border_type; MiscTableBorder* border; BOOL dirty; } - (id)init; - (id)ok:(id)sender; - (id)revert:(id)sender; @end #endif // __MiscTableScrollInspector_h MiscKit/Palettes/MiscTableScroll/MiscTableScrollKB.M100444 1750 1750 27662 6757716160 22646 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollKB.M // // Keyboard event handling for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollKB.M,v 1.4 97/02/11 19:23:53 sunshine Exp $ // $Log: MiscTableScrollKB.M,v $ // Revision 1.4 97/02/11 19:23:53 sunshine // v123: reflectSelection --> selectionChanged // Now forces autoDisplay ON when responding to keyboard selection. // // Revision 1.3 96/12/17 22:24:24 sunshine // v112: Now disables flushWindow during methods which scroll and change the // keyboard cursor position so that the operations occur in a visually atomic // fashion. MiscTableView's moveFocusBy: --> moveCursorBy:. // // Revision 1.2 96/05/05 11:18:20 sunshine // Totally rewrote. Now handles all manner of keyboard movement: page-up, // page-down, home, and end for both rows and columns. These functions can // be accessed from both the numeric keypad and the text editing keypads. // Now also understands alt-space for selection since under new OpenStep- // conformance, alt-space now has meaning. //----------------------------------------------------------------------------- #import #import "MiscTableView.h" enum KB_Action { ACT_IGNORE, ACT_NEXT_TEXT, ACT_PREV_TEXT, ACT_SELECT, ACT_PERFORM, ACT_LEFT, ACT_RIGHT, ACT_UP, ACT_DOWN, ACT_PAGE_LEFT, ACT_PAGE_RIGHT, ACT_PAGE_UP, ACT_PAGE_DOWN, ACT_LEFT_EDGE, ACT_RIGHT_EDGE, ACT_TOP_EDGE, ACT_BOT_EDGE, ACT_NUM_ACTIONS }; enum { K_TAB = '\t', // ascii-set K_BTAB = 0x19, // ascii-set K_RETURN = '\r', // ascii-set K_SPACE = ' ' , // ascii-set K_ALT_SPACE = 0x80, // ascii-set K_LEFT = 0xac, // symbol-set K_UP = 0xad, // symbol-set K_RIGHT = 0xae, // symbol-set K_DOWN = 0xaf, // symbol-set K_KP_LEFT = '4', // ascii-set, numeric-pad mask K_KP_UP = '8', // ascii-set, numeric-pad mask K_KP_RIGHT = '6', // ascii-set, numeric-pad mask K_KP_DOWN = '2', // ascii-set, numeric-pad mask K_KP_PAGE_UP = '9', // ascii-set, numeric-pad mask K_KP_PAGE_DOWN = '3', // ascii-set, numeric-pad mask K_KP_HOME = '7', // ascii-set, numeric-pad mask K_KP_END = '1', // ascii-set, numeric-pad mask K_KP_INSERT = '0', // ascii-set, numeric-pad mask K_KP_ENTER = 0x03, // 254-set K_PAGE_UP = 0x30, // 254-set K_PAGE_DOWN = 0x31, // 254-set K_HOME = 0x2e, // 254-set K_END = 0x2f, // 254-set }; //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll(Keyboard) //----------------------------------------------------------------------------- // sendSelect: //----------------------------------------------------------------------------- - (void)sendSelect:(id)targ { if (targ != 0 && [targ respondsTo:@selector(selectText:)]) [targ selectText:self]; } //----------------------------------------------------------------------------- // - keyboardSelect: //----------------------------------------------------------------------------- - (void)keyboardSelect:(NXEvent const*)p { BOOL const was_auto = [self isAutodisplay]; // For selection reflection. [self setAutodisplay:YES]; [tableView keyboardSelect:p]; [self borderClearSelection:MISC_OTHER_BORDER([tableView trackingBy])]; [self selectionChanged]; [self setAutodisplay:was_auto]; [self sendActionIfEnabled]; } //----------------------------------------------------------------------------- // goFirstSlot: //----------------------------------------------------------------------------- - (void)goFirstSlot:(MiscBorderType)b { if ([self numSlots:b] > 0) { int const s = [self border:b slotAtPosition:0]; Window* const w = [self window]; [w disableFlushWindow]; [self border:b setCursor:s]; [self border:b setFirstVisibleSlot:s]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goLastSlot //----------------------------------------------------------------------------- - (void)goLastSlot:(MiscBorderType)b { int const n = [self numSlots:b]; if (n > 0) { int s = [self border:b slotAtPosition:(n - 1)]; Window* const w = [self window]; [w disableFlushWindow]; [self border:b setCursor:s]; [self border:b setLastVisibleSlot:s]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goPrevPage: //----------------------------------------------------------------------------- - (void)goPrevPage:(MiscBorderType)b { if ([self numSlots:b] > 0) { int sFirst = [self firstVisibleSlot:b]; int const sLast = [self lastVisibleSlot:b]; int const v = [self border:b slotPosition:sFirst]; if (sFirst == sLast && v > 0) sFirst = [self border:b slotAtPosition:(v - 1)]; Window* const w = [self window]; [w disableFlushWindow]; [self border:b setLastVisibleSlot:sFirst]; if (b == [self trackingBy]) [self border:b setCursor:[self firstVisibleSlot:b]]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goNextPage: //----------------------------------------------------------------------------- - (void)goNextPage:(MiscBorderType)b { int const lim = [self numSlots:b]; if (lim > 0) { int const sFirst = [self firstVisibleSlot:b]; int sLast = [self lastVisibleSlot:b]; int const v = [self border:b slotPosition:sLast]; if (sFirst == sLast && v < lim - 1) sLast = [self border:b slotAtPosition:(v + 1)]; Window* const w = [self window]; [w disableFlushWindow]; [self border:b setFirstVisibleSlot:sLast]; if (b == [self trackingBy]) [self border:b setCursor:[self lastVisibleSlot:b]]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - classifyOtherSet: //----------------------------------------------------------------------------- - (KB_Action)classifyOtherSet:(NXEvent const*)p { KB_Action deed = ACT_IGNORE; switch (p->data.key.charCode) { case K_LEFT: deed = ACT_LEFT; break; case K_RIGHT: deed = ACT_RIGHT; break; case K_UP: deed = ACT_UP; break; case K_DOWN: deed = ACT_DOWN; break; case K_PAGE_UP: deed = ACT_PAGE_UP; break; case K_PAGE_DOWN: deed = ACT_PAGE_DOWN; break; case K_HOME: deed = ACT_TOP_EDGE; break; case K_END: deed = ACT_BOT_EDGE; break; } return deed; } //----------------------------------------------------------------------------- // - classifyAsciiSet: //----------------------------------------------------------------------------- - (KB_Action)classifyAsciiSet:(NXEvent const*)p { KB_Action deed = ACT_IGNORE; switch (p->data.key.charCode) { case K_TAB: deed = ACT_NEXT_TEXT; break; case K_BTAB: deed = ACT_PREV_TEXT; break; case K_SPACE: deed = ACT_SELECT; break; case K_ALT_SPACE: deed = ACT_SELECT; break; case K_RETURN: deed = ACT_PERFORM; break; } return deed; } //----------------------------------------------------------------------------- // - classifyKeypad: //----------------------------------------------------------------------------- - (KB_Action)classifyKeypad:(NXEvent const*)p { KB_Action deed = ACT_IGNORE; unsigned short const charCode = p->data.key.charCode; if (charCode == K_KP_ENTER) deed = ACT_PERFORM; else if ('0' <= charCode && charCode <= '9') { static KB_Action const ACTS[] = { ACT_SELECT, // KP 0 (insert) ACT_BOT_EDGE, // KP 1 (end) ACT_DOWN, // KP 2 (arrow down) ACT_PAGE_DOWN, // KP 3 (page down) ACT_LEFT, // KP 4 (arrow left) ACT_IGNORE, // KP 5 ACT_RIGHT, // KP 6 (arrow right) ACT_TOP_EDGE, // KP 7 (home) ACT_UP, // KP 8 (arrow up) ACT_PAGE_UP // KP 9 (page up) }; deed = ACTS[ charCode - '0' ]; } return deed; } //----------------------------------------------------------------------------- // - classifyFlags:forAction: //----------------------------------------------------------------------------- - (KB_Action)classifyFlags:(int)flags forAction:(KB_Action)deed { static KB_Action const MODIFIED_ACTIONS[ ACT_NUM_ACTIONS ] = { ACT_IGNORE, // ACT_IGNORE ACT_NEXT_TEXT, // ACT_NEXT_TEXT ACT_PREV_TEXT, // ACT_PREV_TEXT ACT_SELECT, // ACT_SELECT ACT_PERFORM, // ACT_PERFORM ACT_PAGE_LEFT, // ACT_LEFT ACT_PAGE_RIGHT, // ACT_RIGHT ACT_PAGE_UP, // ACT_UP ACT_PAGE_DOWN, // ACT_DOWN ACT_PAGE_LEFT, // ACT_PAGE_LEFT ACT_PAGE_RIGHT, // ACT_PAGE_RIGHT ACT_PAGE_LEFT, // ACT_PAGE_UP ACT_PAGE_RIGHT, // ACT_PAGE_DOWN ACT_LEFT_EDGE, // ACT_LEFT_EDGE ACT_RIGHT_EDGE, // ACT_RIGHT_EDGE ACT_LEFT_EDGE, // ACT_TOP_EDGE ACT_RIGHT_EDGE // ACT_BOT_EDG }; int const FLAGS = NX_CONTROLMASK | NX_ALTERNATEMASK | NX_SHIFTMASK; if ((flags & FLAGS) != 0) return MODIFIED_ACTIONS[ deed ]; return deed; } //----------------------------------------------------------------------------- // - classifyKeyDown: //----------------------------------------------------------------------------- - (KB_Action)classifyKeyDown:(NXEvent const*)p { KB_Action deed = ACT_IGNORE; if ((p->flags & NX_COMMANDMASK) == 0) { if (p->data.key.charSet != NX_ASCIISET) deed = [self classifyOtherSet:p]; else if ((p->flags & NX_NUMERICPADMASK) != 0) deed = [self classifyKeypad:p]; else deed = [self classifyAsciiSet:p]; if (deed != ACT_IGNORE) deed = [self classifyFlags:p->flags forAction:deed]; } return deed; } //----------------------------------------------------------------------------- // - keyDown: //----------------------------------------------------------------------------- - keyDown:(NXEvent*)p { KB_Action deed = [self classifyKeyDown:p]; BOOL handled = (deed != ACT_IGNORE); if (handled) { switch (deed) { case ACT_NEXT_TEXT: [self sendSelect:[self nextText]]; break; case ACT_PREV_TEXT: [self sendSelect:[self previousText]]; break; case ACT_SELECT: [self keyboardSelect:p]; break; case ACT_PERFORM: [self sendDoubleActionIfEnabled]; break; case ACT_UP: [tableView moveCursorBy:-1]; break; case ACT_DOWN: [tableView moveCursorBy: 1]; break; case ACT_LEFT: [tableView moveCursorBy:-1]; break; case ACT_RIGHT: [tableView moveCursorBy: 1]; break; case ACT_PAGE_LEFT: [self goPrevPage: MISC_COL_BORDER]; break; case ACT_PAGE_RIGHT:[self goNextPage: MISC_COL_BORDER]; break; case ACT_PAGE_UP: [self goPrevPage: MISC_ROW_BORDER]; break; case ACT_PAGE_DOWN: [self goNextPage: MISC_ROW_BORDER]; break; case ACT_LEFT_EDGE: [self goFirstSlot:MISC_COL_BORDER]; break; case ACT_RIGHT_EDGE:[self goLastSlot: MISC_COL_BORDER]; break; case ACT_TOP_EDGE: [self goFirstSlot:MISC_ROW_BORDER]; break; case ACT_BOT_EDGE: [self goLastSlot: MISC_ROW_BORDER]; break; default: handled = NO; break; } } if (!handled && ![self incrementalSearch:p]) return [super keyDown:p]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollPB.M100444 1750 1750 27253 6757716160 22647 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPB.M // // Pasteboard and services support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPB.M,v 1.5 96/08/30 15:27:26 sunshine Exp $ // $Log: MiscTableScrollPB.M,v $ // Revision 1.5 96/08/30 15:27:26 sunshine // Uses new MiscDelegateFlags which caches information about which methods // the delegate implements in order to avoid having to query the delegate's // -respondsTo: method each time. // // Revision 1.4 96/02/17 07:42:23 zarnuk // MiscTableScroll.h no longer includes MiscIntList.h // // Revision 1.3 96/01/13 23:44:36 zarnuk // Plugged memory leak. // All allocations are now done from [self zone]. //----------------------------------------------------------------------------- #import #import #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import #import } #define MISC_PB_FIELD_SEPARATOR '\t' #define MISC_PB_RECORD_TERMINATOR '\n' #define MISC_PB_MAX_TYPES 32 @implementation MiscTableScroll(Pasteboard) //----------------------------------------------------------------------------- // - sortSel:border: //----------------------------------------------------------------------------- - (void) sortSel:(MiscIntList*)sel_list border:(MiscBorderType)b { [self border:b physicalToVisual:sel_list]; [sel_list sort]; [self border:b visualToPhysical:sel_list]; } //----------------------------------------------------------------------------- // - builtinRegisterServicesTypes // // FIXME: Deal with these also: // writeTypes[*] = NXRTFPboardType // writeTypes[*] = NXFontPboardType; // writeTypes[*] = NXColorPboardType // writeTypes[*] = NXSelectionPboardType // writeTypes[*] = NXDataLinkPboardType //----------------------------------------------------------------------------- - (void) builtinRegisterServicesTypes { NXAtom writeTypes[3]; NXAtom readTypes[1]; writeTypes[0] = NXTabularTextPboardType; writeTypes[1] = NXAsciiPboardType; writeTypes[2] = 0; readTypes[0] = 0; [NXApp registerServicesMenuSendTypes:writeTypes andReturnTypes:readTypes]; } //----------------------------------------------------------------------------- // - registerServicesTypes //----------------------------------------------------------------------------- - (void) registerServicesTypes { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_REGISTER_SERVICE_TYPES]; if (del != 0) [del tableScrollRegisterServicesTypes:self]; else [self builtinRegisterServicesTypes]; } //----------------------------------------------------------------------------- // - builtinValidRequestorForSendType:andReturnType: //----------------------------------------------------------------------------- - builtinValidRequestorForSendType:(NXAtom)t_write andReturnType:(NXAtom)t_read { if (t_read == 0 && // We only send stuff, we never take stuff. (t_write == NXTabularTextPboardType || t_write == NXAsciiPboardType) && ([self hasRowSelection] || [self hasColSelection])) return self; return [super validRequestorForSendType:t_write andReturnType:t_read]; } //----------------------------------------------------------------------------- // - validRequestorForSendType:andReturnType: //----------------------------------------------------------------------------- - validRequestorForSendType:(NXAtom)t_write andReturnType:(NXAtom)t_read { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_VALID_REQUESTOR]; if (del != 0) return [del tableScroll:self validRequestorForSendType:t_write andReturnType:t_read]; return [self builtinValidRequestorForSendType:t_write andReturnType:t_read]; } //----------------------------------------------------------------------------- // - builtinReadSelectionFromPasteboard: //----------------------------------------------------------------------------- - builtinReadSelectionFromPasteboard:pboard { return self; } //----------------------------------------------------------------------------- // - readSelectionFromPasteboard: //----------------------------------------------------------------------------- - readSelectionFromPasteboard:pb { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_READ_SEL_FROM_PB]; if (del != 0) return [del tableScroll:self readSelectionFromPasteboard:pb]; return [self builtinReadSelectionFromPasteboard:pb]; } //----------------------------------------------------------------------------- // - builtinCanWritePboardType: //----------------------------------------------------------------------------- - (BOOL) builtinCanWritePboardType:(NXAtom)type { return type == NXAsciiPboardType || type == NXTabularTextPboardType; } //----------------------------------------------------------------------------- // - canWritePboardType: //----------------------------------------------------------------------------- - (BOOL) canWritePboardType:(NXAtom)type { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_CAN_WRITE_PB_TYPE]; if (del != 0) return [del tableScroll:self canWritePboardType:type]; return [self builtinCanWritePboardType:type]; } //----------------------------------------------------------------------------- // - writeNXAsciiPboardTypeToStream:at:: //----------------------------------------------------------------------------- - (void) writeNXAsciiPboardTypeToStream:(NXStream*)stream at:(int)row :(int)col { char const* s = 0; id cell = [self cellAt:row:col]; if (cell != 0) { if ([cell respondsTo:@selector(title)]) s = [cell title]; else if ([cell respondsTo:@selector(stringValue)]) s = [cell stringValue]; } if (s != 0) { for ( ; *s != '\0'; s++) { int c = *s; if (c == MISC_PB_FIELD_SEPARATOR) c = ' '; NXPutc( stream, c ); } } } //----------------------------------------------------------------------------- // - writeNXAsciiPboardTypeToStream: //----------------------------------------------------------------------------- - (void) writeNXAsciiPboardTypeToStream: (NXStream*) stream { unsigned int i, i_lim; MiscCoord_V j, j_lim; MiscCoord_P row, col; MiscIntList* sel_list = [[MiscIntList allocFromZone:[self zone]] init]; if ([self numSelectedRows] > 0) { [self selectedRows:sel_list]; [self sortSel:sel_list border:MISC_ROW_BORDER]; i_lim = [sel_list count]; j_lim = (MiscCoord_V) [self numCols]; for (i = 0; i < i_lim; i++) { row = (MiscCoord_P) [sel_list intAt:i]; for (j = 0; j < j_lim; j++) { if (j > 0) NXPutc( stream, MISC_PB_FIELD_SEPARATOR ); col = [self colAtPosition:j]; [self writeNXAsciiPboardTypeToStream:stream at:row:col]; } NXPutc( stream, MISC_PB_RECORD_TERMINATOR ); } } else if ([self numSelectedCols] > 0) { [self selectedCols:sel_list]; [self sortSel:sel_list border:MISC_COL_BORDER]; i_lim = [sel_list count]; j_lim = (MiscCoord_V) [self numRows]; for (j = 0; j < j_lim; j++) { row = [self rowAtPosition:j]; for (i = 0; i < i_lim; i++) { if (i > 0) NXPutc( stream, MISC_PB_FIELD_SEPARATOR ); col = (MiscCoord_P) [sel_list intAt:i]; [self writeNXAsciiPboardTypeToStream:stream at:row:col]; } NXPutc( stream, MISC_PB_RECORD_TERMINATOR ); } } [sel_list free]; } //----------------------------------------------------------------------------- // - writeNXTabularTextPboardTypeToStream: //----------------------------------------------------------------------------- - (void) writeNXTabularTextPboardTypeToStream: (NXStream*) stream { [self writeNXAsciiPboardTypeToStream:stream]; } //----------------------------------------------------------------------------- // - builtinWritePboard:type:toStream: //----------------------------------------------------------------------------- - (void) builtinWritePboard:pb type:(NXAtom)type toStream:(NXStream*)stream { if (type == NXAsciiPboardType) [self writeNXAsciiPboardTypeToStream:stream]; else if (type == NXTabularTextPboardType) [self writeNXTabularTextPboardTypeToStream:stream]; } //----------------------------------------------------------------------------- // - writePboard:type:toStream: //----------------------------------------------------------------------------- - (void) writePboard:pb type:(NXAtom)t toStream:(NXStream*)s { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_WRITE_PB_TYPE_TO_STREAM]; if (del != 0) [del tableScroll:self writePboard:pb type:t toStream:s]; else [self builtinWritePboard:pb type:t toStream:s]; } //----------------------------------------------------------------------------- // - builtinWriteSelectionToPasteboard:types: //----------------------------------------------------------------------------- - (BOOL) builtinWriteSelectionToPasteboard:pboard types:(NXAtom*)original_types { BOOL result = NO; NXAtom types[ MISC_PB_MAX_TYPES + 1 ]; int nTypes = 0; NXAtom const* tp; if (original_types != 0) for (tp = original_types; *tp != 0; tp++) if ([self canWritePboardType:*tp]) if (nTypes < MISC_PB_MAX_TYPES) types[ nTypes++ ] = *tp; types[ nTypes ] = 0; if (nTypes > 0 && ([self hasRowSelection] || [self hasColSelection])) { int i = 0; [pboard declareTypes:types num:nTypes owner:0]; for (i = 0; i < nTypes; i++) { NXStream* stream = NXOpenMemory( 0, 0, NX_READWRITE ); [self writePboard:pboard type:types[i] toStream:stream]; NXSeek( stream, 0, NX_FROMSTART ); [pboard writeType:types[i] fromStream:stream]; NXCloseMemory( stream, NX_FREEBUFFER ); } result = YES; } return result; } //----------------------------------------------------------------------------- // - writeSelectionToPasteboard:types: //----------------------------------------------------------------------------- - (BOOL) writeSelectionToPasteboard:pboard types:(NXAtom*)types { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_WRITE_SEL_TO_PB_TYPES]; if (del != 0) return [del tableScroll:self writeSelectionToPasteboard:pboard types:types]; return [self builtinWriteSelectionToPasteboard:pboard types:types]; } //----------------------------------------------------------------------------- // - copy: //----------------------------------------------------------------------------- - copy:sender { NXAtom types[3]; types[0] = NXTabularTextPboardType; types[1] = NXAsciiPboardType; types[2] = 0; [self writeSelectionToPasteboard:[Pasteboard new] types:types]; return self; } //----------------------------------------------------------------------------- // - cut: //----------------------------------------------------------------------------- - cut:sender { return [self copy:sender]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollPalette.M100444 1750 1750 3445 6757716160 23721 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPalette.M // // Subclass of IBPalette for the MiscTableScroll palette. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPalette.M,v 1.3 97/12/19 01:08:53 zarnuk Exp $ // $Log: MiscTableScrollPalette.M,v $ // Revision 1.3 97/12/19 01:08:53 zarnuk // v133: Turns on auto-sort. // // Revision 1.2 96/02/17 07:43:42 zarnuk // Fixed copyright notice. //----------------------------------------------------------------------------- #import "MiscTableScrollPalette.h" #import @implementation MiscTableScrollPalette //----------------------------------------------------------------------------- // - finishInstantiate //----------------------------------------------------------------------------- - finishInstantiate { [tableScroll addCol]; [tableScroll addCol]; [tableScroll setCol:1 autosize:YES]; [tableScroll setAutoSortRows:YES]; [tableScroll tile]; return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollPalette.h100444 1750 1750 3266 6757716160 23755 0ustar sunshinesunshine#ifndef __MiscTableScrollPalette_h #define __MiscTableScrollPalette_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPalette.h // // Subclass of IBPalette for the MiscTableScroll palette. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPalette.h,v 1.3 96/04/19 17:08:58 zarnuk Exp $ // $Log: MiscTableScrollPalette.h,v $ // Revision 1.3 96/04/19 17:08:58 zarnuk // Added extern "Objective-C". // // Revision 1.2 96/02/17 07:44:03 zarnuk // Fixed copyright notice. // // Revision 1.1 96/02/17 07:43:13 zarnuk // Subclass of IBPalette for MiscTableScroll. // //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class MiscTableScroll; @interface MiscTableScrollPalette:IBPalette { MiscTableScroll* tableScroll; } - finishInstantiate; @end #endif // __MiscTableScrollPalette_h MiscKit/Palettes/MiscTableScroll/MiscTableScrollPrint.M100444 1750 1750 11126 6757716161 23433 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPrint.M // // Printing support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPrint.M,v 1.2 97/02/11 19:22:42 sunshine Exp $ // $Log: MiscTableScrollPrint.M,v $ // Revision 1.2 97/02/11 19:22:42 sunshine // v123: Fixed bug: Delegate methods -tableScrollWillPrint: & // -tableScroll:didPrint: were getting subverted when -printPSCode: was sent // to first-responder (which is the MiscTableView, not the MiscTableScroll). // Connecting Print... item to first-responder in IB can cause this. // Was fixed by sending them in MiscTableViewPrint.M rather than here. // // Revision 1.1 96/10/24 22:48:40 zarnuk // TableScroll hook for printing. //----------------------------------------------------------------------------- #import "MiscTableScrollPrivate.h" #import "MiscDelegateFlags.h" #import "MiscTableView.h" #import "MiscBorderView.h" extern "Objective-C" { #import #import #import } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll(Print) - (id)getPageHeader { return pageHeader; } - (id)getPageFooter { return pageFooter; } - (void)setPageHeader:(id)obj { pageHeader = obj; } - (void)setPageFooter:(id)obj { pageFooter = obj; } - (MiscTablePrintInfo const*)getPrintInfo { return [tableView getPrintInfo]; } //----------------------------------------------------------------------------- // dumpPrintInfo //----------------------------------------------------------------------------- - (void)dumpPrintInfo { PrintInfo* pinfo = (PrintInfo*)[NXApp printInfo]; fprintf( stderr, "printInfo=%p\n", pinfo ); fprintf( stderr, "paperType:[%s]\n", [pinfo paperType] ); NXRect const* const paperRect = [pinfo paperRect]; if (paperRect != 0) fprintf( stderr, "paperRect:{{%g,%g},{%g,%g}}\n", paperRect->origin.x, paperRect->origin.y, paperRect->size.width, paperRect->size.height ); else fprintf( stderr, "paperRect:(null pointer)\n" ); float leftMargin; float rightMargin; float topMargin; float bottomMargin; [pinfo getMarginLeft:&leftMargin right:&rightMargin top:&topMargin bottom:&bottomMargin ]; fprintf( stderr, "margins: left=%g right=%g top=%g bottom=%g\n", leftMargin, rightMargin, topMargin, bottomMargin ); fprintf( stderr, "scalingFactor=%g\n", [pinfo scalingFactor] ); fprintf( stderr, "orientation=%d\n", (int)[pinfo orientation] ); fprintf( stderr, "isHorizCentered=%d\n", (int)[pinfo isHorizCentered] ); fprintf( stderr, "isVertCentered=%d\n", (int)[pinfo isVertCentered] ); fprintf( stderr, "horizPagination=%d\n", [pinfo horizPagination] ); fprintf( stderr, "vertPagination=%d\n", [pinfo vertPagination] ); fprintf( stderr, "outputFile=[%s]\n", [pinfo outputFile] ); fprintf( stderr, "pageOrder=%d\n", (int)[pinfo pageOrder] ); fprintf( stderr, "isAllPages=%d\n", (int)[pinfo isAllPages] ); fprintf( stderr, "firstPage=%d\n", [pinfo firstPage] ); fprintf( stderr, "lastPage=%d\n", [pinfo lastPage] ); fprintf( stderr, "currentPage=%d\n", [pinfo currentPage] ); fprintf( stderr, "copies=%d\n", [pinfo copies] ); fprintf( stderr, "pagesPerSheet=%d\n", (int)[pinfo pagesPerSheet] ); fprintf( stderr, "reversePageOrder=%d\n", (int)[pinfo reversePageOrder] ); // There are also job features... } //----------------------------------------------------------------------------- // printPSCode: //----------------------------------------------------------------------------- - (id)printPSCode:(id)sender { return ([tableView printPSCode:sender] != 0 ? self : 0); } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollPrivate.h100444 1750 1750 5357 6757716161 23775 0ustar sunshinesunshine#ifndef __MiscTableScrollPrivate_h #define __MiscTableScrollPrivate_h //============================================================================= // // Copyright (C) 1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPrivate.h // // Methods used within the Table Scroll palette but which are not // exported with the *public* interface. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPrivate.h,v 1.8 97/12/19 01:11:28 zarnuk Exp $ // $Log: MiscTableScrollPrivate.h,v $ // Revision 1.8 97/12/19 01:11:28 zarnuk // v133: Broke off IO category of TableScroll. Migrated some version // related declarations here. Added access to the cornerView. // // Revision 1.7 97/02/05 07:57:56 sunshine // v122: Added -setTracking: to fix lazy-mode mouse-tracking display problem. //----------------------------------------------------------------------------- #import #import "MiscDelegateFlags.h" // There are no structural differences between versions 0 and 1. However, // the range of the MiscSortType values increased from 0..8 to 0..12 // There are significant structural differences between versions 1 and 2. #define MISC_TS_VERSION_0 0 #define MISC_TS_VERSION_1 1 #define MISC_TS_VERSION_2 2 #define MISC_TS_VERSION MISC_TS_VERSION_2 @interface MiscTableScroll (PrivateInternal) - (id)responsibleDelegate:(MiscDelegateFlags::Selector)cmd; // Private: border -> scroll - (char const*)border:(MiscBorderType)b getDelegateSlotTitle:(int)slot; - (id)border:(MiscBorderType)b getDelegateSlotPrototype:(int)s; // TableScroll(IncrementalSearch) -> TableScroll(Keyboard) - (void)keyboardSelect:(NXEvent const*)p; - (MiscBorderView*)rowTitles; - (MiscBorderView*)colTitles; - (MiscCornerView*)cornerView; - (void)setTracking:(BOOL)flag; - (void)setClickedRow:(MiscCoord_P)r col:(MiscCoord_P)c; - (void)clearClicked; // Reset stale-old-selection in Table & Border views. - (void)resetSelection; // TableScroll(IO) -> TableScroll - (void)doInit:(int)ver cornerTitle:(char const*)s; @end #endif // __MiscTableScrollPrivate_h MiscKit/Palettes/MiscTableScroll/MiscTableScrollSel.M100444 1750 1750 31727 6757716161 23073 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollSel.M // // Selection management methods for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollSel.M,v 1.1 97/11/14 20:41:24 zarnuk Exp $ // $Log: MiscTableScrollSel.M,v $ // Revision 1.1 97/11/14 20:41:24 zarnuk // v130: selection, keyboard and mouse routines for MiscTableScroll. // //----------------------------------------------------------------------------- #import #import "MiscColView.h" #import "MiscRowView.h" #import "MiscTableView.h" #import "MiscTableBorder.h" @implementation MiscTableScroll(Selection) //----------------------------------------------------------------------------- // Next / Previous Text //----------------------------------------------------------------------------- - (id)nextText { return nextText; } - (id)previousText { return previousText; } - (id)setNextText:(id)obj { nextText = obj; if (obj && [obj respondsTo: @selector(setPreviousText:)]) [obj setPreviousText: self]; return self; } - (id)setPreviousText:(id)obj { previousText = obj; return self; } - (BOOL)isSelectable { return num_cols > 0 && num_rows > 0; } - (BOOL)isEnabled { return enabled; } - (id)setEnabled:(BOOL)flag { enabled = flag; return self; } - (id)selectText:(id)sender { if ([window firstResponder] != (id)tableView) [window makeFirstResponder:tableView]; return self; } //----------------------------------------------------------------------------- // Selection //----------------------------------------------------------------------------- - (void)selectionChanged { [window disableFlushWindow]; [rowInfo.view selectionChanged]; [colInfo.view selectionChanged]; [tableView selectionChanged]; [[window reenableFlushWindow] flushWindow]; } - (void)resetSelection { [tableView resetSelection]; [rowInfo.view resetSelection]; [colInfo.view resetSelection]; } - (void)trackBy:(MiscBorderType)b { [tableView trackBy:b]; } - (MiscBorderType)trackingBy { return [tableView trackingBy]; } - (BOOL)tracking { return tracking; } - (void)setTracking:(BOOL)flag { tracking = flag; } - (MiscSelectionMode)selectionMode { return mode; } - (void)setSelectionMode:(MiscSelectionMode)x { if (x != mode) { [self clearSelection]; mode = x; [colInfo.view setSelectionMode: mode]; [rowInfo.view setSelectionMode: mode]; [tableView setSelectionMode: mode]; } } - (id)selectedCell { MiscCoord_P const col = [self selectedCol]; MiscCoord_P const row = [self selectedRow]; return (col >= 0 && row >= 0) ? [self cellAt:row:col] : 0; } - (BOOL)borderHasSelection:(MiscBorderType)b { return info[b]->border->hasSelection(); } - (BOOL)hasRowSelection { return [self borderHasSelection:MISC_ROW_BORDER]; } - (BOOL)hasColSelection { return [self borderHasSelection:MISC_COL_BORDER]; } - (BOOL)borderHasMultipleSelection:(MiscBorderType)b { return info[b]->border->hasMultipleSelection(); } - (BOOL)hasMultipleRowSelection { return [self borderHasMultipleSelection: MISC_ROW_BORDER]; } - (BOOL)hasMultipleColSelection { return [self borderHasMultipleSelection: MISC_COL_BORDER]; } - (unsigned int)borderNumSelectedSlots:(MiscBorderType)b { return info[b]->border->numSelected(); } - (unsigned int)numSelectedRows { return [self borderNumSelectedSlots: MISC_ROW_BORDER]; } - (unsigned int)numSelectedCols { return [self borderNumSelectedSlots: MISC_COL_BORDER]; } - (BOOL)border:(MiscBorderType)b slotIsSelected:(MiscCoord_P)slot { MiscTableBorder const* bp = info[b]->border; return bp->goodPos( slot ) && bp->isSelected_P( slot ); } - (BOOL)rowIsSelected:(MiscCoord_P)row { return [self border:MISC_ROW_BORDER slotIsSelected:row]; } - (BOOL)colIsSelected:(MiscCoord_P)col { return [self border:MISC_COL_BORDER slotIsSelected:col]; } - (BOOL)cellIsSelected:(MiscCoord_P)r :(MiscCoord_P)c { return ([self rowIsSelected:r] || [self colIsSelected:c]); } - (MiscCoord_P)borderSelectedSlot:(MiscBorderType)b { return info[b]->border->selectedSlot_P(); } - (MiscCoord_P)selectedRow { return [self borderSelectedSlot:MISC_ROW_BORDER]; } - (MiscCoord_P)selectedCol { return [self borderSelectedSlot:MISC_COL_BORDER]; } - (void)border:(MiscBorderType)b selectedTags:(MiscIntList*)tags { info[b]->border->selectedTags( tags ); } - (void)selectedRowTags:(MiscIntList*)tags { [self border:MISC_ROW_BORDER selectedTags:tags]; } - (void)selectedColTags:(MiscIntList*)tags { [self border:MISC_COL_BORDER selectedTags:tags]; } - (void)border:(MiscBorderType)b selectedSlots:(MiscIntList*)slots { info[b]->border->selectedSlots( slots ); } - (void)selectedRows:(MiscIntList*)rows { [self border:MISC_ROW_BORDER selectedSlots:rows]; } - (void)selectedCols:(MiscIntList*)cols { [self border:MISC_COL_BORDER selectedSlots:cols]; } - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)p_slot byExtension:(BOOL)extend { BOOL changed = NO; MiscTableBorder* const ob = info[ MISC_OTHER_BORDER(b) ]->border; if (ob->hasSelection()) { ob->selectNone(); changed = YES; } MiscTableBorder* const bp = info[b]->border; if (!extend && bp->numSelected() > 0) { bp->selectNone(); changed = YES; } if (bp->goodPos( p_slot )) { MiscCoord_V const v_slot = bp->physicalToVisual( p_slot ); if (!bp->isSelected( v_slot )) { if (mode == MISC_RADIO_MODE) bp->selectOne( v_slot ); else bp->select( v_slot ); changed = YES; } } if (changed) [self selectionChanged]; } - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)p_slot { [self border:b selectSlot:p_slot byExtension:NO]; } - (void)selectRow:(MiscCoord_P)row byExtension:(BOOL)extend { [self border:MISC_ROW_BORDER selectSlot:row byExtension:extend]; } - (void)selectRow:(MiscCoord_P)row { [self selectRow:row byExtension:NO]; } - (void)selectCol:(MiscCoord_P)col byExtension:(BOOL)extend { [self border:MISC_COL_BORDER selectSlot:col byExtension:extend]; } - (void)selectCol:(MiscCoord_P)col { [self selectCol:col byExtension:NO]; } - (void)border:(MiscBorderType)b selectTags:(MiscIntList*)tags byExtension:(BOOL)extend { info[b]->border->selectTags( tags, extend ); [self selectionChanged]; } - (void)border:(MiscBorderType)b selectTags:(MiscIntList*)tags { [self border:b selectTags:tags byExtension:NO]; } - (void)selectRowTags:(MiscIntList*)tags byExtension:(BOOL)extend { [self border:MISC_ROW_BORDER selectTags:tags byExtension:extend]; } - (void)selectRowTags:(MiscIntList*)tags { [self selectRowTags:tags byExtension:NO]; } - (void)selectColTags:(MiscIntList*)tags byExtension:(BOOL)extend { [self border:MISC_COL_BORDER selectTags:tags byExtension:extend]; } - (void)selectColTags:(MiscIntList*)tags { [self selectColTags:tags byExtension:NO]; } - (void)border:(MiscBorderType)b selectSlots:(MiscIntList*)slots byExtension:(BOOL)extend { info[b]->border->selectSlots( slots, extend ); [self selectionChanged]; } - (void)border:(MiscBorderType)b selectSlots:(MiscIntList*)slots { [self border:b selectSlots:slots byExtension:NO]; } - (void)selectRows:(MiscIntList*)rows byExtension:(BOOL)extend { [self border:MISC_ROW_BORDER selectSlots:rows byExtension:extend]; } - (void)selectRows:(MiscIntList*)rows { [self selectRows:rows byExtension:NO]; } - (void)selectCols:(MiscIntList*)cols byExtension:(BOOL)extend { [self border:MISC_COL_BORDER selectSlots:cols byExtension:extend]; } - (void)selectCols:(MiscIntList*)cols { [self selectCols:cols byExtension:NO]; } - (void)borderSelectAll:(MiscBorderType)b { if (mode == MISC_LIST_MODE || mode == MISC_HIGHLIGHT_MODE) { info[b]->border->selectAll(); [self selectionChanged]; } } - (void)selectAllRows { [self borderSelectAll: MISC_ROW_BORDER]; } - (void)selectAllCols { [self borderSelectAll: MISC_COL_BORDER]; } - (id)selectAll:(id)sender { [self selectAllRows]; [self sendActionIfEnabled]; return self; } - (void)border:(MiscBorderType)b deselectSlot:(MiscCoord_P)p_slot { MiscTableBorder* const bp = info[b]->border; if (bp->goodPos( p_slot )) { MiscCoord_V const v_slot = bp->physicalToVisual( p_slot ); if (bp->isSelected( v_slot )) { bp->unselect( v_slot ); [self selectionChanged]; } } } - (void)deselectRow:(MiscCoord_P)row { [self border:MISC_ROW_BORDER deselectSlot:row]; } - (void)deselectCol:(MiscCoord_P)col { [self border:MISC_COL_BORDER deselectSlot:col]; } - (void)border:(MiscBorderType)b deselectTags:(MiscIntList*)tags { info[b]->border->unselectTags( tags ); [self selectionChanged]; } - (void)deselectRowTags:(MiscIntList*)tags { [self border:MISC_ROW_BORDER deselectTags:tags]; } - (void)deselectColTags:(MiscIntList*)tags { [self border:MISC_COL_BORDER deselectTags:tags]; } - (void)border:(MiscBorderType)b deselectSlots:(MiscIntList*)slots { info[b]->border->unselectSlots( slots ); [self selectionChanged]; } - (void)deselectRows:(MiscIntList*)rows { [self border:MISC_ROW_BORDER deselectSlots:rows]; } - (void)deselectCols:(MiscIntList*)cols { [self border:MISC_COL_BORDER deselectSlots:cols]; } - (void)borderClearSelection:(MiscBorderType)b { info[b]->border->selectNone(); [self selectionChanged]; } - (void)clearRowSelection { [self borderClearSelection: MISC_ROW_BORDER]; } - (void)clearColSelection { [self borderClearSelection: MISC_COL_BORDER]; } - (void)clearSelection { [self clearRowSelection]; [self clearColSelection]; } - (id)deselectAll:(id)sender { [self clearSelection]; [self sendActionIfEnabled]; return self; } //----------------------------------------------------------------------------- // Clicked slot stuff //----------------------------------------------------------------------------- - (MiscCoord_P)borderClickedSlot:(MiscBorderType)b { return info[b]->border->clickedSlot_P(); } - (MiscCoord_P)clickedRow { return [self borderClickedSlot:MISC_ROW_BORDER]; } - (MiscCoord_P)clickedCol { return [self borderClickedSlot:MISC_COL_BORDER]; } - (id)clickedCell { MiscCoord_P const r = [self clickedRow]; MiscCoord_P const c = [self clickedCol]; return (r >= 0 && c >= 0 ? [self cellAt:r:c] : 0); } - (void)border:(MiscBorderType)b setClickedSlot:(MiscCoord_P)n { info[b]->border->setClickedSlot_P(n); } - (void)setClickedRow:(MiscCoord_P)r col:(MiscCoord_P)c { [self border:MISC_ROW_BORDER setClickedSlot:r]; [self border:MISC_COL_BORDER setClickedSlot:c]; } - (void)borderClearClickedSlot:(MiscBorderType)b { info[b]->border->clearClickedSlot(); } - (void)clearClicked { [self borderClearClickedSlot:MISC_ROW_BORDER]; [self borderClearClickedSlot:MISC_COL_BORDER]; } //----------------------------------------------------------------------------- // Keyboard cursor stuff //----------------------------------------------------------------------------- - (void)reflectCursor { [tableView reflectCursor]; } - (MiscCoord_P)borderCursor: (MiscBorderType)b { return info[b]->border->getCursor_P(); } - (MiscCoord_P)cursorRow { return [self borderCursor: MISC_ROW_BORDER]; } - (MiscCoord_P)cursorCol { return [self borderCursor: MISC_COL_BORDER]; } - (void) border:(MiscBorderType)b setCursor:(MiscCoord_P)slot { info[b]->border->setCursor_P( slot ); [self reflectCursor]; } - (void)setCursorRow:(MiscCoord_P)row { [self border: MISC_ROW_BORDER setCursor: row]; } - (void)setCursorCol:(MiscCoord_P)col { [self border: MISC_COL_BORDER setCursor: col]; } - (void)borderClearCursor:(MiscBorderType)b { info[b]->border->clearCursor(); [self reflectCursor]; } - (void)clearCursorRow { [self borderClearCursor: MISC_ROW_BORDER]; } - (void)clearCursorCol { [self borderClearCursor: MISC_COL_BORDER]; } - (void)clearCursor { [self clearCursorRow]; [self clearCursorCol]; } - (BOOL)borderHasValidCursor:(MiscBorderType)b { return info[b]->border->hasValidCursor(); } - (BOOL)hasValidCursorRow { return [self borderHasValidCursor: MISC_ROW_BORDER]; } - (BOOL)hasValidCursorCol { return [self borderHasValidCursor: MISC_COL_BORDER]; } - (BOOL)isCursorEnabled { return [tableView isCursorEnabled]; } - (void)disableCursor { if ([self isCursorEnabled] && [tableView shouldDrawCursor]) [tableView eraseCursor]; [tableView disableCursor]; } - (void)reenableCursor { [tableView reenableCursor]; if ([self isCursorEnabled] && [tableView shouldDrawCursor]) [tableView drawCursor]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableScrollSort.M100444 1750 1750 113722 6757716161 23313 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollSort.M // // Sorting support for MiscTableScroll. // // FIXME: OPTIMIZATION -- Explore other sorting algorithms: // MergeSort, Radix-Exchange, Distribution-Counting. // HeapSort: explored -- usually makes twice as many comparisons. // Binary Insertion Sort (bsort): explored -- *way* fewer comparisons, // but memmove() overhead slaughters performance. // // FIXME: OPTIMIZATION -- Explore calling -isSorted before actually sorting // the table. This might save a lot of work when there are unique // columns near the left, and the user is dragging columns near the // right. ** Exploring ** Seems to improve overall performance for // quicksort(), not necessary with bsort(). // // FIXME: OPTIMIZATION -- Explore giving the programmer some means to mark // columns as "unique". Whenever the from- and to- positions of a // column-drag operation are to the right of a "unique" column, resorting // can be suppressed. Extra sort-information does not need to be // pre-computed for columns to the right of the "unique" column. // // FIXME: OPTIMIZATION -- When sorting a column of integers, allocate an // array and fill it with the values so that we don't have to retrieve // the values several times while the sort is in progress. Same thing // for string pointers if we can give the user some way to indicate // that the strings are stable for the duration of the sort. // // FIXME: OPTIMIZATION -- Most of the sorting and comparing uses one record // repeatedly while comparing it to others. Find some way to cache // the values from that record so they don't have to be fetched // repeatedly. // // FIXME: OPTIMIZATION -- Consider re-using the sort info objects at least to // avoid allocating and freeing entry_info[] and buff[] all the time. // Consider embedding one of them right in the table-scroll itself. // // LOSER: OPTIMIZATION -- Don't make a function call to do the comparisons // unless the user has installed a custom sort function. Use a big // switch statement. (This eliminates one function call per comparison.) // *** I tried this. It was actually a little bit slower than the *** // *** current design. *** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollSort.M,v 1.14 99/06/29 07:52:45 sunshine Exp $ // $Log: MiscTableScrollSort.M,v $ // Revision 1.14 99/06/29 07:52:45 sunshine // v140: Ported back to NextStep 3.2. Compiler complained about signed vs. // unsigned arguments. // // Revision 1.13 98/02/19 16:36:10 zarnuk // v136: Now uses NXOrderStrings. // // Revision 1.12 97/06/10 05:37:00 sunshine // v127: Removed unused header. //----------------------------------------------------------------------------- #import #import #import "MiscBorderView.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" extern "Objective-C" { #import // NXOrderStrings() } extern "C" { #import } #ifndef USE_BSORT // Use binary insertion sort. #define USE_BSORT 0 #endif #ifndef SORTING_STATS // Gather and print some statistics. #define SORTING_STATS 0 #endif //============================================================================= // CELL-VALUE ACCESS //============================================================================= //----------------------------------------------------------------------------- // expand_buffer //----------------------------------------------------------------------------- static void expand_buffer( int len, MiscSlotSortInfo* info ) { int sz = info->buff_size; do { sz += 256; } while (sz < len); NXZone* const z = info->zone; if (info->buff != 0) NXZoneFree( z, info->buff ); info->buff = (char*) NXZoneMalloc( z, sz ); info->buff_size = sz; } //----------------------------------------------------------------------------- // copy_string //----------------------------------------------------------------------------- static inline char* copy_string( char const* s, MiscSlotSortInfo* info ) { int len = strlen( s ) + 1; if (info->buff_size < len) expand_buffer( len, info ); return (char*) memcpy( info->buff, s, len ); } //----------------------------------------------------------------------------- // cell_str //----------------------------------------------------------------------------- static inline char const* cell_str( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo* q, BOOL make_copy ) { char const* t = (*(p->value_func.s))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); if (t == 0) t = ""; else if (make_copy) t = copy_string( t, q ); return t; } //----------------------------------------------------------------------------- // cell_int //----------------------------------------------------------------------------- static inline int cell_int( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.i))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //----------------------------------------------------------------------------- // cell_float //----------------------------------------------------------------------------- static inline float cell_float( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.f))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //----------------------------------------------------------------------------- // cell_double //----------------------------------------------------------------------------- static inline double cell_double( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.d))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //============================================================================= // CELL COMPARISON FUNCTIONS //============================================================================= //----------------------------------------------------------------------------- // cmp_istr //----------------------------------------------------------------------------- static int cmp_istr( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo* q ) { char const* const s1 = cell_str( r1,c1,p,q,q->need_copy ); char const* const s2 = cell_str( r2,c2,p,q,NO ); return NXOrderStrings( (unsigned char const*)s1, (unsigned char const*)s2, NO, -1, 0 ); } //----------------------------------------------------------------------------- // cmp_str //----------------------------------------------------------------------------- static int cmp_str( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo* q ) { char const* const s1 = cell_str( r1,c1,p,q,q->need_copy ); char const* const s2 = cell_str( r2,c2,p,q,NO ); return NXOrderStrings( (unsigned char const*)s1, (unsigned char const*)s2, YES, -1, 0 ); } //----------------------------------------------------------------------------- // cmp_int //----------------------------------------------------------------------------- static int cmp_int( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { int const x1 = cell_int(r1,c1,p,q); int const x2 = cell_int(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_uint //----------------------------------------------------------------------------- static int cmp_uint( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { unsigned int const x1 = (unsigned int) cell_int(r1,c1,p,q); unsigned int const x2 = (unsigned int) cell_int(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_float //----------------------------------------------------------------------------- static int cmp_float( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { float const x1 = cell_float(r1,c1,p,q); float const x2 = cell_float(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_double //----------------------------------------------------------------------------- static int cmp_double( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { double const x1 = cell_double(r1,c1,p,q); double const x2 = cell_double(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_skip //----------------------------------------------------------------------------- static int cmp_skip( int,int,int,int, MiscEntrySortInfo const*, MiscSlotSortInfo const*) { return 0; } //----------------------------------------------------------------------------- // COMPARE_FUNC[] //----------------------------------------------------------------------------- static MiscCompareEntryFunc const COMPARE_FUNC[ MISC_SORT_TYPE_MAX + 1 ] = { cmp_istr, cmp_str, cmp_int, cmp_uint, cmp_int, // cmp_tag, cmp_uint, // cmp_utag, cmp_float, cmp_double, cmp_skip, cmp_istr, // cmp_ititle, cmp_str, // cmp_title, cmp_int, // cmp_state, cmp_uint, // cmp_ustate }; //============================================================================= // SLOT-COMPARE //============================================================================= #if(SORTING_STATS) static unsigned long int NUM_COMPARES = 0; #endif //----------------------------------------------------------------------------- // MiscDefaultCompareSlotFunc //----------------------------------------------------------------------------- int MiscDefaultCompareSlotFunc( int slot1, int slot2, MiscSlotSortInfo* info ) { int rc = 0; MiscEntrySortInfo const* p = info->entry_info; MiscEntrySortInfo const* const plim = p + info->num_entries; if (info->border_type == MISC_COL_BORDER) // Row-wise compare { for ( ; p < plim; p++) { #if(SORTING_STATS) NUM_COMPARES++; #endif int const col = p->slot; if ((rc = (*(p->compare_func))(slot1,col,slot2,col,p,info)) != 0) return (p->ascending ? rc : -rc); } } else // Col-wise compare { for ( ; p < plim; p++) { #if(SORTING_STATS) NUM_COMPARES++; #endif int const row = p->slot; if ((rc = (*(p->compare_func))(row,slot1,row,slot2,p,info)) != 0) return (p->ascending ? rc : -rc); } } return 0; } //============================================================================= // QSORT //============================================================================= #if(USE_BSORT) static void bsort( int a[], int N, MiscCompareSlotFunc f, MiscSlotSortInfo* info ) { #if(SORTING_STATS) time_t const t0 = time(0); clock_t const c0 = clock(); NUM_COMPARES = 0; #endif int lo, mid, hi; for (int i = 1; i < N; i++) { int v = a[i]; hi = i - 1; if ((*f)(a[hi],v,info) > 0) { lo = 0; while (lo <= hi) { mid = (lo + hi) >> 1; if ((*f)(a[mid],v,info) <= 0) lo = mid + 1; else hi = mid - 1; } int* lim = a + lo; int* src = a + i; int* dst = src + 1; do { *(--dst) = *(--src); } while (src != lim); *src = v; // memmove( a + lo + 1, a + lo, (i - lo) * sizeof(*a) ); // a[lo] = v; } } #if(SORTING_STATS) clock_t const c1 = clock(); time_t const t1 = time(0); fprintf( stderr, "bsort: %d ticks %d seconds %lu compares\n", (c1 - c0), (t1 - t0), NUM_COMPARES ); #endif } #else //----------------------------------------------------------------------------- // swap //----------------------------------------------------------------------------- inline static void swap( int x, int y, int a[] ) { int t = a[x]; a[x] = a[y]; a[y] = t; } //----------------------------------------------------------------------------- // do_qsort //----------------------------------------------------------------------------- static void do_qsort( int a[], int N, MiscCompareSlotFunc f, MiscSlotSortInfo* info ) { #if(SORTING_STATS) time_t const t0 = time(0); clock_t const c0 = clock(); NUM_COMPARES = 0; #endif int const STACK_MAX = 64; // log_base_2(ULNG_MAX) * 2 int stk[ STACK_MAX ]; int top = 0; int left = 0; int right = N - 1; int i,j,n; for (;;) { while (right > left) { n = (right - left) + 1; // right,left bounds are inclusive. if (n >= 8) { int mid = (left + right) >> 1; if ((*f)(a[left],a[right],info) > 0) swap(left,right,a); if ((*f)(a[mid], a[right],info) > 0) swap(mid,right,a); if ((*f)(a[left],a[mid], info) > 0) swap(left,mid,a); // if (n == 3) break; right--; swap(mid,right,a); int v = a[right]; i = left; j = right; for (;;) { while ((*f)(a[++i],v,info) < 0) /* empty */; while ((*f)(a[--j],v,info) > 0) /* empty */; if (i >= j) break; swap( i, j, a ); } swap( i, right, a ); right++; if (i - left > right - i) { stk[top++] = left; stk[top++] = i-1; left = i+1; } else { stk[top++] = i+1; stk[top++] = right; right = i-1; } } else // (n < 3) { if (n > 1) { for (i = left + 1; i <= right; i++) { int const v = a[i]; j = i; while (--j >= left && (*f)(a[j],v,info) > 0) a[j+1] = a[j]; a[++j] = v; } } break; } } if (top == 0) break; right = stk[--top]; left = stk[--top]; } #if(SORTING_STATS) clock_t const c1 = clock(); time_t const t1 = time(0); fprintf( stderr, "qsort: %d ticks %d seconds %lu compares\n", (c1 - c0), (t1 - t0), NUM_COMPARES ); #endif } #endif @implementation MiscTableScroll(Sort) //----------------------------------------------------------------------------- // MISC_INDIRECT // Indirect value-access methods. For lazy-mode tables where the // delegate and dataDelegate do not provide the corresponding // tableScroll:valueAt:: method. We retrieve the cell from the // delegate or dataDelegate via the tableScroll:cellAt:: method, // then we ask the cell for the value. //----------------------------------------------------------------------------- #define MISC_INDIRECT( DATA_TYPE, NAME, SUFFIX, FUNC_TYPE ) \ - (DATA_TYPE)indirect:obj NAME##At:(int)row :(int)col \ :(MiscEntrySortInfo*)p :(MiscSlotSortInfo*)q \ { \ id cell = (*(p->cell_at_func))( obj, @selector(tableScroll:cellAt: :), \ self, row, col ); \ if (cell != 0) \ { \ if (p->cell_class == (id) cell->isa) \ { \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ { \ p->cell_class = (id) cell->isa; \ if ([cell respondsTo:p->cell_sel]) \ { \ p->cell_func.SUFFIX = (MISC_TS_##FUNC_TYPE##_VAL) \ [cell methodFor:p->cell_sel]; \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ p->cell_func.SUFFIX = 0; \ } \ } \ return 0; \ } MISC_INDIRECT( int, tag, i, INT ) // indirect:tagAt:: MISC_INDIRECT( int, intValue, i, INT ) // indirect:intValueAt:: MISC_INDIRECT( float, floatValue, f, FLOAT ) // indirect:floatValueAt:: MISC_INDIRECT( double, doubleValue, d, DOUBLE ) // indirect:doubleValueAt:: MISC_INDIRECT( char const*,stringValue,s,STRING)// indirect:stringValueAt:: MISC_INDIRECT( int, state, i, INT ) // indirect:stateAt:: MISC_INDIRECT( char const*, title, s, STRING ) // indirect:titleAt:: //----------------------------------------------------------------------------- // MISC_DIRECT // Direct value-access methods for eager-mode tables. These cover // routines match the correct prototype for sorting, and skip some // of the intervening overhead. //----------------------------------------------------------------------------- #define MISC_DIRECT( DATA_TYPE, NAME, SUFFIX, FUNC_TYPE ) \ - (DATA_TYPE)direct:dummyObj NAME##At:(int)row :(int)col \ :(MiscEntrySortInfo*)p :(MiscSlotSortInfo*)q \ { \ id cell = cells[ row * num_cols + col ]; \ if (p->cell_class == (id) cell->isa) \ { \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ { \ p->cell_class = (id) cell->isa; \ if ([cell respondsTo:p->cell_sel]) \ { \ p->cell_func.SUFFIX = (MISC_TS_##FUNC_TYPE##_VAL) \ [cell methodFor:p->cell_sel]; \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ p->cell_func.SUFFIX = 0; \ } \ return 0; \ } MISC_DIRECT( int, tag, i, INT ) // direct:tagAt:: MISC_DIRECT( int, intValue, i, INT ) // direct:intValueAt:: MISC_DIRECT( float, floatValue, f, FLOAT ) // direct:floatValueAt:: MISC_DIRECT( double, doubleValue, d, DOUBLE ) // direct:doubleValueAt:: MISC_DIRECT( char const*,stringValue,s,STRING) // direct:stringValueAt:: MISC_DIRECT( int, state, i, INT ) // direct:stateAt:: MISC_DIRECT( char const*, title, s, STRING ) // direct:titleAt:: //----------------------------------------------------------------------------- // copy_info //----------------------------------------------------------------------------- static void copy_info( MiscEntrySortInfo& info, MiscEntrySortInfo const& x ) { info.value_target = x.value_target; info.value_sel = x.value_sel; info.value_obj = x.value_obj; info.value_func.i = x.value_func.i; info.cell_at_func = x.cell_at_func; info.cell_class = x.cell_class; info.cell_sel = x.cell_sel; info.cell_func.i = x.cell_func.i; } //----------------------------------------------------------------------------- // set_info //----------------------------------------------------------------------------- static void set_info( MiscEntrySortInfo* info, id targ, SEL aSel, id obj, SEL cell_sel ) { info->value_target = targ; info->value_sel = aSel; info->value_obj = obj; info->value_func.i = (MISC_TS_INT_AT)[targ methodFor:aSel]; info->cell_at_func = [obj methodFor:@selector(tableScroll:cellAt: :)]; info->cell_class = 0; info->cell_sel = cell_sel; info->cell_func.i = 0; } //----------------------------------------------------------------------------- // MISC_INFO_INIT // Precompute which objects and messages to use to retrieve the values // for a particular type of data. //----------------------------------------------------------------------------- #define MISC_INFO_INIT( NAME, CMD ) \ - (BOOL)sortInfoInit_##NAME:(MiscEntrySortInfo*)p \ { \ id del; \ BOOL ok = YES; \ del = [self responsibleDelegate:MiscDelegateFlags::DEL_##CMD##_AT]; \ if (del != 0) \ set_info( p,del,@selector(tableScroll:NAME##At: :),self,0 ); \ else if (!lazy) \ set_info( p, self, @selector(direct:NAME##At: : : :), 0, \ @selector(NAME) ); \ else \ { \ del = [self responsibleDelegate:MiscDelegateFlags::DEL_CELL_AT]; \ if (del != 0) \ set_info(p,self,@selector(indirect:NAME##At: : : :),del, \ @selector(NAME)); \ else \ ok = NO; \ } \ return ok; \ } MISC_INFO_INIT( tag, TAG ) // sortInfoInit_tag: MISC_INFO_INIT( intValue, INT_VALUE ) // sortInfoInit_intValue: MISC_INFO_INIT( floatValue, FLOAT_VALUE ) // sortInfoInit_floatValue: MISC_INFO_INIT( doubleValue, DOUBLE_VALUE ) // sortInfoInit_doubleValue: MISC_INFO_INIT( stringValue, STRING_VALUE ) // sortInfoInit_stringValue: MISC_INFO_INIT( state, STATE ) // sortInfoInit_state: MISC_INFO_INIT( title, TITLE ) // sortInfoInit_title: //----------------------------------------------------------------------------- // - sortValueInfoInit:type: //----------------------------------------------------------------------------- - (BOOL)sortValueInfoInit:(MiscEntrySortInfo*)p type:(MiscSortType)type { BOOL ok = NO; switch (type) { case MISC_SORT_STRING_CASE_INSENSITIVE: case MISC_SORT_STRING_CASE_SENSITIVE: ok = [self sortInfoInit_stringValue:p]; break; case MISC_SORT_INT: case MISC_SORT_UNSIGNED_INT: ok = [self sortInfoInit_intValue:p]; break; case MISC_SORT_TAG: case MISC_SORT_UNSIGNED_TAG: ok = [self sortInfoInit_tag:p]; break; case MISC_SORT_FLOAT: ok = [self sortInfoInit_floatValue:p]; break; case MISC_SORT_DOUBLE: ok = [self sortInfoInit_doubleValue:p]; break; case MISC_SORT_TITLE_CASE_INSENSITIVE: case MISC_SORT_TITLE_CASE_SENSITIVE: ok = [self sortInfoInit_title:p]; break; case MISC_SORT_STATE: case MISC_SORT_UNSIGNED_STATE: ok = [self sortInfoInit_state:p]; break; default: case MISC_SORT_SKIP: break; } return ok; } //----------------------------------------------------------------------------- // - compareSlotFunc //----------------------------------------------------------------------------- - (MiscCompareSlotFunc)compareSlotFunc { return sort_slot_func ? sort_slot_func : MiscDefaultCompareSlotFunc; } //----------------------------------------------------------------------------- // - setCompareSlotFunc: //----------------------------------------------------------------------------- - (void)setCompareSlotFunc:(MiscCompareSlotFunc)f { sort_slot_func = (f ? f : MiscDefaultCompareSlotFunc); } //----------------------------------------------------------------------------- // - sortInfoInit:border: // // NOTE *VAL-INFO* // The val_info[] array holds the index of the first entry for each // sort-type. This is used so that the value-access information only // needs to be computed once. Later entries can use the value-access // information already computed for previous entries of the same // sort-type. If there is no method to retrieve the data for a given // sort-type, then the entry is marked with VAL_INFO_ERROR, and all // entries with that sort-type will be excluded from the final // entry_info[] array. //----------------------------------------------------------------------------- - (void)sortInfoInit:(MiscSlotSortInfo*)ip border:(MiscBorderType)b { MiscBorderType const ob = MISC_OTHER_BORDER(b); MiscTableBorder* const obp = info[ob]->border; NXZone* const z = [self zone]; ip->table_scroll = self; ip->zone = z; ip->border_type = ob; ip->num_entries = 0; ip->entry_info = 0; ip->need_copy = lazy && ([self buffCount] < 2); ip->buff = 0; ip->buff_size = 0; int M; // Number of "cols". int const* v = [self slotSortVector:ob len:&M]; if (v == 0 || M == 0) { v = obp->getV2PMap(); M = obp->count(); } if (M > 0) { MiscEntrySortInfo* ep = (MiscEntrySortInfo*) NXZoneMalloc( z, M * sizeof(*ep) ); if (ep != 0) { ip->num_entries = M; ip->entry_info = ep; int const VAL_INFO_BLANK = -1; int const VAL_INFO_ERROR = -2; int val_info[ MISC_SORT_TYPE_MAX + 1 ]; // NOTE *VAL-INFO* for (int k = 0; k <= (int) MISC_SORT_TYPE_MAX; k++) val_info[k] = VAL_INFO_BLANK; int j = 0; for (int i = 0; i < M; i++) { MiscEntrySortInfo& r = ep[j]; int n = (v ? v[i] : i); BOOL was_neg = (n < 0); if (was_neg) n = ~n; r.slot = n; if ([self border:ob slotSortDirection:n]==MISC_SORT_DESCENDING) was_neg = !was_neg; r.ascending = !was_neg; if ((r.compare_func = [self border:ob slotSortFunc:n]) == 0) { MiscSortType t = [self border:ob slotSortType:n]; if ((unsigned int)t <= (unsigned int)MISC_SORT_TYPE_MAX && t != MISC_SORT_SKIP) { r.sort_type = t; r.compare_func = COMPARE_FUNC[t]; int* vi = val_info + (int)t; if (*vi == VAL_INFO_BLANK) { if ([self sortValueInfoInit:&r type:t]) *vi = j; else *vi = VAL_INFO_ERROR; } else if (*vi != VAL_INFO_ERROR) copy_info( r, ep[ *vi ] ); if (*vi != VAL_INFO_ERROR) j++; // Keep this slot. } } else { r.sort_type = MISC_SORT_CUSTOM; j++; // Keep this slot. } } ip->num_entries = j; // Number of non-skip slots. } else { [self error:"Memory allocation failure.\n"]; } } } //----------------------------------------------------------------------------- // - sortInfoDone: //----------------------------------------------------------------------------- - (void)sortInfoDone:(MiscSlotSortInfo*)ip { if (ip->entry_info != 0) { // Cast off const-ness. NXZoneFree( ip->zone, (MiscEntrySortInfo*) ip->entry_info ); ip->entry_info = 0; } if (ip->buff != 0) { free( ip->buff ); ip->buff = 0; ip->buff_size = 0; } } //----------------------------------------------------------------------------- // - slots:areSorted:func:info: //----------------------------------------------------------------------------- - (BOOL)slots:(int const*)v2p areSorted:(int)N func:(MiscCompareSlotFunc)func info:(MiscSlotSortInfo*)ip { if (v2p == 0) { for (int i = 1; i < N; i++) if ((*func)( i-1, i, ip ) > 0) return NO; } else { for (int i = 1; i < N; i++) if ((*func)( v2p[i-1], v2p[i], ip ) > 0) return NO; } return YES; } #if(USE_BSORT) //----------------------------------------------------------------------------- // - sortSlots: //----------------------------------------------------------------------------- - (void)sortSlots:(MiscBorderType)b { MiscTableBorder* const bp = info[b]->border; int const N = bp->count(); if (N > 1) { MiscCompareSlotFunc func = [self compareSlotFunc]; MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { NXZone* const z = [self zone]; int* const new_v2p = (int*) NXZoneMalloc(z,N*sizeof(int)); if (new_v2p != 0) { for (int j = 0; j < N; j++) new_v2p[j] = j; bsort( new_v2p, N, func, &data ); bp->setV2PMap( new_v2p ); NXZoneFree( z, new_v2p ); [self resetSelection]; [self update]; } else { [self error:"Memory allocation failure.\n" ]; } } [self sortInfoDone:&data]; } } #else //----------------------------------------------------------------------------- // - sortSlots: //----------------------------------------------------------------------------- - (void)sortSlots:(MiscBorderType)b { MiscTableBorder* const bp = info[b]->border; int const N = bp->count(); if (N > 1) { MiscCompareSlotFunc func = [self compareSlotFunc]; MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { int const* const old_v2p = bp->getV2PMap(); if (![self slots:old_v2p areSorted:N func:func info:&data]) { NXZone* const z = [self zone]; int* const new_v2p = (int*) NXZoneMalloc(z,N*sizeof(int)); if (new_v2p != 0) { for (int j = 0; j < N; j++) new_v2p[j] = j; do_qsort( new_v2p, N, func, &data ); bp->setV2PMap( new_v2p ); NXZoneFree( z, new_v2p ); [self resetSelection]; [self update]; } else { [self error:"Memory allocation failure.\n" ]; } } } [self sortInfoDone:&data]; } } #endif - (void)sortCols { [self sortSlots:MISC_COL_BORDER]; } - (void)sortRows { [self sortSlots:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - slotsAreSorted: //----------------------------------------------------------------------------- - (BOOL)slotsAreSorted:(MiscBorderType)b { BOOL sorted = YES; MiscTableBorder* const border = info[b]->border; int const N = border->count(); // Number of "rows". if (N > 1) { MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { sorted = [self slots:border->getV2PMap() areSorted:N func:[self compareSlotFunc] info:&data]; } [self sortInfoDone:&data]; } return sorted; } - (BOOL)colsAreSorted { return [self slotsAreSorted:MISC_COL_BORDER]; } - (BOOL)rowsAreSorted { return [self slotsAreSorted:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - border:compareSlots::info: //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 info:(MiscSlotSortInfo*)ip { return (*[self compareSlotFunc])( slot1, slot2, ip ); } - (int)compareCols:(int)c1 :(int)c2 info:(MiscSlotSortInfo*)ip { return [self border:MISC_COL_BORDER compareSlots:c1:c2 info:ip]; } - (int)compareRows:(int)r1 :(int)r2 info:(MiscSlotSortInfo*)ip { return [self border:MISC_ROW_BORDER compareSlots:r1:r2 info:ip]; } //----------------------------------------------------------------------------- // - border:compareSlots:: //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 { int rc = 0; MiscSlotSortInfo sort_info; [self sortInfoInit:&sort_info border:b]; if (sort_info.num_entries > 0) rc = [self border:b compareSlots:slot1:slot2 info:&sort_info]; [self sortInfoDone:&sort_info]; return rc; } - (int)compareCols:(int)c1 :(int)c2 { return [self border:MISC_COL_BORDER compareSlots:c1:c2]; } - (int)compareRows:(int)r1 :(int)r2 { return [self border:MISC_ROW_BORDER compareSlots:r1:r2]; } //----------------------------------------------------------------------------- // - border:sortSlot: // NOTE *1* If the destination is at a higher index than the source, // then the destination index needs to be decremented by one to // reflect the fact that the contents of the "from" slot will be // removed, (and all following slots will be shifted down by one // position) before the insertion will take place. //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)b sortSlot:(int)pslot { BOOL moved = NO; int const N = [self numSlots:b]; // Number of "rows" if (N > 1) { MiscSlotSortInfo sort_info; [self sortInfoInit:&sort_info border:b]; if (sort_info.num_entries > 0) { MiscCompareSlotFunc func = [self compareSlotFunc]; int const vslot = [self border:b slotPosition:pslot]; int const prev = (vslot > 0 ? [self border:b slotAtPosition:vslot - 1] : -1); int const next = (vslot < N - 1 ? [self border:b slotAtPosition:vslot + 1] : N); int adjust = 0; // NOTE *1* int lo = vslot; int hi = vslot - 1; if (prev >= 0 && (*func)( pslot, prev, &sort_info ) < 0) { lo = 0; hi = vslot - 2; } else if (next < N && (*func)( pslot, next, &sort_info) > 0) { adjust = -1; // NOTE *1* lo = vslot + 1; hi = N - 1; } while (lo <= hi) // Binary search. { int const mid = (lo + hi) >> 1; int const n = [self border:b slotAtPosition:mid]; int const cmp = (*func)( pslot, n, &sort_info ); if (cmp < 0) hi = mid - 1; else lo = mid + 1; } if (lo != vslot) { [self border:b moveSlotFrom:vslot to:lo + adjust]; // *1* // FIXME: if isAutodisplay && canDraw then // display:: range. Else setNeedsDisplay: [self update]; moved = YES; } } [self sortInfoDone:&sort_info]; } return moved; } - (BOOL)sortCol:(int)n { return [self border:MISC_COL_BORDER sortSlot:n]; } - (BOOL)sortRow:(int)n { return [self border:MISC_ROW_BORDER sortSlot:n]; } //----------------------------------------------------------------------------- // - border:slotIsSorted: //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)b slotIsSorted:(int)pslot { BOOL sorted = YES; int const N = [self numSlots:b]; // Number of "rows". if (N > 1) { MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { MiscCompareSlotFunc func = [self compareSlotFunc]; int const vslot = [self border:b slotPosition:pslot]; int const prev = (vslot > 0 ? [self border:b slotAtPosition:vslot - 1] : -1); int const next = (vslot < N - 1 ? [self border:b slotAtPosition:vslot + 1] : N); if (prev >= 0 && (*func)( prev, pslot, &data ) > 0) sorted = NO; else if (next < N && (*func)( pslot, next, &data ) > 0) sorted = NO; } [self sortInfoDone:&data]; } return sorted; } - (BOOL)colIsSorted:(int)n { return [self border:MISC_COL_BORDER slotIsSorted:n]; } - (BOOL)rowIsSorted:(int)n { return [self border:MISC_ROW_BORDER slotIsSorted:n]; } //----------------------------------------------------------------------------- // autoSort //----------------------------------------------------------------------------- - (BOOL)autoSortSlots:(MiscBorderType)b { return info[b]->autoSort; } - (void)border:(MiscBorderType)b setAutoSortSlots:(BOOL)flag { if (info[b]->autoSort != flag) { info[b]->autoSort = flag; MiscBorderInfo const* const ip = info[ MISC_OTHER_BORDER(b) ]; if (ip->isOn) { [window invalidateCursorRectsForView:ip->view]; [ip->view update]; } } } - (BOOL)autoSortCols { return [self autoSortSlots:MISC_COL_BORDER]; } - (void)setAutoSortCols:(BOOL)flag { [self border:MISC_COL_BORDER setAutoSortSlots:flag]; } - (BOOL)autoSortRows { return [self autoSortSlots:MISC_ROW_BORDER]; } - (void)setAutoSortRows:(BOOL)flag { [self border:MISC_ROW_BORDER setAutoSortSlots:flag]; } //----------------------------------------------------------------------------- // Sort Vector //----------------------------------------------------------------------------- - (int const*)slotSortVector:(MiscBorderType)b len:(int*)len { MiscBorderInfo* const ip = info[b]; *len = ip->sort_vector_len; return ip->sort_vector; } - (void)border:(MiscBorderType)b setSlotSortVector:(int const*)v len:(int)n { NXZone* const z = [self zone]; MiscBorderInfo* const ip = info[b]; if (ip->sort_vector != 0) NXZoneFree( z, ip->sort_vector ); if (n > 0) { int const nbytes = n * sizeof(*v); ip->sort_vector_len = n; ip->sort_vector = (int*) NXZoneMalloc( z, nbytes ); memcpy( ip->sort_vector, v, nbytes ); [self border:MISC_OTHER_BORDER(b) setAutoSortSlots:NO]; } else { ip->sort_vector_len = 0; ip->sort_vector = 0; } } - (int const*)colSortVectorLen:(int*)len { return [self slotSortVector:MISC_COL_BORDER len:len]; } - (void)setColSortVector:(int const*)v len:(int)n { [self border:MISC_COL_BORDER setSlotSortVector:v len:n]; } - (int const*)rowSortVectorLen:(int*)len { return [self slotSortVector:MISC_ROW_BORDER len:len]; } - (void)setRowSortVector:(int const*)v len:(int)n { [self border:MISC_ROW_BORDER setSlotSortVector:v len:n]; } //----------------------------------------------------------------------------- // Sort Func //----------------------------------------------------------------------------- - (MiscCompareEntryFunc)border:(MiscBorderType)b slotSortFunc:(int)n { return info[b]->border->getSortFunc_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortFunc:(MiscCompareEntryFunc)x { info[b]->border->setSortFunc_P(n,x); } - (MiscCompareEntryFunc)colSortFunc:(int)n { return [self border:MISC_COL_BORDER slotSortFunc:n]; } - (void)setCol:(int)n sortFunc:(MiscCompareEntryFunc)x { [self border:MISC_COL_BORDER setSlot:n sortFunc:x]; } - (MiscCompareEntryFunc)rowSortFunc:(int)n { return [self border:MISC_ROW_BORDER slotSortFunc:n]; } - (void)setRow:(int)n sortFunc:(MiscCompareEntryFunc)x { [self border:MISC_ROW_BORDER setSlot:n sortFunc:x]; } //----------------------------------------------------------------------------- // Sort Direction //----------------------------------------------------------------------------- - (MiscSortDirection)border:(MiscBorderType)b slotSortDirection:(int)n { return info[b]->border->getSortDirection_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortDirection:(MiscSortDirection)x { if ((unsigned int) x <= (unsigned int) MISC_SORT_DIR_MAX && x != info[b]->border->getSortDirection_P(n)) { info[b]->border->setSortDirection_P(n,x); MiscBorderInfo const* const ip = info[MISC_OTHER_BORDER(b)]; if (ip->isOn && ip->autoSort) { [ip->view update]; // FIXME: Just draw the part needed. } } } - (MiscSortDirection)colSortDirection:(int)n { return [self border:MISC_COL_BORDER slotSortDirection:n]; } - (void)setCol:(int)n sortDirection:(MiscSortDirection)x { [self border:MISC_COL_BORDER setSlot:n sortDirection:x]; } - (MiscSortDirection)rowSortDirection:(int)n { return [self border:MISC_ROW_BORDER slotSortDirection:n]; } - (void)setRow:(int)n sortDirection:(MiscSortDirection)x { [self border:MISC_ROW_BORDER setSlot:n sortDirection:x]; } //----------------------------------------------------------------------------- // Sort Type //----------------------------------------------------------------------------- - (MiscSortType)border:(MiscBorderType)b slotSortType:(int)n; { return info[b]->border->getSortType_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortType:(MiscSortType)x { if ((unsigned int) x <= (unsigned int) MISC_SORT_TYPE_MAX) info[b]->border->setSortType_P(n,x); } - (MiscSortType)colSortType:(int)n { return [self border:MISC_COL_BORDER slotSortType:n]; } - (void)setCol:(int)n sortType:(MiscSortType)x { [self border:MISC_COL_BORDER setSlot:n sortType:x]; } - (MiscSortType)rowSortType:(int)n { return [self border:MISC_ROW_BORDER slotSortType:n]; } - (void)setRow:(int)n sortType:(MiscSortType)x { [self border:MISC_ROW_BORDER setSlot:n sortType:x]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableUtil.h100444 1750 1750 4463 6757716162 22117 0ustar sunshinesunshine#ifndef __MiscTableUtil_h #define __MiscTableUtil_h //============================================================================= // // Copyright (C) 1995,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableUtil.h // // Common inline functions used by the MiscTableScroll object. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableUtil.h,v 1.3 97/12/19 01:14:05 zarnuk Exp $ // $Log: MiscTableUtil.h,v $ // Revision 1.3 97/12/19 01:14:05 zarnuk // v133: Eliminated data-sizing. // // Revision 1.2 97/11/14 20:48:22 zarnuk // v130: Added MISC_ENUM_CHECK. //----------------------------------------------------------------------------- #include #include "MiscAssert.h" #include "bool.h" inline MiscBorderType otherBorder( MiscBorderType t ) { return (t == MISC_COL_BORDER) ? MISC_ROW_BORDER : MISC_COL_BORDER; } inline bool isFixed( MiscTableSizing x ) { return x == MISC_NUSER_NSPRINGY_SIZING; } inline bool isSpringy( MiscTableSizing x ) { return (((int)x) & MISC_SIZING_SPRINGY_BIT) != 0; } inline bool isSizeable( MiscTableSizing x ) { return (((int)x) & MISC_SIZING_USER_BIT) != 0; } inline MiscTableSizing setAttribute( MiscTableSizing x, int bit, bool b ) { return (MiscTableSizing) (b ? ((int)x | bit) : ((int)x & ~bit)); } inline MiscTableSizing setSpringy( MiscTableSizing x, bool b ) { return setAttribute( x, MISC_SIZING_SPRINGY_BIT, b ); } inline MiscTableSizing setSizeable( MiscTableSizing x, bool b ) { return setAttribute( x, MISC_SIZING_USER_BIT, b ); } #define MISC_ENUM_CHECK(E,N)\ MiscAssert((unsigned int)(E) <= (unsigned int)(N)) #endif // __MiscTableUtil_h MiscKit/Palettes/MiscTableScroll/MiscTableView.M100444 1750 1750 105377 6757716162 22127 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableView.M // // General-purpose 2-D display object that works with the // MiscTableScroll to provide row/column sizing and dragging. // // This object is responsible for drawing, mouse and keyboard // events in the content portion of the display. // // FIXME: The PostScript pattern used to draw the dotted "keyboard focus" // rectangle gets "out-of-phase" as this view scrolls. Consequently it // does not tile correctly. The Adobe Purple Book section 10.4.4 // implies that the pattern has to be recreated each time the view // changes. (I forsee using -initGState for this.) // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableView.M,v 1.31 98/05/12 13:56:01 zarnuk Exp $ // $Log: MiscTableView.M,v $ // Revision 1.31 98/05/12 13:56:01 zarnuk // v139: Fixed v1 corrupted selection set bug in mouseDown. // // Revision 1.30 97/12/19 01:17:11 zarnuk // v133: Added support to draw clipped text. // // Revision 1.29 97/11/14 20:46:57 zarnuk // v130: Broke off MiscTableViewDrag.M and MiscTableViewCursor.M //----------------------------------------------------------------------------- #import "MiscTableViewPrivate.h" #import "MiscAssert.h" #import "MiscColorList.h" #import "MiscDrawList.h" #import "MiscGeometry.h" #import "MiscHighlightTracker.h" #import "MiscListTracker.h" #import "MiscRadioTracker.h" #import "MiscRectColorList.h" #import "MiscRectList.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import #import #import extern "Objective-C" { #import #import #import #import } extern "C" { #import // floor() } //---------------------------------------------------------------------------- // startTimer //---------------------------------------------------------------------------- static inline void startTimer( NXTrackingTimer*& timer ) { if (timer == 0) timer = NXBeginTimer( 0, 0.1, 0.1 ); } //---------------------------------------------------------------------------- // stopTimer //---------------------------------------------------------------------------- static inline void stopTimer( NXTrackingTimer*& timer ) { if (timer) { NXEndTimer( timer ); timer = 0; } } //----------------------------------------------------------------------------- // dump_map //----------------------------------------------------------------------------- // static void dump_map( char const* label, int const* map, int nc, int nr ) // { // fprintf( stderr, "%s nc=%d, nr=%d\n", label, nc, nr ); // int const* p = map; // for (int r = 0; r < nr; r++) // { // for (int c = 0; c < nc; c++, p++) // fprintf( stderr, " %d", *p ); // fprintf( stderr, "\n" ); // } // } //----------------------------------------------------------------------------- // extract_rect // Extract a contiguous rectangular group of cells to be drawn from // this boolean map of cells that need drawing. // // 1) Find the first cell that needs to be drawn (c0,r0). // 2) Include all contiguous following cells on the same row // that also need to be drawn (cN,r0). // 3) Include all contiguous following rows in which (c0..cN) // all need to be drawn. // 4) Clear the flags from the map to indicate that these cells // do not need to be drawn again. //----------------------------------------------------------------------------- static int extract_rect( int* map, int nc, int nr, MiscCoord_V& c0, MiscCoord_V& r0, MiscCoord_V& cN, MiscCoord_V& rN ) { int* p = map; int* plim = p + (nc * nr); while (p < plim && *p == 0) p++; if (p >= plim) return 0; // *** RETURN *** int rc = *p; int r, c; int const n = p - map; r0 = n / nc; c0 = n % nc; c = c0; while (c < nc && *p == rc) { c++; p++; } cN = c - 1; int const num_cols = (c - c0); r = r0; do { p -= num_cols; memset( p, 0, num_cols * sizeof(*p) ); if (++r >= nr) break; p += nc; plim = p + num_cols; while (p < plim && *p == rc) p++; } while (p >= plim); rN = r - 1; return rc; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableView //----------------------------------------------------------------------------- // - initFrame: // // NOTE *1*: Default behavior is to take keyboard-cursor information from // the row-border. //----------------------------------------------------------------------------- - (id)initFrame:(NXRect const*)frameRect scroll:(MiscTableScroll*)i_scroll colInfo:(MiscTableBorder*)i_col_border rowInfo:(MiscTableBorder*)i_row_border { NXZone* const z = [self zone]; NXRect rect; if (frameRect != 0) rect.origin = frameRect->origin; else { rect.origin.x = 0; rect.origin.y = 0; } rect.size.width = i_col_border->totalSize(); rect.size.height = i_row_border->totalSize(); [super initFrame:&rect]; [self setFlipped:YES]; [self setClipping:NO]; [self setOpaque:YES]; scroll = i_scroll; col_border = i_col_border; row_border = i_row_border; tracker_border = MISC_ROW_BORDER; // NOTE *1* oldColSel = new( NXZoneMalloc(z,sizeof(*oldColSel)) ) MiscSparseSet; oldRowSel = new( NXZoneMalloc(z,sizeof(*oldRowSel)) ) MiscSparseSet; [self setSelectionMode:[scroll selectionMode]]; inhibitCursor = 0; cursorSlot = -1; return self; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { [scroll abortEditing]; [tracker free]; NXZone* const z = [self zone]; if (oldColSel != 0) { oldColSel->MiscSparseSet::~MiscSparseSet(); NXZoneFree( z, oldColSel ); } if (oldRowSel != 0) { oldRowSel->MiscSparseSet::~MiscSparseSet(); NXZoneFree( z, oldRowSel ); } return [super free]; } //----------------------------------------------------------------------------- // - isOpaque //----------------------------------------------------------------------------- - (BOOL)isOpaque { return YES; } //----------------------------------------------------------------------------- // - acceptsFirstMouse //----------------------------------------------------------------------------- - (BOOL)acceptsFirstMouse { return YES; } //----------------------------------------------------------------------------- // - acceptsFirstResponder //----------------------------------------------------------------------------- - (BOOL)acceptsFirstResponder { return YES; } //----------------------------------------------------------------------------- // - adjustSize //----------------------------------------------------------------------------- - (void)adjustSize { [self sizeTo:col_border->totalSize() :row_border->totalSize()]; } //============================================================================= // TYPE VARIATIONS //============================================================================= - (MiscTableBorder*)borderFor:(MiscBorderType)b { return (b == MISC_ROW_BORDER ? row_border : col_border); } - (MiscTableBorder*)otherBorder:(MiscBorderType)b { return [self borderFor:MISC_OTHER_BORDER(b)]; } //============================================================================= // FRAMES //============================================================================= //----------------------------------------------------------------------------- // - getCellFrame:at:: -- Physical coords //----------------------------------------------------------------------------- - (id)getCellFrame:(NXRect*)r at:(MiscCoord_P)row :(MiscCoord_P)col { if (row < 0 || row >= row_border->count() || col < 0 || col >= col_border->count()) NXSetRect( r, 0, 0, 0, 0 ); else { MiscCoord_V v_row = row_border->physicalToVisual( row ); MiscCoord_V v_col = col_border->physicalToVisual( col ); NXSetRect( r, col_border->getOffset(v_col), row_border->getOffset(v_row), col_border->effectiveSize(v_col), row_border->effectiveSize(v_row) ); } return self; } //----------------------------------------------------------------------------- // - getCellInside:at:: -- Actual cell frame inside border lines //----------------------------------------------------------------------------- - (void)getCellInside:(NXRect*)r at:(MiscCoord_P)row :(MiscCoord_P)col { [self getCellFrame:r at:row:col]; if (!NXEmptyRect(r)) { r->size.width--; r->size.height--; } } //----------------------------------------------------------------------------- // - getSlotFrame:at:from: -- Physical coords //----------------------------------------------------------------------------- - (void)getSlotFrame:(NXRect*)r at:(MiscCoord_P)pslot from:(MiscBorderType)bdr { MiscTableBorder* const b = [self borderFor:bdr]; if (pslot < 0 || pslot >= b->count()) NXSetRect( r, 0, 0, 0, 0 ); else { MiscCoord_V vslot = b->physicalToVisual( pslot ); MiscRect_O ro( bdr, bounds ); ro.setX_O( b->getOffset(vslot) ); ro.setWidth_O( b->effectiveSize(vslot) ); *r = ro; } } //----------------------------------------------------------------------------- // - getSlotInside:at:from: -- Physical coords //----------------------------------------------------------------------------- - (void)getSlotInside:(NXRect*)r at:(MiscCoord_P)slot from:(MiscBorderType)bdr { [self getSlotFrame:r at:slot from:bdr]; if (!NXEmptyRect(r)) { r->size.width--; r->size.height--; } } //----------------------------------------------------------------------------- // - getRow:andCol:forPoint: //----------------------------------------------------------------------------- - (id)getRow:(int*)row andCol:(int*)col forPoint:(NXPoint const*)pt { MiscCoord_V const v_row = row_border->visualForOffset( (MiscPixels)pt->y ); MiscCoord_V const v_col = col_border->visualForOffset( (MiscPixels)pt->x ); *row = row_border->visualToPhysical( v_row ); *col = col_border->visualToPhysical( v_col ); return (NXPointInRect( pt, &bounds ) ? self : 0); } //============================================================================= // VISIBLE / SCROLLING STUFF //============================================================================= //----------------------------------------------------------------------------- // - firstVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (int)firstVisibleSlot:(MiscBorderType)bdr { MiscCoord_P ret = -1; MiscTableBorder* const b = [self borderFor:bdr]; int const lim = b->count(); if (lim > 0) { NXRect nxr; [self getVisibleRect:&nxr]; MiscRect_O r( bdr, nxr ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V v = b->visualForOffset( vorg ); if (v < lim - 1 && b->getOffset(v) < vorg && b->getOffset(v+1) < vlim) v++; // First slot whose leading edge is visible ret = b->visualToPhysical( v ); } return ret; } //----------------------------------------------------------------------------- // - lastVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (int)lastVisibleSlot:(MiscBorderType)bdr { MiscCoord_P ret = -1; MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { NXRect nxr; [self getVisibleRect:&nxr]; MiscRect_O r( bdr, nxr ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V v = b->visualForOffset( vlim ); if (v > 0 && b->getOffset(v) + b->effectiveSize(v) > vlim && b->getOffset(v-1) + b->effectiveSize(v-1) > vorg) v--; // Last slot whose trailing edge is visible ret = b->visualToPhysical( v ); } return ret; } //----------------------------------------------------------------------------- // - numVisibleSlots: //----------------------------------------------------------------------------- - (int)numVisibleSlots:(MiscBorderType)bdr { MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { NXRect nxr; [self getVisibleRect:&nxr]; MiscRect_O r( bdr, nxr ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V const first = b->visualForOffset( vorg ); MiscCoord_V const last = b->visualForOffset( vlim ); return last - first + 1; } return 0; } //----------------------------------------------------------------------------- // - border:slotIsVisible: -- Physical coord //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)bdr slotIsVisible:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const xorg = b->getOffset(x); MiscPixels const xlim = xorg + b->effectiveSize(x); NXRect nxr; [self getVisibleRect:&nxr]; MiscRect_O r( bdr, nxr ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); return xorg <= vlim && xlim >= vorg; } return NO; } //----------------------------------------------------------------------------- // - border:setFirstVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr setFirstVisibleSlot:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; int const num_slots = b->count(); if (0 <= n && n < num_slots) { MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const xorg = b->getOffset(x); NXRect nxr; [[self superview] getBounds:&nxr]; MiscRect_O r( bdr, nxr ); r.setX_O( xorg ); NXPoint pt = r; [self scrollPoint:&pt]; } } //----------------------------------------------------------------------------- // - border:setLastVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr setLastVisibleSlot:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; int const num_slots = b->count(); if (0 <= n && n < num_slots) { NXRect nxr; [self getVisibleRect:&nxr]; MiscPixels const vwidth = MiscRect_O( bdr, nxr ).getWidth_O(); MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const vorg = b->getOffset(x) + b->effectiveSize(x) - vwidth; [[self superview] getBounds:&nxr]; MiscRect_O r( bdr, nxr ); r.setX_O( vorg ); NXPoint pt = r; [self scrollPoint:&pt]; } } //============================================================================= // SCROLLING //============================================================================= //----------------------------------------------------------------------------- // - scrollCellToVisible:: -- Physical coords //----------------------------------------------------------------------------- - (void)scrollCellToVisible:(int)row :(int)col { NXRect r; [self getCellFrame:&r at:row:col]; [self scrollRectToVisible:&r]; } //----------------------------------------------------------------------------- // - border:scrollToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr scrollToVisible:(MiscCoord_P)pslot { MiscTableBorder* const b = [self borderFor:bdr]; MiscCoord_V const vslot = b->physicalToVisual( pslot ); NXRect v; [self getVisibleRect:&v]; MiscRect_O r( bdr, v ); r.setX_O( b->getOffset(vslot) ); r.setWidth_O( b->effectiveSize(vslot) ); NXRect nxr = r; [self scrollRectToVisible:&nxr]; } //----------------------------------------------------------------------------- // - scrollRowToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)scrollRowToVisible:(int)row { [self border:MISC_ROW_BORDER scrollToVisible:row]; } //----------------------------------------------------------------------------- // - scrollColToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)scrollColToVisible:(int)col { [self border:MISC_COL_BORDER scrollToVisible:col]; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // - cMin:cMax:rMin:rMax:forRect: //----------------------------------------------------------------------------- - (void)cMin:(MiscCoord_V*)cmin cMax:(MiscCoord_V*)cmax rMin:(MiscCoord_V*)rmin rMax:(MiscCoord_V*)rmax forRect:(NXRect const*)nxrect { *cmin = col_border->visualForOffset( (MiscPixels) nxrect->origin.x ); *cmax = col_border->visualForOffset( (MiscPixels) (nxrect->origin.x + nxrect->size.width) - 1 ); *rmin = row_border->visualForOffset( (MiscPixels) nxrect->origin.y ); *rmax = row_border->visualForOffset( (MiscPixels) (nxrect->origin.y + nxrect->size.height) - 1 ); } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NXRect const*)nxrect { MiscCoord_V c, cmin, cmax, c0, cN; MiscCoord_V r, rmin, rmax, r0, rN; [self cMin:&cmin cMax:&cmax rMin:&rmin rMax:&rmax forRect:nxrect]; if (cmin >= 0 && cmax >= 0 && rmin >= 0 && rmax >= 0) { MiscColorList cl; int const NORM_COLOR = cl.store([scroll backgroundColor]) + 1; int const HIGH_COLOR = cl.store([scroll highlightBackgroundColor]) + 1; int const nc = (cmax - cmin) + 1; int const nr = (rmax - rmin) + 1; int* map = (int*) calloc( nc * nr, sizeof(*map) ); int* p = map; for (r = rmin; r <= rmax; r++) // Transparent and ownerDraw { // cell backgrounds. MiscCoord_P const pr = row_border->visualToPhysical(r); BOOL const row_lit = row_border->isSelected(r); for (c = cmin; c <= cmax; c++,p++) { MiscCoord_P const pc = col_border->visualToPhysical(c); BOOL const lit = row_lit || col_border->isSelected(c); id cell = [scroll cellAt:pr:pc]; if (cell == 0 || ![cell isOpaque]) *p = lit ? HIGH_COLOR : NORM_COLOR; else if ([cell respondsTo:@selector(ownerDraw)] && [cell ownerDraw]) { if (lit && [cell respondsTo: @selector(highlightBackgroundColor)]) *p = cl.store( [cell highlightBackgroundColor] ) + 1; else if ([cell respondsTo:@selector(backgroundColor)]) *p = cl.store( [cell backgroundColor] ) + 1; else *p = lit ? HIGH_COLOR : NORM_COLOR; } } } MiscRectColorList rcl; NXRect rect; int color; while ((color = extract_rect( map, nc, nr, c0, r0, cN, rN )) != 0) { c0 += cmin; cN += cmin; r0 += rmin; rN += rmin; MiscPixels const x0 = col_border->getOffset( c0 ); MiscPixels const y0 = row_border->getOffset( r0 ); MiscPixels const xN = col_border->getOffset( cN ) + col_border->effectiveSize( cN ); MiscPixels const yN = row_border->getOffset( rN ) + row_border->effectiveSize( rN ); rect.origin.x = x0; rect.origin.y = y0; rect.size.width = (xN - x0); rect.size.height = (yN - y0); rcl.append( rect, cl[ color - 1 ] ); } free( map ); MiscPixels x,y; MiscPixels const ix0 = col_border->getOffset( cmin ); MiscPixels const iy0 = row_border->getOffset( rmin ); MiscPixels const ixN = col_border->getOffset( cmax ) + col_border->effectiveSize( cmax ); MiscPixels const iyN = row_border->getOffset( rmax ) + row_border->effectiveSize( rmax ); MiscRectList grid_rl; // Grid drawing list. y = iy0; // Horizontal grid lines. rect.origin.x = floor( (float) ix0 ); rect.size.width = floor( (float) (ixN - ix0) ); rect.size.height = 1; for (r = rmin; r <= rmax; r++) { MiscPixels const h = row_border->effectiveSize(r); y += h - 1; rect.origin.y = floor( (float) y ); grid_rl.append( rect ); y++; } x = ix0; // Vertical grid lines. rect.origin.y = floor( (float) iy0 ); rect.size.width = 1; rect.size.height = floor( (float) (iyN - iy0) ); for (c = cmin; c <= cmax; c++) { MiscPixels const w = col_border->effectiveSize(c); x += w - 1; rect.origin.x = floor( (float) x ); grid_rl.append( rect ); x++; } rcl.draw(); grid_rl.draw( NX_COLORGRAY ); NXColor const fgColor = [scroll textColor]; NXColor const hfgColor = [scroll highlightTextColor]; Font* const fnt = [scroll font]; MiscDrawList dl( [scroll drawClippedText] ); y = iy0; // Cell contents. for (r = rmin; r <= rmax; r++) { MiscCoord_P const pr = row_border->visualToPhysical(r); BOOL const row_lit = row_border->isSelected(r); MiscPixels const h = row_border->effectiveSize(r); rect.origin.y = floor( (float) y ); rect.size.height = floor( (float) (h - 1) ); x = ix0; for (c = cmin; c <= cmax; c++) { MiscCoord_P const pc = col_border->visualToPhysical(c); BOOL const lit = row_lit || col_border->isSelected(c); MiscPixels const w = col_border->effectiveSize(c); rect.origin.x = x; rect.size.width = (w - 1); id cell = [scroll cellAt:pr:pc]; if (cell == 0 || [cell respondsTo:@selector(ownerDraw)] && [cell ownerDraw]) { dl.append( rect, cell, lit, (lit ? hfgColor : fgColor), fnt ); } else [cell drawSelf:&rect inView:self]; x += w; } y += h; } dl.draw(); if ([self shouldDrawCursor]) { NXRect clip = {{ ix0, iy0 },{ ixN - ix0, iyN - iy0 }}; [self drawCursorClipTo:&clip]; } } } //----------------------------------------------------------------------------- // - drawSelf:: //----------------------------------------------------------------------------- - (id)drawSelf:(NXRect const*)rects :(int)nrects { BOOL const need_clip = ([subviews count] != 0); if (need_clip) { PSgsave(); NXRectClip( rects ); } if (nrects == 1) [self drawRect:rects]; else if (nrects == 3) { [self drawRect:++rects]; [self drawRect:++rects]; } if (need_clip) PSgrestore(); return self; } //----------------------------------------------------------------------------- // - drawCellAt:: -- Physical coords //----------------------------------------------------------------------------- - (id)drawCellAt:(int)row :(int)col { NXRect r; [self getCellFrame:&r at:row:col]; [self drawSelf:&r:1]; return self; } //----------------------------------------------------------------------------- // - drawRow: -- Physical coord //----------------------------------------------------------------------------- - (id)drawRow:(int)row { if ([self canDraw] && row >= 0 && row < row_border->count()) { MiscCoord_V const vRow = row_border->physicalToVisual(row); MiscPixels const offset = row_border->getOffset(vRow); MiscPixels const size = row_border->effectiveSize(vRow); NXRect r; [self getVisibleRect:&r]; if (offset + size >= NX_Y(&r) && offset < NX_MAXY(&r)) { r.origin.y = row_border->getOffset(vRow); r.size.height = row_border->effectiveSize(vRow); BOOL const didLock = ![self isFocusView]; if (didLock) [self lockFocus]; [self drawRect:&r]; if (didLock) [self unlockFocus]; } } return self; } //----------------------------------------------------------------------------- // - drawCol: -- Physical coord //----------------------------------------------------------------------------- - (id)drawCol:(int)col { if ([self canDraw] && col >= 0 && col < col_border->count()) { MiscCoord_V const vCol = col_border->physicalToVisual(col); MiscPixels const offset = col_border->getOffset(vCol); MiscPixels const size = col_border->effectiveSize(vCol); NXRect r; [self getVisibleRect:&r]; if (offset + size >= NX_X(&r) && offset < NX_MAXX(&r)) { r.origin.x = col_border->getOffset(vCol); r.size.width = col_border->effectiveSize(vCol); BOOL const didLock = ![self isFocusView]; if (didLock) [self lockFocus]; [self drawRect:&r]; if (didLock) [self unlockFocus]; } } return self; } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - setSelectionMode: //----------------------------------------------------------------------------- - (void)setSelectionMode:(MiscSelectionMode)mode { NXZone* const z = [self zone]; if (tracker != 0) [tracker free]; switch (mode) { case MISC_LIST_MODE: tracker = [MiscListTracker allocFromZone:z]; break; case MISC_RADIO_MODE: tracker = [MiscRadioTracker allocFromZone:z]; break; case MISC_HIGHLIGHT_MODE: tracker = [MiscHighlightTracker allocFromZone:z]; break; } [tracker initBorder:[self borderFor:tracker_border]]; } //----------------------------------------------------------------------------- // - selectionChanged //----------------------------------------------------------------------------- - (void)selectionChanged { MiscSparseSet const& newColSel = col_border->selectionSet(); MiscSparseSet const& newRowSel = row_border->selectionSet(); if ([self isAutodisplay] && [self canDraw]) { MiscCoord_V c, cmin, cmax; MiscCoord_V r, rmin, rmax; NXRect vis; [self getVisibleRect:&vis]; [self cMin:&cmin cMax:&cmax rMin:&rmin rMax:&rmax forRect:&vis]; int const nc = (cmax - cmin) + 1; int const nr = (rmax - rmin) + 1; int* const map = (int*) calloc( nc * nr, sizeof(*map) ); int* pmap = map; for (r = rmin; r <= rmax; r++) { BOOL rowWasOn = oldRowSel->contains(r); BOOL rowIsOn = newRowSel.contains(r); for (c = cmin; c <= cmax; c++, pmap++) { BOOL wasOn = rowWasOn || oldColSel->contains(c); BOOL isOn = rowIsOn || newColSel.contains(c); if (isOn != wasOn) *pmap = 1; } } *oldColSel = newColSel; *oldRowSel = newRowSel; MiscCoord_V c0, cN; MiscCoord_V r0, rN; BOOL locked = NO; while (extract_rect( map, nc, nr, c0, r0, cN, rN ) != 0) { if (!locked) { locked = YES; [window disableFlushWindow]; [self lockFocus]; } c0 += cmin; cN += cmin; r0 += rmin; rN += rmin; MiscPixels const x0 = col_border->getOffset(c0); MiscPixels const y0 = row_border->getOffset(r0); MiscPixels const xN = col_border->getOffset(cN) + col_border->effectiveSize(cN); MiscPixels const yN = row_border->getOffset(rN) + row_border->effectiveSize(rN); NXRect v; v.origin.x = floor( (float) x0 ); v.origin.y = floor( (float) y0 ); v.size.width = floor( (float)( xN - x0 ) ); v.size.height = floor( (float)( yN - y0 ) ); [self drawSelf:&v:1]; } if (locked) { [self unlockFocus]; [window reenableFlushWindow]; [window flushWindow]; } free( map ); } else { *oldColSel = newColSel; *oldRowSel = newRowSel; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - resetSelection //----------------------------------------------------------------------------- - (void)resetSelection { *oldColSel = col_border->selectionSet(); *oldRowSel = row_border->selectionSet(); } //----------------------------------------------------------------------------- // - trackBy: //----------------------------------------------------------------------------- - (void)trackBy:(MiscBorderType)b { tracker_border = b; } //----------------------------------------------------------------------------- // - trackingBy //----------------------------------------------------------------------------- - (MiscBorderType)trackingBy { return tracker_border; } //============================================================================= // MOUSE TRACKING //============================================================================= //----------------------------------------------------------------------------- // - constrainSlot:inBorder: //----------------------------------------------------------------------------- - (MiscCoord_V)constrainSlot:(MiscCoord_V)s inBorder:(MiscTableBorder*)b { if (s < 0) s = 0; else if (s >= b->count()) s = b->count() - 1; return s; } //----------------------------------------------------------------------------- // - sendAction:to: // // NOTE *1*: Conforms to Control's -sendAction:to: which does *not* send // any message if the "action" is null. //----------------------------------------------------------------------------- - (id)sendAction:(SEL)cmd to:(id)obj { if (cmd != 0) // NOTE *1* return ([NXApp sendAction:cmd to:obj from:scroll] ? self : 0); return 0; } //----------------------------------------------------------------------------- // - setClickedCellFromEvent: //----------------------------------------------------------------------------- - (void)setClickedCellFromEvent:(NXEvent const*)e { NXPoint p = e->location; [self convertPoint:&p fromView:0]; MiscCoord_V const v_row = (p.y < NX_MAXY(&bounds) ? row_border->visualForOffset( (MiscPixels)p.y ) : -1); MiscCoord_V const v_col = (p.x < NX_MAXX(&bounds) ? col_border->visualForOffset( (MiscPixels)p.x ) : -1); MiscCoord_P const p_row = row_border->visualToPhysical( v_row ); MiscCoord_P const p_col = col_border->visualToPhysical( v_col ); [scroll setClickedRow:p_row col:p_col]; } //----------------------------------------------------------------------------- // - cellTrackMouse:at:: //----------------------------------------------------------------------------- - (BOOL)cellTrackMouse:(NXEvent*)p at:(MiscCoord_V)v_row :(MiscCoord_V)v_col { BOOL upInCell = NO; MiscCoord_P const p_col = col_border->visualToPhysical( v_col ); MiscCoord_P const p_row = row_border->visualToPhysical( v_row ); NXRect rect; [self getCellInside:&rect at:p_row:p_col]; id cell = [scroll cellAt:p_row:p_col]; [scroll setClickedRow:p_row col:p_col]; if ([scroll editIfAble:p at:p_row:p_col]) upInCell = YES; else if ([self canPerformDrag:p at:p_row:p_col]) upInCell = [self awaitDragEvent:p at:p_row:p_col inRect:&rect]; else if ([cell isEnabled]) { [self lockFocus]; [scroll setTracking:YES]; [cell setParameter:NX_CELLHIGHLIGHTED to:1]; [scroll drawCellAt:p_row:p_col]; [window flushWindow]; upInCell = [cell trackMouse:p inRect:&rect ofView:self]; [scroll setTracking:NO]; [cell setParameter:NX_CELLHIGHLIGHTED to:0]; [scroll drawCellAt:p_row:p_col]; [self unlockFocus]; [window flushWindow]; } return upInCell; } //----------------------------------------------------------------------------- // - mouseDown: // // NOTE: *OUT-OF-BOUNDS* // The AppKit allows up to 3 pixels of slop on double-clicks even when // the new location is outside the bounds of the view receiving the // original click. They send the second event to the original view, but // they do not coerce the location to the same location as the original // event. Our code assumes all mouseDown: events are located within // the bounds of our view, so reject all events outside our bounds. //----------------------------------------------------------------------------- - (id)mouseDown:(NXEvent*)p { int const WANTED = (NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK | NX_TIMERMASK); BOOL const doubleClicked = (p->data.mouse.click > 1); NXPoint evpt = p->location; [self convertPoint:&evpt fromView:0]; float const x = evpt.x; // NOTE *OUT-OF-BOUNDS* float const y = evpt.y; if (x >= 0 && x < bounds.size.width && y >= 0 && y < bounds.size.height) { MiscCoord_V const v_col = col_border->visualForOffset((MiscPixels)x); MiscCoord_V const v_row = row_border->visualForOffset((MiscPixels)y); MiscAssert( v_col >= 0 ); MiscAssert( v_col < col_border->count() ); MiscAssert( v_row >= 0 ); MiscAssert( v_row < row_border->count() ); MiscCoord_V slot = (tracker_border == MISC_COL_BORDER ? v_col : v_row); MiscTableBorder* const b = [self borderFor:tracker_border]; [self eraseCursor]; [self disableCursor]; BOOL const was_auto = [self isAutodisplay]; // To reflect selection. [self setAutodisplay:YES]; [scroll selectText:self]; [tracker mouseDown:p atPos:slot]; [self otherBorder:tracker_border]->selectNone(); [scroll selectionChanged]; BOOL mouseUpInCell = NO; if ([scroll isEnabled]) mouseUpInCell = [self cellTrackMouse:p at:v_row:v_col]; if (!mouseUpInCell) { int old_mask = [window addToEventMask:NX_MOUSEDRAGGEDMASK]; NXTrackingTimer* timer = 0; startTimer( timer ); NXEvent lastEvent = *p; for (;;) { p = [NXApp getNextEvent:WANTED]; if (p == 0 || p->type == NX_MOUSEUP) break; else if (p->type == NX_TIMER) [self autoscroll:&lastEvent]; else lastEvent = *p; NXPoint new_loc = lastEvent.location; [self convertPoint:&new_loc fromView:0]; MiscPixels const offset = MiscPoint_O( tracker_border, new_loc ).getX_O(); MiscCoord_V const new_slot = (offset < MiscRect_O(tracker_border,bounds).getMaxX_O() ? b->visualForOffset(offset) : b->count()); if (new_slot != slot) { slot = new_slot; [tracker mouseDragged:p atPos:slot]; [scroll selectionChanged]; } } stopTimer( timer ); [window setEventMask:old_mask]; [self setClickedCellFromEvent:p]; } [tracker mouseUp:p atPos:slot]; [scroll selectionChanged]; [scroll border:tracker_border setCursor: b->visualToPhysical([self constrainSlot:slot inBorder:b])]; [self reenableCursor]; if ([self shouldDrawCursor]) [self drawCursor]; [self setAutodisplay:was_auto]; [window flushWindow]; if ([scroll isEnabled]) { [scroll sendAction]; if (doubleClicked && ![scroll isEditing]) // FIXME: not right [scroll sendDoubleAction]; } return self; } return 0; } @end MiscKit/Palettes/MiscTableScroll/MiscTableView.h100444 1750 1750 12053 6757716162 22126 0ustar sunshinesunshine#ifndef __MiscTableView_h #define __MiscTableView_h //============================================================================= // // Copyright (C) 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableView.h // // General-purpose 2-D display object that works with the // MiscTableScroll to provide row/column sizing and dragging. // // This object is responsible for drawing, mouse and keyboard // events in the content portion of the display. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableView.h,v 1.13 97/12/19 01:15:59 zarnuk Exp $ // $Log: MiscTableView.h,v $ // Revision 1.13 97/12/19 01:15:59 zarnuk // v133: Fixed copyright notice. Trimmed log. // // Revision 1.12 97/12/19 01:15:16 zarnuk // v133: Now prints corner view. // // Revision 1.11 97/11/14 20:45:46 zarnuk // v130: Started breaking it up. //----------------------------------------------------------------------------- extern "Objective-C" { #import #import } #import @class MiscBorderView, MiscCornerView, MiscMouseTracker, MiscTableScroll; @class Cell, Text; class MiscSparseSet; class MiscTableBorder; struct MiscTSPageBreak { MiscPixels offset; MiscPixels size; MiscCoord_V first; // One's comp if started on earlier page. MiscCoord_V last; // One's comp if ends on later page. }; struct MiscTSPageImages { NXImage* page_header; NXImage* page_footer; NXImage* col_titles; NXImage* row_titles; NXImage* corner_view; }; struct MiscTablePages { MiscTablePrintInfo info; MiscTSPageBreak* col_breaks; MiscTSPageBreak* row_breaks; MiscTSPageImages* images; id pageHeader; id pageFooter; MiscBorderView* colTitles; MiscBorderView* rowTitles; MiscCornerView* cornerView; NXCoord page_header_height; NXCoord page_footer_height; NXCoord col_titles_height; NXCoord row_titles_width; }; @interface MiscTableView : View { MiscTableScroll* scroll; MiscTableBorder* col_border; MiscTableBorder* row_border; MiscBorderType tracker_border; MiscMouseTracker* tracker; MiscSparseSet* oldColSel; MiscSparseSet* oldRowSel; MiscTablePages* pages; unsigned int inhibitCursor; MiscCoord_V cursorSlot; } - (id)initFrame:(NXRect const*)frameRect scroll:(MiscTableScroll*)i_scroll colInfo:(MiscTableBorder*)i_col_border rowInfo:(MiscTableBorder*)i_row_border; - (void)adjustSize; - (void)getCellInside:(NXRect*)r at:(MiscCoord_P)row :(MiscCoord_P)col; - (id)getCellFrame:(NXRect*)rect at:(int)row :(int)col; // Physical coords - (id)getRow:(int*)row andCol:(int*)col // Physical coords forPoint:(NXPoint const*)point; - (id)drawCellAt:(int)row :(int)col; - (id)drawRow:(int)row; // Physical coord - (id)drawCol:(int)col; // Physical coord - (void)scrollCellToVisible:(int)row :(int)col; // Physical coords - (void)scrollRowToVisible:(int)row; // Physical coord - (void)scrollColToVisible:(int)col; // Physical coord - (int)numVisibleSlots:(MiscBorderType)b; // all physical coords. - (int)firstVisibleSlot:(MiscBorderType)b; - (int)lastVisibleSlot:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n; - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n; - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n; - (void)setSelectionMode:(MiscSelectionMode)mode; - (void)selectionChanged; - (void)resetSelection; - (void)trackBy:(MiscBorderType)b; - (MiscBorderType)trackingBy; - (id)sendAction:(SEL)cmd to:(id)obj; - (id)mouseDown:(NXEvent*)event; @end // KEYBOARD CURSOR ------------------------------------------------------------ @interface MiscTableView(Cursor) - (void)reflectCursor; - (void)disableCursor; // Can nest. - (void)reenableCursor; - (BOOL)isCursorEnabled; - (void)drawCursor; - (void)eraseCursor; - (BOOL)shouldDrawCursor; - (void)keyboardSelect:(NXEvent const*)p; - (void)moveCursorBy:(int)delta; @end // PRINTING ------------------------------------------------------------------- @interface MiscTableView(Print) - (id)printPSCode:(id)sender; - (BOOL)knowsPagesFirst:(int*)first last:(int*)last; - (BOOL)getRect:(NXRect*)r forPage:(int)page; - (id)placePrintRect:(NXRect const*)r offset:(NXPoint*)p; - (id)drawPageBorder:(float)width :(float)height; - (MiscTablePrintInfo const*)getPrintInfo; @end #endif // __MiscTableView_h MiscKit/Palettes/MiscTableScroll/MiscTableViewCursor.M100444 1750 1750 26211 6757716162 23272 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewCursor.M // // Keyboard cursor methods for MiscTableView. // // FIXME: The PostScript pattern used to draw the dotted "keyboard focus" // rectangle gets "out-of-phase" as this view scrolls. Consequently it // does not tile correctly. The Adobe Purple Book section 10.4.4 // implies that the pattern has to be recreated each time the view // changes. (I forsee using -initGState for this.) // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewCursor.M,v 1.3 99/06/29 07:55:31 sunshine Exp $ // $Log: MiscTableViewCursor.M,v $ // Revision 1.3 99/06/29 07:55:31 sunshine // v140: Sends new -didBecomeFirstResponder & -didResignFirstResponder // messages to MiscTableScroll. No longer notifies FontManager upon becoming // first responder. MiscTableScroll is now responsible for that. // // Revision 1.2 98/03/24 05:41:15 sunshine // v138: Fixed #import ("..." vs. <...>) for MiscKit compatibility. //----------------------------------------------------------------------------- #import #import "MiscTableViewPrivate.h" #import "MiscAssert.h" #import "MiscTableBorder.h" #import "MiscMouseTracker.h" extern "Objective-C" { #import } extern "C" { #import "MiscTableViewPS.h" #import // floor() } int const NUM_EDGES = 4; // 4 edges to draw per focus rectangle int const NUM_COORDS = 4; // 4 coords per rectangle (x,y,w,h) int const MAX_COORDS = NUM_EDGES * NUM_COORDS; // 16 coords per 4 rects //----------------------------------------------------------------------------- // init_pswrap //----------------------------------------------------------------------------- static inline void init_pswrap() { static initialized = NO; if (!initialized) { initialized = YES; MISC_TV_initps(); } } @implementation MiscTableView(Cursor) //============================================================================= // CURSOR DRAWING //============================================================================= - (BOOL)isCursorEnabled { return (inhibitCursor == 0); } - (void)disableCursor { inhibitCursor++; } - (void)reenableCursor { inhibitCursor--; } //----------------------------------------------------------------------------- // - shouldDrawCursor //----------------------------------------------------------------------------- - (BOOL)shouldDrawCursor { Window* w = [self window]; return ([self isCursorEnabled] && [self canDraw] && [w isKeyWindow] && [w firstResponder] == (id)self); } //----------------------------------------------------------------------------- // - getCursorSlot //----------------------------------------------------------------------------- - (MiscCoord_V)getCursorSlot { MiscTableBorder* const b = [self borderFor:tracker_border]; MiscCoord_V vslot = b->getCursor(); int const lim = b->count(); if (lim > 0 && (vslot < 0 || vslot >= lim)) { vslot = b->selectedSlot(); if (vslot < 0) vslot = b->physicalToVisual([self firstVisibleSlot:tracker_border]); MiscAssert( 0 <= vslot ); MiscAssert( vslot < lim ); b->setCursor( vslot ); } return vslot; } //----------------------------------------------------------------------------- // - getCursorFrame: //----------------------------------------------------------------------------- - (NXRect)getCursorFrame:(NXRect const*)clip { NXRect ret = {{ 0,0 }, { 0,0 }}; if (row_border->count() > 0 && col_border->count() > 0) { MiscTableBorder* const b = [self borderFor:tracker_border]; MiscCoord_P const pslot = b->visualToPhysical( [self getCursorSlot] ); if (pslot >= 0) { NXRect r; [self getSlotInside:&r at:pslot from:tracker_border]; if (NXIntersectsRect( &r, clip )) ret = r; } } return ret; } //----------------------------------------------------------------------------- // - getCursorEdges:clipTo: // // Compute rectangles for drawing which make up the edges of the "focus // frame". Each edge is composed of values from the focus frame, // possibly including its: X, Y, MAXX, MAXY. //----------------------------------------------------------------------------- - (int)getCursorEdges:(NXRect*)edges clipTo:(NXRect const*)clip { struct TV_Lines { char xs, maxxs, xc, ys, maxys, yc, ws, wc, hs, hc; }; static TV_Lines const LINES[ NUM_EDGES ] = { { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 }, // top { 1, 0, 0, 0, 1, -1, 1, 0, 0, 1 }, // bottom { 1, 0, 0, 1, 0, 1, 0, 1, 1, -2 }, // left { 0, 1, -1, 1, 0, 1, 0, 1, 1, -2 }, // right }; NXRect* edge = edges; NXRect r = [self getCursorFrame:clip]; if (!NXEmptyRect( &r )) { for (int i = 0; i < NUM_EDGES; i++) { TV_Lines const& l = LINES[i]; NXSetRect( edge, l.xs * NX_X(&r) + l.maxxs * NX_MAXX(&r) + l.xc, l.ys * NX_Y(&r) + l.maxys * NX_MAXY(&r) + l.yc, l.ws * NX_WIDTH(&r) + l.wc, l.hs * NX_HEIGHT(&r) + l.hc ); if (NXIntersectionRect( clip, edge ) != 0) edge++; } } return (edge - edges); } //----------------------------------------------------------------------------- // - getCursorCoords:clipTo: //----------------------------------------------------------------------------- - (int)getCursorCoords:(NXCoord*)coords clipTo:(NXRect const*)in_clip { int num_coords = 0; NXRect clip; if (in_clip == 0) [self getVisibleRect:&clip]; else clip = *in_clip; NXRect edges[ NUM_EDGES ]; int const num_edges = [self getCursorEdges:edges clipTo:&clip]; if (num_edges > 0) { NXCoord* p = coords; for (int i = 0; i < num_edges; i++) { NXRect* edge = &edges[i]; *p++ = NX_X( edge ); *p++ = NX_Y( edge ); *p++ = NX_WIDTH( edge ); *p++ = NX_HEIGHT( edge ); } num_coords = num_edges * NUM_COORDS; } return num_coords; } //----------------------------------------------------------------------------- // - drawCursorCoords:count: //----------------------------------------------------------------------------- - (void)drawCursorCoords:(NXCoord const*)coords count:(int)n { init_pswrap(); BOOL needsFocus = ![self isFocusView]; if (needsFocus) [self lockFocus]; MISC_TV_dashedrects( coords, n ); if (needsFocus) [self unlockFocus]; } //----------------------------------------------------------------------------- // - drawCursorClipTo: //----------------------------------------------------------------------------- - (void)drawCursorClipTo:(NXRect const*)clip { if ([self isCursorEnabled]) { NXCoord coords[ MAX_COORDS ]; int const num_coords = [self getCursorCoords:coords clipTo:clip]; if (num_coords > 0) { [self drawCursorCoords:coords count:num_coords]; cursorSlot = [self borderFor:tracker_border]->getCursor(); } } } //----------------------------------------------------------------------------- // - drawCursor //----------------------------------------------------------------------------- - (void)drawCursor { [self drawCursorClipTo:0]; } //----------------------------------------------------------------------------- // - eraseCursor //----------------------------------------------------------------------------- - (void)eraseCursor { if ([self isCursorEnabled]) { MiscTableBorder* const b = [self borderFor:tracker_border]; if (cursorSlot >= 0 && cursorSlot < b->count()) { [self disableCursor]; MiscCoord_P s = b->visualToPhysical( cursorSlot ); if (tracker_border == MISC_COL_BORDER) [self drawCol:s]; else [self drawRow:s]; [self reenableCursor]; cursorSlot = -1; } } } //----------------------------------------------------------------------------- // - becomeFirstResponder //----------------------------------------------------------------------------- - (id)becomeFirstResponder { Window* win = [self window]; if (win && [win isKeyWindow]) { if ([self shouldDrawCursor]) { [self drawCursor]; [win flushWindow]; } [scroll didBecomeFirstResponder]; } return self; } //----------------------------------------------------------------------------- // - resignFirstResponder //----------------------------------------------------------------------------- - (id)resignFirstResponder { [self eraseCursor]; [[self window] flushWindow]; [scroll didResignFirstResponder]; return self; } //----------------------------------------------------------------------------- // - becomeKeyWindow //----------------------------------------------------------------------------- - (id)becomeKeyWindow { if ([self shouldDrawCursor]) { [self drawCursor]; [[self window] flushWindow]; } [[FontManager new] setSelFont:[scroll font] isMultiple:NO]; return self; } //----------------------------------------------------------------------------- // - resignKeyWindow //----------------------------------------------------------------------------- - (id)resignKeyWindow { [self eraseCursor]; [[self window] flushWindow]; return self; } //----------------------------------------------------------------------------- // - reflectCursor //----------------------------------------------------------------------------- - (void)reflectCursor { if ([self shouldDrawCursor]) { Window* w = [self window]; [w disableFlushWindow]; [self eraseCursor]; [self drawCursor]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - moveCursorBy: //----------------------------------------------------------------------------- - (void)moveCursorBy:(int)delta { MiscTableBorder* const b = [self borderFor:tracker_border]; int const lim = b->count(); if (lim > 0) { MiscCoord_V slot = b->getCursor() + delta; if (slot < 0) slot = lim - 1; else if (slot >= lim) slot = 0; b->setCursor( slot ); Window* const w = [self window]; [w disableFlushWindow]; [self reflectCursor]; [self border:tracker_border scrollToVisible:b->visualToPhysical(slot)]; [w reenableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - keyboardSelect: //----------------------------------------------------------------------------- - (void)keyboardSelect:(NXEvent const*)p { [tracker mouseDown:p atPos:[self borderFor:tracker_border]->getCursor()]; } @end MiscKit/Palettes/MiscTableScroll/MiscTableViewDrag.M100444 1750 1750 21534 6757716163 22676 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewDrag.M // // Image dragging methods for MiscTableView. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewDrag.M,v 1.2 98/03/24 04:46:33 sunshine Exp $ // $Log: MiscTableViewDrag.M,v $ // Revision 1.2 98/03/24 04:46:33 sunshine // v138: Implemented -shouldDelayWindowOrderingForEvent: // // Revision 1.1 97/11/14 20:43:54 zarnuk // v130: Image dragging methods. //----------------------------------------------------------------------------- #import "MiscTableViewPrivate.h" #import "MiscTableScrollPrivate.h" #import extern "Objective-C" { #import } extern "C" { #import // floor() } typedef MiscDelegateFlags DF; @implementation MiscTableView(Drag) //============================================================================= // IMAGE DRAGGING //============================================================================= static inline float absval( float x ) { return (x < 0 ? -x : x ); } static inline BOOL isSlop( NXEvent* e1, NXEvent* e2, float const slop ) { return (absval(e1->location.x - e2->location.x) <= slop && absval(e1->location.y - e2->location.y) <= slop); } //----------------------------------------------------------------------------- // draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (NXDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag { id const d = [scroll responsibleDelegate:DF::DEL_DRAG_OP_MASK]; if (d != 0) return [d tableScroll:scroll draggingSourceOperationMaskForLocal:flag]; return NX_DragOperationGeneric; } //----------------------------------------------------------------------------- // ignoreModifierKeysWhileDragging //----------------------------------------------------------------------------- - (BOOL)ignoreModifierKeysWhileDragging { id const d = [scroll responsibleDelegate:DF::DEL_DRAG_IGNORE_MODIFIERS]; if (d != 0) return [d tableScrollIgnoreModifierKeysWhileDragging:scroll]; return YES; } //----------------------------------------------------------------------------- // shouldDelayWindowOrderingForEvent: //----------------------------------------------------------------------------- - (BOOL)shouldDelayWindowOrderingForEvent:(NXEvent*)e { BOOL delay = NO; NXPoint p = e->location; [self convertPoint:&p fromView:0]; MiscCoord_P r,c; if ([self getRow:&r andCol:&c forPoint:&p] && [self canPerformDrag:e at:r:c]) { id d = [scroll responsibleDelegate:DF::DEL_DRAG_DELAY_WIN_ORDERING]; if (d != 0) delay = [d tableScroll:scroll shouldDelayWindowOrderingForEvent:e]; else delay = YES; } return delay; } //----------------------------------------------------------------------------- // getDragImageAt:: //----------------------------------------------------------------------------- - (NXImage*)getDragImageAt:(MiscCoord_P)row :(MiscCoord_P)col { NXImage* i = 0; id const d = [scroll responsibleDelegate:DF::DEL_IMAGE_FOR_DRAG]; if (d != 0) i = [d tableScroll:scroll imageForDragOperationAt:row:col]; if (i == 0) { id cell = [scroll cellAt:row:col]; if ([cell type] == NX_ICONCELL) i = [cell image]; } return i; } //----------------------------------------------------------------------------- // calcOrigin:andOffset:forImage:inRect:at::downEvent:dragEvent: // // Compute the origin of the image and the offset of the mouse for dragging // via View's -dragImage:at:offset:... method. There are two cases: // // CASE *1*: The image being dragged fits exactly in the Cell's image area. // In this case drag from the point where the mouse went down inside the // image's boundry. This give the visual impression of lifting the image // exactly from where it is sitting; without it jumping to some other // location. // CASE *2*: The image is a different size than the Cell's image area. In // this case just center the image under the mouse. //----------------------------------------------------------------------------- - (void)calcOrigin:(NXPoint*)origin andOffset:(NXPoint*)offset forImage:(NXImage*)image inRect:(NXRect const*)rect at:(MiscCoord_P)row :(MiscCoord_P)col downEvent:(NXEvent*)downEvent dragEvent:(NXEvent*)dragEvent { offset->x = 0; offset->y = 0; NXSize imageSize; [image getSize:&imageSize]; id cell = [scroll cellAt:row:col]; NXRect iconRect = *rect; [cell getIconRect:&iconRect]; if (imageSize.width == iconRect.size.width && // CASE *1* imageSize.height == iconRect.size.height) { *origin = iconRect.origin; if ([self isFlipped]) origin->y += iconRect.size.height; if (dragEvent != 0 && dragEvent->type == NX_MOUSEDRAGGED) { offset->x = dragEvent->location.x - downEvent->location.x; offset->y = dragEvent->location.y - downEvent->location.y; } } else // CASE *2* { *origin = downEvent->location; [self convertPoint:origin fromView:nil]; origin->x -= floor( imageSize.width / 2 ); origin->y -= floor( imageSize.height / 2 ) * ([self isFlipped] ? -1 : 1); } } //----------------------------------------------------------------------------- // prepareDragPasteboard:at:: //----------------------------------------------------------------------------- - (void)prepareDragPasteboard:(Pasteboard*)pb at:(MiscCoord_P)row :(MiscCoord_P)col { id const d = [scroll responsibleDelegate:DF::DEL_PREPARE_PB_FOR_DRAG]; if (d != 0) [d tableScroll:scroll preparePasteboard:pb forDragOperationAt:row:col]; } //----------------------------------------------------------------------------- // performDrag:at::inRect:dragEvent: //----------------------------------------------------------------------------- - (BOOL)performDrag:(NXEvent*)mouseDown at:(MiscCoord_P)row :(MiscCoord_P)col inRect:(NXRect const*)r dragEvent:(NXEvent*)dragEvent { BOOL ret = NO; NXImage* i = [self getDragImageAt:row:col]; if (i != 0) { NXPoint origin, offset; [self calcOrigin:&origin andOffset:&offset forImage:i inRect:r at:row:col downEvent:mouseDown dragEvent:dragEvent]; Pasteboard* pb = [Pasteboard newName:NXDragPboard]; [self prepareDragPasteboard:pb at:row:col]; [self dragImage:i at:&origin offset:&offset event:mouseDown pasteboard:pb source:self slideBack:YES]; ret = YES; } return ret; } //----------------------------------------------------------------------------- // awaitDragEvent:at:: //----------------------------------------------------------------------------- - (BOOL)awaitDragEvent:(NXEvent*)p at:(MiscCoord_P)row :(MiscCoord_P)col inRect:(NXRect const*)rect { float const DELAY = 0.25; float const SLOP = 4.0; int const WANTED = (NX_MOUSEUPMASK | NX_MOUSEDRAGGEDMASK); BOOL ret = NO; NXEvent mouseDown = *p; NXEvent* event; NXEvent peeker; int old_mask = [[self window] addToEventMask:WANTED]; do { event = [NXApp peekNextEvent:WANTED into:&peeker waitFor:DELAY threshold:NX_MODALRESPTHRESHOLD]; if (event != 0 && event->type == NX_MOUSEDRAGGED) event = [NXApp getNextEvent:NX_MOUSEDRAGGEDMASK]; } while (event != 0 && event->type == NX_MOUSEDRAGGED && isSlop( event, &mouseDown, SLOP )); [[self window] setEventMask:old_mask]; if (event == 0 || event->type == NX_MOUSEDRAGGED) ret = [self performDrag:&mouseDown at:row:col inRect:rect dragEvent:event]; return ret; } //----------------------------------------------------------------------------- // canPerformDrag:at:: //----------------------------------------------------------------------------- - (BOOL)canPerformDrag:(NXEvent*)p at:(MiscCoord_P)r :(MiscCoord_P)c { id const d = [scroll responsibleDelegate:DF::DEL_ALLOW_DRAG]; return (d != 0 && [d tableScroll:scroll allowDragOperationAt:r:c] && [scroll responsibleDelegate:DF::DEL_PREPARE_PB_FOR_DRAG] != 0 && ([[scroll cellAt:r:c] type] == NX_ICONCELL || [scroll responsibleDelegate:DF::DEL_IMAGE_FOR_DRAG] != 0)); } @end MiscKit/Palettes/MiscTableScroll/MiscTableViewPrint.M100444 1750 1750 47253 6757716163 23123 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPrint.M // // Printing support for MiscTableScroll. // // FIXME: Move most of this junk up into table scroll. // FIXME: Separate computing the number of pages from doing all the // other work, so that hopefully, we can do all the other work // only if the user proceeds with a print operation. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewPrint.M,v 1.7 99/06/29 07:55:58 sunshine Exp $ // $Log: MiscTableViewPrint.M,v $ // Revision 1.7 99/06/29 07:55:58 sunshine // v140: Removed unused -getWidth: method. // // Revision 1.6 97/12/19 01:18:15 zarnuk // v133: Fixed copyright notice. Trimmed log. // // Revision 1.5 97/12/19 01:17:43 zarnuk // v133: Now prints corner view. //----------------------------------------------------------------------------- #import "MiscTableView.h" #import "MiscAssert.h" #import "MiscBorderView.h" #import "MiscGeometry.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import #import #import } extern "C" { #import // PSscale() #import // floor() } @implementation MiscTableView(Print) //----------------------------------------------------------------------------- // getPrintInfo //----------------------------------------------------------------------------- - (MiscTablePrintInfo const*)getPrintInfo { return (pages != 0) ? &(pages->info) : 0; } //----------------------------------------------------------------------------- // getHeight: //----------------------------------------------------------------------------- - (NXCoord)getHeight:(id)obj { if (obj != 0) if ([obj respondsTo:@selector(getFrame:)]) { NXRect r; [obj getFrame:&r]; return r.size.height; } else if ([obj respondsTo:@selector(getSize:)]) { NXSize r; [obj getSize:&r]; return r.height; } return 0; } //----------------------------------------------------------------------------- // numPagesForBorder:pageSize: //----------------------------------------------------------------------------- - (int)numPagesForBorder:(MiscBorderType)bt pageSize:(NXCoord)scaled_page_size { int npages = 0; // FIXME: Borders with uniform size slots should be much simpler // than this. MiscPixels const page_size = (MiscPixels)floor(scaled_page_size); MiscAssert( page_size > 0 ); MiscTableBorder* const border = (bt == MISC_COL_BORDER ? col_border : row_border); MiscPixels sz_sum = 0; MiscCoord_V const numSlots = border->count(); for (MiscCoord_V vslot = 0; vslot < numSlots; vslot++) { MiscPixels sz = border->effectiveSize(vslot); if (sz <= page_size) { sz_sum += sz; if (sz_sum > page_size) { sz_sum = sz; npages++; } } else { if (sz_sum > 0) npages++; npages += sz / page_size; sz_sum = sz % page_size; } } if (sz_sum >= 0) npages++; return npages; } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- static void append( MiscPixels w, MiscTSPageBreak& bk, MiscTSPageBreak bks[], int n, int num_breaks ) { MiscAssert( n < num_breaks ); bk.size = w; bks[ n ] = bk; bk.offset += w; } //----------------------------------------------------------------------------- // border:pageSize:numPages:calcBreaks: //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bt pageSize:(NXCoord)pageSize numPages:(int)nPages clip:(BOOL)do_clip calcBreaks:(MiscTSPageBreak*)bks { MiscPixels const page_size = (MiscPixels)floor(pageSize); // FIXME: Borders with uniform size slots should be much simpler // than this. MiscAssert( page_size > 0 ); MiscTableBorder* const border = (bt == MISC_COL_BORDER ? col_border : row_border); MiscTSPageBreak bk; bk.offset = 0; bk.size = 0; bk.first = 0; bk.last = 0; int pg = 0; MiscPixels sz_sum = 0; MiscCoord_V const numSlots = border->count(); for (MiscCoord_V vslot = 0; vslot < numSlots; vslot++) { MiscPixels sz = border->effectiveSize(vslot); if (sz <= page_size) { sz_sum += sz; if (sz_sum > page_size) { bk.last = (vslot - 1); append( sz_sum - sz, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; bk.first = vslot; sz_sum = sz; } } else { if (sz_sum > 0) { bk.last = (vslot - 1); append( sz_sum, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; } bk.first = vslot; bk.last = ~vslot; do { append( page_size, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; bk.first = ~vslot; sz -= page_size; } while (sz > page_size); sz_sum = sz; } } if (sz_sum >= 0) { bk.last = numSlots - 1; append( sz_sum, bk, bks, pg++, nPages ); } clip_exit: MiscAssert( pg == nPages ); } //----------------------------------------------------------------------------- // getImageForView:inRect: //----------------------------------------------------------------------------- - (NXImage*)getImageForView:(id)view inRect:(NXRect const*)rect { NXStream* s = NXOpenMemory( 0, 0, NX_READWRITE ); [view copyPSCodeInside:rect to:s]; NXSeek( s, 0, NX_FROMSTART ); NXImage* image = [[NXImage alloc] initFromStream:s]; NXCloseMemory( s, NX_FREEBUFFER ); return image; } //----------------------------------------------------------------------------- // - getImageForView: //----------------------------------------------------------------------------- - (NXImage*)getImageForView:(id)view { NXRect b; [view getBounds:&b]; return [self getImageForView:view inRect:&b]; } //----------------------------------------------------------------------------- // getImages:info: //----------------------------------------------------------------------------- - (void)getImages:(MiscTSPageImages*)img info:(MiscTablePrintInfo const*)info { img->page_header = 0; img->page_footer = 0; img->col_titles = 0; img->row_titles = 0; img->corner_view = 0; if (pages->pageHeader != 0) { id delg = [scroll responsibleDelegate: MiscDelegateFlags::DEL_PRINT_PAGE_HEADER]; if (delg != 0) [delg tableScroll:scroll willPrintPageHeader:pages->pageHeader info:info]; // FIXME: Need to shrink/grow/center/position. img->page_header = [self getImageForView:pages->pageHeader]; } if (pages->pageFooter != 0) { id delg = [scroll responsibleDelegate: MiscDelegateFlags::DEL_PRINT_PAGE_FOOTER]; if (delg != 0) [delg tableScroll:scroll willPrintPageFooter:pages->pageFooter info:info]; // FIXME: Need to shrink/grow/center/position. img->page_footer = [self getImageForView:pages->pageFooter]; } if (pages->colTitles != 0) { NXRect r = info->print_rect; r.origin.y = 0; r.size.height = pages->col_titles_height; img->col_titles = [self getImageForView:pages->colTitles inRect:&r]; } if (pages->rowTitles != 0) { NXRect r = info->print_rect; r.origin.x = 0; r.size.width = pages->row_titles_width; img->row_titles = [self getImageForView:pages->rowTitles inRect:&r]; } if (pages->cornerView != 0) { NXRect r; r.origin.x = 0; r.origin.y = 0; r.size.width = pages->row_titles_width; r.size.height = pages->col_titles_height; img->corner_view = [self getImageForView:pages->cornerView inRect:&r]; } } //----------------------------------------------------------------------------- // calcPages //----------------------------------------------------------------------------- - (BOOL)calcPages { BOOL ok = YES; // FIXME: Deal with pages that are too small, etc. pages = new MiscTablePages; pages->pageHeader = [scroll getPageHeader]; pages->pageFooter = [scroll getPageFooter]; pages->page_header_height = [self getHeight: pages->pageHeader]; pages->page_footer_height = [self getHeight: pages->pageFooter]; pages->colTitles = [scroll colTitles]; pages->rowTitles = [scroll rowTitles]; if (pages->colTitles != 0 && pages->rowTitles != 0) pages->cornerView = [scroll cornerView]; else pages->cornerView = 0; pages->col_titles_height = [scroll colTitlesHeight]; pages->row_titles_width = [scroll rowTitlesWidth]; NXCoord scroll_width = [scroll totalWidth]; NXCoord scroll_height = [scroll totalHeight]; NXCoord total_width = scroll_width + pages->row_titles_width; NXCoord total_height = scroll_height + pages->col_titles_height; PrintInfo* const printInfo = [NXApp printInfo]; NXRect const* const paperRect = [printInfo paperRect]; float leftMargin, rightMargin, topMargin, bottomMargin; [printInfo getMarginLeft:&leftMargin right:&rightMargin top:&topMargin bottom:&bottomMargin]; NXCoord page_width = paperRect->size.width - leftMargin - rightMargin; NXCoord page_height = paperRect->size.height - topMargin - bottomMargin - pages->page_header_height - pages->page_footer_height; int const hPagination = [printInfo horizPagination]; int const vPagination = [printInfo vertPagination]; BOOL hScaled = NO; double hScaler = 1.0; BOOL vScaled = NO; double vScaler = 1.0; BOOL isScaled = NO; double scaleFactor = 1.0; if (hPagination == NX_FITPAGINATION && total_width > page_width) { hScaled = YES; hScaler = double(page_width) / double(total_width); } if (vPagination == NX_FITPAGINATION && total_height > page_height) { vScaled = YES; vScaler = double(page_height) / double(total_height); } if (hScaled || vScaled) { isScaled = YES; if (vScaler < hScaler) scaleFactor = vScaler; else scaleFactor = hScaler; } float const EPSILON = 0.0001; float const pScaler = [printInfo scalingFactor]; if (pScaler < (1.0 - EPSILON) || (1.0 + EPSILON) < pScaler) { if (isScaled) scaleFactor *= pScaler; else { scaleFactor = pScaler; isScaled = YES; } } pages->info.is_scaled = isScaled; pages->info.scale_factor = scaleFactor; NXCoord scaled_page_width = page_width; NXCoord scaled_page_height = page_height; if (isScaled) { scaled_page_width = double(page_width) / scaleFactor; scaled_page_height = double(page_height) / scaleFactor; } scaled_page_width -= pages->row_titles_width; scaled_page_height -= pages->col_titles_height; //--- Calculate the number of rows/cols/pages ------------------------- int ncols = 1; int nrows = 1; if (hPagination != NX_CLIPPAGINATION && scroll_width > scaled_page_width) ncols = [self numPagesForBorder:MISC_COL_BORDER pageSize:scaled_page_width]; if (vPagination != NX_CLIPPAGINATION && scroll_height > scaled_page_height) nrows = [self numPagesForBorder:MISC_ROW_BORDER pageSize:scaled_page_height]; MiscAssert( nrows > 0 ); MiscAssert( ncols > 0 ); int const npages = nrows * ncols; //--- Allocate arrays ------------------------------------------------- pages->col_breaks = (MiscTSPageBreak*) malloc( (ncols + nrows) * sizeof(MiscTSPageBreak) ); pages->row_breaks = pages->col_breaks + ncols; MiscTSPageImages* images = (MiscTSPageImages*) malloc( npages * sizeof(*images) ); pages->images = images; //--- Prepare print rectangles and border images ---------------------- [self border:MISC_COL_BORDER pageSize:scaled_page_width numPages:ncols clip:(hPagination == NX_CLIPPAGINATION) calcBreaks:pages->col_breaks]; [self border:MISC_ROW_BORDER pageSize:scaled_page_height numPages:nrows clip:(vPagination == NX_CLIPPAGINATION) calcBreaks:pages->row_breaks]; MiscTablePrintInfo& info = pages->info; info.page_rect = *paperRect; info.num_print_pages = npages; info.num_print_rows = nrows; info.num_print_cols = ncols; info.scale_factor = scaleFactor; info.is_scaled = isScaled; int pg = 0; MiscTSPageImages* img = images; MiscTSPageBreak const* rbk = pages->row_breaks; for (int r = 0; r < nrows; r++,rbk++) { info.print_rect.origin.y = rbk->offset; info.print_rect.size.height = rbk->size; info.first_print_row = rbk->first; info.last_print_row = rbk->last; MiscTSPageBreak const* cbk = pages->col_breaks; for (int c = 0; c < ncols; c++,cbk++,img++) { info.print_rect.origin.x = cbk->offset; info.print_rect.size.width = cbk->size; info.first_print_col = cbk->first; info.last_print_col = cbk->last; info.print_page = ++pg; [self getImages:img info:&info]; } } return ok; } //----------------------------------------------------------------------------- // freePages //----------------------------------------------------------------------------- - (void)freePages { if (pages->col_breaks != 0) { free( pages->col_breaks ); pages->col_breaks = 0; } if (pages->images != 0) { for (int i = pages->info.num_print_pages; i-- > 0; ) { MiscTSPageImages const& img = pages->images[i]; if (img.page_header != 0) [img.page_header free]; if (img.page_footer != 0) [img.page_footer free]; if (img.col_titles != 0) [img.col_titles free]; if (img.row_titles != 0) [img.row_titles free]; if (img.corner_view != 0) [img.corner_view free]; } free( pages->images ); pages->images = 0; } delete pages; pages = 0; } //----------------------------------------------------------------------------- // printPSCode: //----------------------------------------------------------------------------- - (id)printPSCode:(id)sender { id rc = 0; id del = [scroll responsibleDelegate:MiscDelegateFlags::DEL_WILL_PRINT]; if (del != 0) [del tableScrollWillPrint:scroll]; if ([self calcPages]) { rc = [super printPSCode:sender]; [self freePages]; } del = [scroll responsibleDelegate:MiscDelegateFlags::DEL_DID_PRINT]; if (del != 0) [del tableScroll:scroll didPrint:(rc != 0)]; return rc; } //----------------------------------------------------------------------------- // knowsPagesFirst:last: //----------------------------------------------------------------------------- - (BOOL)knowsPagesFirst:(int*)first last:(int*)last { if (pages != 0) { *first = 1; *last = pages->info.num_print_pages; return YES; } return NO; } //----------------------------------------------------------------------------- // getRect:forPage: //----------------------------------------------------------------------------- - (BOOL)getRect:(NXRect*)rect forPage:(int)n { MiscAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; if (0 < n && n <= info.num_print_pages) { n--; int const r = (n / info.num_print_cols); int const c = (n % info.num_print_cols); MiscTSPageBreak const& cbk = pages->col_breaks[c]; MiscTSPageBreak const& rbk = pages->row_breaks[r]; rect->origin.x = cbk.offset; rect->size.width = cbk.size; rect->origin.y = rbk.offset; rect->size.height = rbk.size; return YES; } return NO; } //----------------------------------------------------------------------------- // placePrintRect:offset: //----------------------------------------------------------------------------- - (id)placePrintRect:(NXRect const*)rect offset:(NXPoint*)pt { float ml,mr,mt,mb; PrintInfo* const printInfo = [NXApp printInfo]; NXRect const* const paperRect = [printInfo paperRect]; [printInfo getMarginLeft:&ml right:&mr top:&mt bottom:&mb]; float x = paperRect->origin.x; float y = paperRect->origin.y; float h = paperRect->size.height; float w = paperRect->size.width; float rh = rect->size.height; float rw = rect->size.width; float tw = pages->row_titles_width; float th = pages->col_titles_height; float hh = pages->page_header_height; MiscAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; if (info.is_scaled) { float const k = info.scale_factor; x /= k; y /= k; h /= k; w /= k; ml /= k; mr /= k; mt /= k; mb /= k; } pt->x = x + ml + tw; pt->y = y + h - mt - rh - hh - th; if ([printInfo isHorizCentered]) { float dx = w - ml - mr - tw - rw; if (dx > 0) pt->x += dx / 2; } if ([printInfo isVertCentered]) { float dy = h - mt - mb - th - rh; if (dy > 0) pt->y -= dy / 2; } return self; } //----------------------------------------------------------------------------- // drawImage:at: //----------------------------------------------------------------------------- - (void) drawImage:(NXImage*)img at:(NXPoint)pt { NXRect r; [img getSize:&(r.size)]; r.origin.x = pt.x; r.origin.y = pt.y - r.size.height; [img drawRepresentation:[img lastRepresentation] inRect:&r]; } //----------------------------------------------------------------------------- // drawPageBorder:: //----------------------------------------------------------------------------- - (id)drawPageBorder:(float)width :(float)height { MiscAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; int n = [[NXApp printInfo] currentPage] - 1; MiscAssert( 0 <= n ); MiscAssert( n < info.num_print_pages ); MiscTSPageImages const& img = pages->images[n]; NXPoint pt; float ml,mr,mt,mb, k = 1; PrintInfo* const printInfo = [NXApp printInfo]; [printInfo getMarginLeft:&ml right:&mr top:&mt bottom:&mb]; NXPoint const& page_origin = info.page_rect.origin; NXSize const& page_size = info.page_rect.size; NXCoord bottom = page_origin.y + mb; NXCoord top = page_origin.y + page_size.height - mt; NXCoord left = page_origin.x + ml; NXCoord right = page_origin.x + page_size.width - mr; if (info.is_scaled) { k = info.scale_factor; PSscale( k, k ); bottom /= k; top /= k; left /= k; right /= k; } if (img.page_header != 0) { pt.y = top; pt.x = left; [self drawImage:img.page_header at:pt]; top -= pages->page_header_height; } if (img.page_footer != 0) { bottom += pages->page_footer_height; pt.x = left; pt.y = bottom; [self drawImage:img.page_footer at:pt]; } float dx = 0; float dy = 0; if ([printInfo isHorizCentered]) { int const c = (n % info.num_print_cols); dx = right - left - pages->row_titles_width - pages->col_breaks[c].size; if (dx > 0) dx /= 2; else dx = 0; } if ([printInfo isVertCentered]) { int const r = (n / info.num_print_cols); dy = top - bottom - pages->col_titles_height - pages->row_breaks[r].size; if (dy > 0) dy /= 2; else dy = 0; } if (img.corner_view != 0) { pt.x = left + dx; pt.y = top - dy; [self drawImage:img.corner_view at:pt]; } if (img.row_titles != 0) { pt.x = left + dx; pt.y = top - pages->col_titles_height - dy; [self drawImage:img.row_titles at:pt]; } if (img.col_titles != 0) { pt.x = left + pages->row_titles_width + dx; pt.y = top - dy; [self drawImage:img.col_titles at:pt]; } return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableViewPrivate.h100444 1750 1750 3675 6757716163 23454 0ustar sunshinesunshine#ifndef __MiscTableViewPrivate_h #define __MiscTableViewPrivate_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPrivate.h // // Private methods for MiscTableView. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewPrivate.h,v 1.1 97/11/14 20:45:13 zarnuk Exp $ // $Log: MiscTableViewPrivate.h,v $ // Revision 1.1 97/11/14 20:45:13 zarnuk // v130: Private table view methods. // //----------------------------------------------------------------------------- #import "MiscTableView.h" @interface MiscTableView(Private) - (MiscTableBorder*)borderFor:(MiscBorderType)b; - (void)getSlotInside:(NXRect*)r at:(MiscCoord_P)slot from:(MiscBorderType)bdr; - (void)border:(MiscBorderType)bdr scrollToVisible:(MiscCoord_P)pslot; // CURSOR --------------------------------------------------------------------- - (void)drawCursorClipTo:(NXRect const*)clip; // DRAGGING ------------------------------------------------------------------- - (BOOL)canPerformDrag:(NXEvent*)p at:(MiscCoord_P)r :(MiscCoord_P)c; - (BOOL)awaitDragEvent:(NXEvent*)p at:(MiscCoord_P)r :(MiscCoord_P)c inRect:(NXRect const*)rect; @end #endif // __MiscTableViewPrivate_h MiscKit/Palettes/MiscTableScroll/MiscTableWell.M100444 1750 1750 4406 6757716164 22051 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableWell.M // // View class that draws a well where a column/row laid before dragging // was started. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableWell.M,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscTableWell.M,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- #import "MiscTableWell.h" extern "Objective-C" { #import #import } @implementation MiscTableWell //----------------------------------------------------------------------------- // - initFrame: //----------------------------------------------------------------------------- - initFrame: (NXRect const*) frameRect { [super initFrame:frameRect]; [self setOpaque:YES]; [self setClipping:NO]; return self; } //----------------------------------------------------------------------------- // - drawSelf:: // // NOTE *1*: Should be filling 'rects' rather than 'bounds' but during // auto-scrolling I found that drawing 'rects' only was // insufficient. It didn't fully cover the background as it // should have. I don't know why, currently. //----------------------------------------------------------------------------- - drawSelf: (NXRect const*) rects : (int) nrects { float const MED_GRAY = 0.5; PSsetgray( MED_GRAY ); NXRectFill( &bounds ); // NOTE *1* return self; } @end MiscKit/Palettes/MiscTableScroll/MiscTableWell.h100444 1750 1750 2750 6757716164 22104 0ustar sunshinesunshine#ifndef __MiscTableWell_h #define __MiscTableWell_h //============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableWell.h // // View class that draws a well where a column/row laid before dragging // was started. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableWell.h,v 1.1 95/09/27 12:21:21 zarnuk Exp $ // $Log: MiscTableWell.h,v $ // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision // //----------------------------------------------------------------------------- extern "Objective-C" { #import } @interface MiscTableWell : View { } - initFrame: (NXRect const*) frameRect; - drawSelf: (NXRect const*) rects : (int) nrects; @end #endif // __MiscTableWell_h MiscKit/Palettes/MiscTableScroll/MiscTracer.h100444 1750 1750 3627 6757716164 21455 0ustar sunshinesunshine#ifndef __MiscTracer_h #define __MiscTracer_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTracer.h // // Simple C++ class that helps generate function enter/exit // trace messages. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTracer.h,v 1.1 97/12/22 22:00:23 zarnuk Exp $ // $Log: MiscTracer.h,v $ // Revision 1.1 97/12/22 22:00:23 zarnuk // v134: Utility class to create function enter/exit messages. // //----------------------------------------------------------------------------- extern "C" { #include } class MiscTracer { private: static int TRACE_DEPTH; char const* msg; public: MiscTracer( char const* s ): msg(s) { fprintf( stderr, "%*s-> %s\n", TRACE_DEPTH, "", msg ); TRACE_DEPTH += 2; } ~MiscTracer() { TRACE_DEPTH -= 2; fprintf( stderr, "%*s<- %s\n", TRACE_DEPTH, "", msg ); } void foo() const {} // compiler muffler static int get_depth() { return TRACE_DEPTH; } }; #ifdef TRACE_ON #define TRACE(X) MiscTracer mcgh_tracer(X); mcgh_tracer.foo(); #else #define TRACE(X) #endif #endif // __MiscTracer_h MiscKit/Palettes/MiscTableScroll/MiscAssert.cc100444 1750 1750 5525 6757716164 21633 0ustar sunshinesunshine//----------------------------------------------------------------------------- // // Copyright (C) 1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: MiscAssert.cc,v 1.2 97/07/01 10:33:36 sunshine Exp $ // $Log: MiscAssert.cc,v $ // Revision 1.2 97/07/01 10:33:36 sunshine // v128: Re-engineered to properly raise and report assertion failure. // Formatted error message is now stored in NXHandler's data1 so exception // catchers can make use of it. Published and documented exception code. // // Revision 1.1 97/06/10 05:21:41 sunshine // v127: Assertion facility which raises exception rather than calling abort() //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #import "MiscAssert.h" #import #import "bool.h" extern "Objective-C" { #import #import } //----------------------------------------------------------------------------- // assert_reporter //----------------------------------------------------------------------------- static void assert_reporter( NXHandler const* err ) { if (err->code == MISC_TABLE_SCROLL_ASSERTION) NXLogError( (char const*)err->data1 ); else NXLogError( "MiscTableScroll: unrecognized error code %d", err->code ); } //----------------------------------------------------------------------------- // assert_init //----------------------------------------------------------------------------- static inline void assert_init() { static bool done = false; if (!done) { done = true; NXRegisterErrorReporter( MISC_TABLE_SCROLL_ERROR_BASE, MISC_TABLE_SCROLL_ERROR_MAX, assert_reporter ); } } //----------------------------------------------------------------------------- // MiscTableScrollAssert //----------------------------------------------------------------------------- void MiscTableScrollAssert( char const* expr, char const* file, int line ) { assert_init(); static char const ASSERT_FMT[] = "%s:%u: failed assertion `%s'"; int const len = sizeof( ASSERT_FMT ) + strlen( expr ) + strlen( file ) + 32; char* s; NXAllocErrorData( len, (void**)&s ); sprintf( s, ASSERT_FMT, file, line, expr ); NX_RAISE( MISC_TABLE_SCROLL_ASSERTION, s, 0 ); } MiscKit/Palettes/MiscTableScroll/MiscReverseCursor.tiff100444 1750 1750 502 6757716137 23514 0ustar sunshinesunshineMM*t€Þ \f0\fs24 \ · Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 MIME, and ASCII mail accepted. \fs12 \ } MiscKit/Palettes/MiscTableScroll/SELECTION-NOTES.txt100444 1750 1750 2523 6757716134 22213 0ustar sunshinesunshineSELECTION-NOTES GOAL: Cell-wise and slot-wise selection. STRATEGIES: SparseSet2D PRO + Assuming that the selection is usually a reasonably small number of contiguous regions, this should have considerable storage savings. CON - Complicated. Bit Map PRO + Simple. CON - Storage grows linearly with table size. Can get quite large for large tables. Even though lazy-mode might be able to handle a table with a million rows, the storage requirements for the selection might make it infeasible. - Could be quite slow to initialize / clear when it gets big. - Inserting and deleting rows/cols will be tricky and slow. Use "state" in Cells. PRO + Simple. + More like Matrix. + Storage is already taken care of. + Cells know their own state, so know how to draw themselves. CON - Lazy mode is problematic. Client needs to manage storage for selection. - erik hatez it. SparseSet o One per column o One per row o One for entire grid (index = ((row * NCOLS) + col)) PRO + Use existing code. CON - These techniques can easily get hammered by a single "select column" (or "select row") which results in huge amounts of space being used to store the selection in large tables, thus defeating the entire reason for using them. MiscKit/Palettes/MiscTableScroll/TODO.txt100444 1750 1750 12120 6757716170 20557 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll TODO // $Id: TODO.txt,v 1.44 99/06/29 07:56:57 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ---- ** DOCUMENTATION - Usage tips for sorting. - Usage tips for editing. - Common problems ("Gotchas") section. ** KEYBOARD - Add a keyboard equivalent to start text editing in a cell. (Should probably be "return" to maintain symmetry with the mouse double-click. Makes the most sense when cell-wise selection is finally developed and key focus identifies an individual cell instead of an entire slot.) - Consider adding support for up/down keys during editing which would edit the previous and next cells in the current column, respectively. Having done so in Clue.app, we see how extremely nice this feature is. - Upgrade keyboard interaction to mirror OpenStep conventions: Ctrl-tab and Ctrl-Shift-tab when plain tab has other interpretations. ** SELECTION - Cell-wise selection. - Add ability to disable selection -- both for the entire object and for individual slots/cells. - Centralize selection-mode handling during mouse & keyboard tracking. Right now this is spread throughout TableView, BorderView, TableScrollKB, and TableScrollISearch. Each needs to perform selection via either mouse or keyboard, and each reimplements much of the same code. - Need to revamp mouse-tracking, selection. - Allow all cells under mouse to participate in mouse-tracking rather than *only* the first cell under which the mouse went down. - Possibly support single-click-to-edit. This also turned out to be a nice feature in Clue.app. ** DRAGGING - Add dragging-destination support so that images can be dragged-in and dropped on cells. The delegate should get appropriate messages. ** DRAWING - Use display: mechanism to perform drawing. This will fix problems of subviews not getting drawn. - MiscTableView -- route drawRect: through a cell-coordinate oriented -doDrawRange:::: and provide a public -drawRange::: method. Most places where drawing is done in the code, we know the cell coordinates. It does not make sense to convert them to NXRect visual rectangle only to convert it back to cell coordinates. - Fix the handling of the grid. The width for the grid lines should not count as part of the width of the slots. It should be separated from the slots themselves entirely. Move grid drawing out of the *BORDER* cells. (This has already been done for the *table* cells.) - Provide public access / IB methods for selecting grid styles. ** PRINTING - Finish user-supplied page headers/footers. ** FUNCTIONALITY - User should be able to set the width/height of row/col titles, just like resizing normal slots. - Allow copyFont / pasteFont operations. - Add non-anchored incremental search, plus previous/next mechanism. - Add search (find) support. ** INTERFACE BUILDER - Use AltViews / SwapViews in the IB inspector. That panel is way too crowded and we need to add even more stuff. ** MISCELLANEOUS - The C++ MiscTableBorder stuff should be doing its allocations from the table scroll's zone. - Consider adding facilities to automatically save column order and sizes to NeXT defaults (like Window does). - Figure out how icon cells should work precisely. Should they take control of the image display in any way? For instance, if the cell is too small to contain the entire image should it be cropped? Scaled? Not shown? - Subclass hooks for choosing subclass subviews -- make some means for the programmer to choose a different subclass for the table-view, border-view, corner-view. - It has been suggested some methods, such as -deleteRowAt: should throw an exception if the specified row is invalid. This is probably a religious issue, as some people prefer to be very explicit about having to manually check limits, whereas other people prefer that the object be forgiving and simply ignore bad input. On the other hand, there are certainly some cases where ignoring bad input is improper behavior and an exception probably should be thrown in these cases. For instance, there is no sensible value which -tagAtRow: can return when provided with invalid input. Currently it simply returns 0 in this case, but there is no way to determine, from the return value alone, if the row's tag really was 0 or if the row number was simply invalid. DONE: ---- v140 - Stop converting source to 4-space tabs as suggested by the MiscKit guidelines. This decision is motivated by a personal desire to distribute code formatted in a fashion which I prefer. v138 - Dragging-source stuff should also respond to -shouldDelayWindowOrderingForEvent:. Also add a delegate hook. v137 - Add an unsort{Rows|Cols|Slots:} method. (Restore original physical order). border:setSlotOrder: now accepts a null pointer to unsort the slots. v136 - Use NXOrderStrings() for case-insensitive comparisons in MiscTableScroll(Sort) and MiscTableScroll(IncrementalSearch) MiscKit/Palettes/MiscTableScroll/palette.table100444 1750 1750 523 6757716167 21672 0ustar sunshinesunshineClass = MiscTableScrollPalette; /* (a subclass of IBPalette) */ NibFile = MiscTableScroll; /* (a nib file name) */ Icon = MiscTableScroll; /* (a tiff/eps file name) */ ExportClasses = (MiscTableScroll); /* (a list of class names) */ /* ExportImages = (); (a list of image nmaes) */ /* ExportSounds = (); (a list of sound names) */ MiscKit/Palettes/MiscTableScroll/MiscSlotDragCursor.tiff100444 1750 1750 512 6757716137 23621 0ustar sunshinesunshineII*ˆ ð<À@sÌ<ó0Ï0÷ÌÌÿìÌÿÿ0ÿÿ0ÿÿÀÿÿÀ?ÿ?üÀ?ð?üÿüÿÿüÿÿÿÿÿ?ÿÿÿ?ÿÿÿÿÿÿÿÿüÿÿüÿÿðÿÿðÿÿÀÿÿ *2:B(RH@@€ü '€ü 'MiscKit/Palettes/MiscTableScroll/MiscSortAscendH.tiff100444 1750 1750 336 6757716137 23065 0ustar sunshinesunshineMM* *À?ì ?????ÿÿÿÿ ¾ÆÎÖ(R ü€' ü€'MiscKit/Palettes/MiscTableScroll/MiscTableScrollISearch.M100444 1750 1750 35112 6757716157 23663 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollIncSearch.M // // Incremental searching methods for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollISearch.M,v 1.9 99/06/29 07:52:28 sunshine Exp $ // $Log: MiscTableScrollISearch.M,v $ // Revision 1.9 99/06/29 07:52:28 sunshine // v140: Ported back to NextStep 3.2. Compiler complained about signed vs. // unsigned arguments. // // Revision 1.8 98/02/19 16:34:33 zarnuk // v136: Now uses NXOrderStrings. // // Revision 1.7 97/06/10 05:38:45 sunshine // v127: Fixed bug: Incremental-search feedback wasn't being clipped, thus // drew outside of the MiscTableScroll's frame and was never erased. //----------------------------------------------------------------------------- #import #import "MiscBorderCell.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" extern "Objective-C" { #import #import #import #import } extern "C" { #import #import // strncasecmp(). } static float const ISEARCH_TIMEOUT = 2.5; // seconds enum MiscKeyAction { MISC_KEY_IGNORE, // Ignore this event, get next. MISC_KEY_SPACE, // Space character, not valid as first char. MISC_KEY_APPEND, // Append a character to the template. MISC_KEY_EXPAND, // Expand common-prefix. MISC_KEY_DELETE, // Delete the last character from template. MISC_KEY_CLEAR, // Clear (empty) the template. MISC_KEY_SELECT, // Stop, Select the first entry. MISC_KEY_EXECUTE, // Stop, Select and perform double action. MISC_KEY_STOP, // Stop, don't select, consume keystroke. MISC_KEY_ABORT, // Stop, don't select, don't consume. }; //----------------------------------------------------------------------------- // Feedback //----------------------------------------------------------------------------- class MISC_IS_Feedback { private: MiscTableScroll* scroll; BOOL drawn; MiscBorderCell* cell; NXRect drawRect; void init_cell(); public: MISC_IS_Feedback( MiscTableScroll* s ) : scroll(s),drawn(NO),cell(0) {} ~MISC_IS_Feedback() { if (cell != 0) [cell free]; } void draw( char const* str ); void erase(); }; void MISC_IS_Feedback::init_cell() { if (cell == 0) { cell = [[MiscBorderCell allocFromZone:[scroll zone]] initTextCell:""]; [cell setAlignment:NX_LEFTALIGNED]; } } void MISC_IS_Feedback::erase() { if (drawn) { drawn = NO; [scroll display:&drawRect:1]; } } void MISC_IS_Feedback::draw( char const* s ) { init_cell(); [cell setStringValue:s]; NXSize size; [cell calcCellSize:&size]; NXRect clipFrame; [scroll getDocClipFrame:&clipFrame]; NXRect r; NXSetRect( &r, NX_X(&clipFrame), NX_MAXY(&clipFrame) - size.height, size.width, size.height ); NXIntersectionRect( &clipFrame, &r ); [scroll lockFocus]; [cell drawSelf:&r inView:scroll]; [scroll unlockFocus]; drawn = YES; drawRect = r; } //----------------------------------------------------------------------------- // classify_event //----------------------------------------------------------------------------- static MiscKeyAction classify_event( NXEvent const* p ) { int const BAD_FLAGS = (NX_COMMANDMASK|NX_HELPMASK|NX_CONTROLMASK); MiscKeyAction rc = MISC_KEY_ABORT; unsigned char const K_DEL = '\x7f'; unsigned char const K_ALT_SPACE = '\x80'; if (p->type == NX_KEYDOWN) { int const flags = p->flags; if ((flags & BAD_FLAGS) == 0 && p->data.key.charSet == NX_ASCIISET) { unsigned char const ch = (unsigned char) p->data.key.charCode; if (ch == K_DEL || ch == '\b') rc = MISC_KEY_DELETE; else if (ch == '\t') rc = MISC_KEY_EXPAND; else if (ch > ' ' && ch != K_ALT_SPACE) rc = MISC_KEY_APPEND; else if (ch == ' ' || ch == K_ALT_SPACE) rc = MISC_KEY_SPACE; } } else if (p->type == NX_KEYUP || p->type == NX_FLAGSCHANGED) { rc = MISC_KEY_IGNORE; } return rc; } //----------------------------------------------------------------------------- // map // Conditionally apply a mapping vector to an index value. //----------------------------------------------------------------------------- inline static int map( int const* a, int x ) { return a ? a[x] : x; } //----------------------------------------------------------------------------- // DATA RETRIEVAL AND COMPARE SUPPORT //----------------------------------------------------------------------------- typedef char const* (*Datafunc)( id obj, SEL cmd, MiscCoord_P row, MiscCoord_P col ); struct MiscSortTypeInfo { SEL const* data_sel; // Selector to use to retrieve string. BOOL fold_case; // Case insensitive compare? }; #define SEL_STRV &@selector(stringValueAt: :) #define SEL_TITL &@selector(titleAt: :) static MiscSortTypeInfo SORT_TYPE_INFO[ MISC_SORT_TYPE_MAX + 1 ] = { { SEL_STRV, YES }, // MISC_SORT_STRING_CASE_INSENSITIVE { SEL_STRV, NO }, // MISC_SORT_STRING_CASE_SENSITIVE { 0, NO }, // MISC_SORT_INT { 0, NO }, // MISC_SORT_UNSIGNED_INT { 0, NO }, // MISC_SORT_TAG { 0, NO }, // MISC_SORT_UNSIGNED_TAG { 0, NO }, // MISC_SORT_FLOAT { 0, NO }, // MISC_SORT_DOUBLE { 0, NO }, // MISC_SORT_SKIP { SEL_TITL, YES }, // MISC_SORT_TITLE_CASE_INSENSITIVE { SEL_TITL, NO }, // MISC_SORT_TITLE_CASE_SENSITIVE { 0, NO }, // MISC_SORT_STATE { 0, NO }, // MISC_SORT_UNSIGNED_STATE }; #undef SEL_STRV #undef SEL_TITL //----------------------------------------------------------------------------- // bsearch //----------------------------------------------------------------------------- static int bsearch( MiscCoord_V lo, MiscCoord_V hi, BOOL upper_bound, BOOL descending, MiscTableScroll* scroll, char const* buff, int len, MiscCoord_P col, MiscCoord_P const* v2p, Datafunc data_func, SEL data_sel, BOOL fold_case ) { BOOL const case_sensitive = !fold_case; while (lo <= hi) { MiscCoord_V const mid = (lo + hi) >> 1; MiscCoord_P const row = map( v2p, mid ); char const* s = (*data_func)( scroll, data_sel, row, col ); if (s == 0) s = ""; int cmp = NXOrderStrings( (unsigned char const*)s, (unsigned char const*)buff, case_sensitive, len, 0 ); if (descending) cmp = -cmp; if (cmp < 0 || upper_bound && cmp == 0) lo = mid + 1; else hi = mid - 1; } return (upper_bound ? hi : lo); } //----------------------------------------------------------------------------- // peek_event //----------------------------------------------------------------------------- inline static NXEvent* peek_event( NXEvent* buff, float timeout ) { return [NXApp peekNextEvent:NX_ALLEVENTS into:buff waitFor:timeout threshold:NX_BASETHRESHOLD]; } @implementation MiscTableScroll(IncrementalSearch) //----------------------------------------------------------------------------- // -doIncrementalSearch:col: //----------------------------------------------------------------------------- - (BOOL) doIncrementalSearch:(NXEvent*)p col:(int)col { BOOL handled = YES; // Event was handled here. BOOL descending = NO; if (col < 0) { col = ~col; descending = YES; } if ([self border:MISC_COL_BORDER slotSortDirection:col] == MISC_SORT_DESCENDING) descending = !descending; MiscSortType const type = [self border:MISC_COL_BORDER slotSortType:col]; MiscSortTypeInfo const& INFO = SORT_TYPE_INFO[type]; BOOL const fold_case = INFO.fold_case; if (INFO.data_sel == 0 || [self border:MISC_COL_BORDER slotSortFunc:col] != 0) return NO; // *** RETURN *** SEL const data_sel = *(INFO.data_sel); Datafunc const data_func = (Datafunc) [self methodFor:data_sel]; MiscCoord_P const* const v2p = rowInfo.border->getV2PMap(); MISC_IS_Feedback feedback( self ); NXEvent event_buff; MiscKeyAction ka; int const MARGIN = 2; int const BUFF_MAX = 61; int buff_len = 0; char margin[ MARGIN + BUFF_MAX + 1 ]; char* buff = margin + MARGIN; MiscCoord_V first_stk[ BUFF_MAX + 1 ], last_stk[ BUFF_MAX + 1 ]; MiscCoord_V first = 0, last = [self numRows] - 1; MiscCoord_V prev_first = -1; BOOL update_cursor = ([self trackingBy] == MISC_ROW_BORDER); BOOL changed = NO; for (int i = 0; i < MARGIN; i++) margin[i] = ' '; float delay = 0.25; first_stk[0] = first; last_stk [0] = last; ka = classify_event( p ); while (1) { PSobscurecursor(); switch (ka) { case MISC_KEY_IGNORE: break; case MISC_KEY_SPACE: case MISC_KEY_APPEND: if (buff_len < BUFF_MAX && first <= last) { buff[ buff_len++ ] = char( p->data.key.charCode ); buff[ buff_len ] = '\0'; MiscCoord_V const new_first = bsearch( first, last, NO, descending, self, buff, buff_len, col, v2p, data_func, data_sel, fold_case ); MiscCoord_V const new_last = bsearch( new_first, last, YES, descending, self, buff, buff_len, col, v2p, data_func, data_sel, fold_case ); if (new_first <= new_last) { first = new_first; last = new_last; first_stk[ buff_len ] = first; last_stk [ buff_len ] = last; changed = YES; } else // Do not add "invalid" characters. { buff[ --buff_len ] = '\0'; if (ka == MISC_KEY_SPACE) { ka = MISC_KEY_SELECT; goto finished; // *** GOTO *** } else if (buff_len == 0) { // Couldn't even add 1st char, handled = NO; // so don't go modal. goto finished; // *** GOTO *** } else NXBeep(); } } else NXBeep(); break; case MISC_KEY_EXPAND: { if (first <= last) { char const* s; s = (*data_func)(self,data_sel,map(v2p,first),col); strncpy( buff+buff_len, s+buff_len, BUFF_MAX-buff_len ); buff[ BUFF_MAX ] = '\0'; s = (*data_func)(self,data_sel,map(v2p,last),col); int i = buff_len; if (fold_case) { while (buff[i] != '\0' && tolower((unsigned char)buff[i]) == tolower((unsigned char)s[i])) i++; } else { while (buff[i] != '\0' && buff[i] == s[i]) i++; } if (i > buff_len) { for (int j = buff_len + 1; j <= i; j++) { first_stk[j] = first; last_stk[j] = last; } buff_len = i; buff[ buff_len ] = '\0'; changed = YES; } } } break; case MISC_KEY_DELETE: if (buff_len > 0) { buff[ --buff_len ] = '\0'; first = first_stk[ buff_len ]; last = last_stk[ buff_len ]; changed = YES; } else goto finished; // *** GOTO *** break; case MISC_KEY_CLEAR: case MISC_KEY_SELECT: case MISC_KEY_EXECUTE: case MISC_KEY_STOP: case MISC_KEY_ABORT: goto finished; // *** GOTO *** } if ((p = peek_event( &event_buff, delay )) == 0) { if (changed) { changed = NO; [window disableFlushWindow]; feedback.erase(); if (prev_first != first) { prev_first = first; MiscCoord_P const r = map( v2p, first ); [self border:MISC_ROW_BORDER setFirstVisibleSlot:r]; if (update_cursor) [self border:MISC_ROW_BORDER setCursor:r]; } feedback.draw( margin ); [window reenableFlushWindow]; [window flushWindow]; if (buff_len == 0) break; // *** BREAK *** } if ((p = peek_event( &event_buff, ISEARCH_TIMEOUT )) == 0) break; // *** BREAK *** inactivity timeout. } delay = 0.0; ka = classify_event( p ); if (ka != MISC_KEY_ABORT) // "Eat" the event. [NXApp getNextEvent:NX_ALLEVENTS waitFor:ISEARCH_TIMEOUT threshold:NX_BASETHRESHOLD]; } finished: feedback.erase(); if (ka==MISC_KEY_SELECT || ka==MISC_KEY_EXECUTE) { MiscCoord_P const phys_first = map( v2p, first ); [window disableFlushWindow]; if (prev_first != first) { [self border:MISC_ROW_BORDER setFirstVisibleSlot:phys_first]; if (update_cursor) [self border:MISC_ROW_BORDER setCursor:phys_first]; } if (update_cursor) [self keyboardSelect:p]; [[window reenableFlushWindow] flushWindow]; if ([self isEnabled]) { [self sendAction]; if (ka == MISC_KEY_EXECUTE) [self sendDoubleAction]; } } return handled; } //----------------------------------------------------------------------------- // -doGetISearchCol: // Default implementation. If auto-sort-rows is on, and the first // non-skip column is string-based, use that column, else fail. //----------------------------------------------------------------------------- - (BOOL) doGetISearchCol:(int*)col { if ([self autoSortRows]) { int const lim = colInfo.border->count(); int const* v2p = colInfo.border->getV2PMap(); for (int i = 0; i < lim; i++) { int const j = map( v2p, i ); if ([self border:MISC_COL_BORDER slotSortFunc:j] != 0) return NO; MiscSortType const t = [self border:MISC_COL_BORDER slotSortType:j]; if (t != MISC_SORT_SKIP) { *col = j; return (SORT_TYPE_INFO[t].data_sel != 0); } } } return NO; } //----------------------------------------------------------------------------- // -getISearchCol: //----------------------------------------------------------------------------- - (BOOL) getISearchCol:(int*)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_GET_ISEARCH_COL]; if (del != 0) return [del tableScroll:self getISearchCol:col]; return [self doGetISearchCol:col]; } //----------------------------------------------------------------------------- // -incrementalSearch: //----------------------------------------------------------------------------- - (BOOL) incrementalSearch:(NXEvent*)p { if ([self numRows] > 0 && [self numCols] > 0) { MiscKeyAction const ka = classify_event( p ); if (ka == MISC_KEY_APPEND) { int col; if ([self getISearchCol:&col]) return [self doIncrementalSearch:p col:col]; } } return NO; // Event was not handled here. } @end MiscKit/Palettes/MiscTableScroll/MiscColorList.cc100444 1750 1750 5054 6757716165 22302 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColorList.cc // // An extensible array of colors that can act as a color palette to // reduce the storage overhead of storing a lot of colors. Also // useful for speeding color comparisons in some cases. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColorList.cc,v 1.1 96/08/30 14:51:54 sunshine Exp $ // $Log: MiscColorList.cc,v $ // Revision 1.1 96/08/30 14:51:54 sunshine // Extensible array of colors acting as a color palette. // //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscColorList.h" extern "C" { #include // free(), malloc(), realloc() } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscColorList::~MiscColorList() { free( colors ); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscColorList::MiscColorList() { num_colors = 0; max_colors = 8; colors = (NXColor*) malloc( max_colors * sizeof(*colors) ); } //----------------------------------------------------------------------------- // store //----------------------------------------------------------------------------- int MiscColorList::store( NXColor c ) { for (int i = 0; i < num_colors; i++) if (NXEqualColor( colors[i], c )) return i; if (num_colors >= max_colors) { max_colors += max_colors; colors = (NXColor*) realloc( colors, max_colors * sizeof(*colors) ); } colors[ num_colors++ ] = c; return num_colors - 1; } MiscKit/Palettes/MiscTableScroll/MiscDelegateFlags.cc100444 1750 1750 13025 6757716165 23074 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDelegateFlags.cc // // Flags indicating which selectors a delegate responds to. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDelegateFlags.cc,v 1.11 99/06/29 07:33:11 sunshine Exp $ // $Log: MiscDelegateFlags.cc,v $ // Revision 1.11 99/06/29 07:33:11 sunshine // v140: Added new delegate messages for becoming & resigning first responder. // // Revision 1.10 98/03/24 04:52:51 sunshine // v138: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // // Revision 1.9 97/12/22 21:59:05 zarnuk // v134: Eliminated -tableScroll:edit:at::. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscDelegateFlags.h" extern "C" { #include // memset() } static inline unsigned int BYTE_NUM( int x ) { return (x / 8); } static inline unsigned int BIT_NUM( int x ) { return (x % 8); } static inline unsigned char BIT_MASK( int x ) { return (1 << BIT_NUM(x)); } #define PSEL(X) &@selector(X) // *** MUST MATCH ENUM IN .h FILE *** static SEL const* const SELECTORS[ MiscDelegateFlags::MAX_DEL_ENUM ] = { PSEL(tableScroll:border:slotDraggedFrom:to:), PSEL(tableScroll:border:slotSortReversed:), PSEL(tableScroll:border:slotResized:), PSEL(tableScroll:changeFont:to:), PSEL(tableScroll:fontChangedFrom:to:), PSEL(tableScroll:backgroundColorChangedTo:), PSEL(tableScroll:highlightBackgroundColorChangedTo:), PSEL(tableScroll:textColorChangedTo:), PSEL(tableScroll:highlightTextColorChangedTo:), PSEL(tableScroll:getISearchCol:), PSEL(tableScrollBuffCount:), PSEL(tableScroll:border:slotPrototype:), PSEL(tableScroll:border:slotTitle:), PSEL(tableScroll:cellAt: :), PSEL(tableScroll:reviveCell:at: :), PSEL(tableScroll:retireCell:at: :), PSEL(tableScroll:tagAt: :), PSEL(tableScroll:intValueAt: :), PSEL(tableScroll:floatValueAt: :), PSEL(tableScroll:doubleValueAt: :), PSEL(tableScroll:stringValueAt: :), PSEL(tableScroll:titleAt: :), PSEL(tableScroll:stateAt: :), PSEL(tableScrollRegisterServicesTypes:), PSEL(tableScroll:validRequestorForSendType:andReturnType:), PSEL(tableScroll:canWritePboardType:), PSEL(tableScroll:writePboard:type:toStream:), PSEL(tableScroll:writeSelectionToPasteboard:types:), PSEL(tableScroll:readSelectionFromPasteboard:), PSEL(tableScroll:allowDragOperationAt: :), PSEL(tableScroll:preparePasteboard:forDragOperationAt: :), PSEL(tableScroll:imageForDragOperationAt: :), PSEL(tableScroll:draggingSourceOperationMaskForLocal:), PSEL(tableScrollIgnoreModifierKeysWhileDragging:), PSEL(tableScroll:shouldDelayWindowOrderingForEvent:), PSEL(tableScrollWillPrint:), PSEL(tableScroll:didPrint:), PSEL(tableScroll:willPrintPageHeader:info:), PSEL(tableScroll:willPrintPageFooter:info:), PSEL(tableScroll:canEdit:at: :), PSEL(tableScroll:setStringValue:at: :), PSEL(tableScroll:abortEditAt: :), PSEL(tableScroll:willEditAt: :), PSEL(tableScroll:didEdit:at: :), PSEL(textDidEnd:endChar:), PSEL(textDidChange:), PSEL(textDidGetKeys:isEmpty:), PSEL(textWillChange:), PSEL(textWillEnd:), PSEL(tableScrollDidBecomeFirstResponder:), PSEL(tableScrollDidResignFirstResponder:) }; #undef PSEL //----------------------------------------------------------------------------- // selToObjc //----------------------------------------------------------------------------- SEL MiscDelegateFlags::selToObjc( Selector s ) { return *SELECTORS[s]; } //----------------------------------------------------------------------------- // objcToSel //----------------------------------------------------------------------------- MiscDelegateFlags::Selector MiscDelegateFlags::objcToSel( SEL s ) { for (unsigned int i = 0; i < MAX_DEL_ENUM; i++) if (s == *SELECTORS[i]) return (Selector)i; return BAD_DEL_ENUM; } //----------------------------------------------------------------------------- // setDelegate //----------------------------------------------------------------------------- void MiscDelegateFlags::setDelegate( id d ) { if (d == 0) memset( set, 0, SET_SIZE ); else { for (unsigned int i = 0; i < MAX_DEL_ENUM; i++) { unsigned char& byte = set[ BYTE_NUM(i) ]; unsigned char const mask = BIT_MASK(i); if ([d respondsTo:(*SELECTORS[i])]) byte |= mask; else byte &= ~mask; } } } //----------------------------------------------------------------------------- // respondsTo //----------------------------------------------------------------------------- bool MiscDelegateFlags::respondsTo( Selector s ) const { return ((set[ BYTE_NUM(s) ] & BIT_MASK(s)) != 0); } MiscKit/Documentation/ 40755 1750 1750 0 6757716176 15156 5ustar sunshinesunshineMiscKit/Documentation/Classes/ 40755 1750 1750 0 6757716176 16553 5ustar sunshinesunshineMiscKit/Documentation/Classes/MiscTableScroll.rtf100444 1750 1750 1231050 6757716172 22463 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh11280 \margl40 \margr40 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 Release 1.0 Copyright \f1 ã \f0 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine All Rights Reserved.\ Paul S. McCarthy and Eric Sunshine -- June 27, 1999\ \pard\tx2480\tx2860\tx3240\fs28\li2100\fc0\cf0 \ \fs16 \ \pard\f2\b\fs56\li2100\fc0\cf0 MiscTableScroll\ \pard\tx4880\f0\b0\fs80\fi-2780\li4880\fc0\cf0 \ \f2\b\fs28 Inherits From: \f0\b0 ScrollView \fc1\cf1 : View : Responder \fc0\cf0 : Object\ \fs16 \ \f2\b\fs28 Declared In: \f0\b0 \fc1\cf1 MiscTableScroll.h \fc0\cf0 \ \fs20 \ \pard\f2\b\fs52\li1360\fc0\cf0 \ \fs36 Class Description\ \fs16 \ \pard\tx2480\tx2860\tx3240\f0\b0\fs28\li2100\fc0\cf0 This class provides a convenient and powerful user-interface object for displaying and manipulating tabular data. The appearance and behavior is similar to DBTableView, but it does not depend on obsolete packages (DBKit), nor on separately bundled packages (EOF). It does not support DBKit-style adaptors, but future versions might. Although it inherits from ScrollView, the programmatic interface is similar to the Matrix class.\ \ \b User Interface Highlights \b0 \ \fs16 \ \pard\fs28\li3600\fc0\cf0 Scrollable Matrix.\ Column and Row titles.\ Columns and Rows can be resized.\ Columns and Rows can be dragged (rearranged).\ Automatically sorts rows when columns are rearranged.\ Direct user control of sort direction (ascending vs. descending).\ Incremental Search.\ In-cell text editing.\ Exports contents as ASCII, ASCII-delimited, or dBASE.\ Keyboard & mouse control.\ Interacts with the Pasteboard, Font Panel, and Services.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \b Programmatic Highlights \b0 \ \fs16 \ \pard\fs28\li3600\fc0\cf0 Each column and row can have its own size.\ Each column can have its own color and font or inherit them from the table.\ Each column can have its own cell-type.\ Lazy-mode for large or expensive-to-generate data sets.\ Full control over selection.\ Built-in sort support.\ Built-in image-dragging support.\ Smart memory management.\ Delegate methods for most features.\ Simple indexed access to rows and columns.\ Easy-to-use text-cell editing.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \b\fc1\cf1 Delegates\ \b0\fs16\fc0\cf0 \ \fs28 Both a \i delegate \i0 and a \i dataDelegate \i0 can be assigned to MiscTableScroll. Internally MiscTableScroll treats the delegates identically. The distinction between the two is conceptual and provides a convenient mechanism for programmers to cleanly compartmentalize specific object behavior. Conceptually the \i dataDelegate \i0 provides data to MiscTableScroll upon request with methods such as \f3\fs24 -tableScroll:intValueAt:: \f0\fs28 and its cousins. The \i delegate \i0 , on the other hand, responds to messages which control or observe the behavior of MiscTableScroll, such as \f3\fs24 -tableScroll:canEdit:at:: \f0\fs28 or \f3\fs24 -tableScroll:border:slotDraggedFrom:to: \f0\fs28 . This compartmentalization of functionality allows programmers to create a clean division between an object which strictly manages data from one which manages higher level behavior. For most applications, however, it is generally sufficient to have a single object which handles all such functionality and assign it as the \i delegate \i0 . In very simple cases even the \i delegate \i0 may be unnecessary.\ \f2\b\fs16\li1360 \ \f0\b0\fs28\li2100 Delegate messages are only sent to one of the delegates even if both implement a particular message. MiscTableScroll first checks the \i delegate \i0 and then the \i dataDelegate \i0 , and sends the message to the first object which responds to it. If neither responds, then the message is not sent at all.\ \fs16 \ \ \b\fs28 Similarities between Rows and Columns -- Slots and Borders \b0 \ \fs16 \ \fs28 Rows and columns are treated equally wherever it is practical and desirable to do so. Almost every action and option that is available for columns is also available for rows and vice versa. \i Slot \i0 is the generic term for a single column or row. \i Border \i0 is the generic term for row or column orientation. \i Size \i0 is the generic term for width or height. Most methods come in two flavors: a row/column specific flavor that uses \i row \i0 or \i col \i0 as part of the name; and a generic flavor that has a \i border \i0 argument and (when needed) a \i slot \i0 argument. Here are some examples:\ \fs16 \ \pard\tx7920\ul\fs28\li3600\fc0\cf0 Generic \ulnone \ul Specific \ulnone \ - border:setTitlesOn: - setColTitlesOn:\ - setRowTitlesOn:\ - border:setSlot:size: - setCol:size:\ - setRow:size:\ \ \pard\tx2480\tx2860\tx3240\b\li2100\fc0\cf0 Differences between Rows and Columns \b0 \ \fs16 \ \fs28 There are some differences between rows and columns. This object is designed to maximize the efficiency of displaying many rows of data. Hence, it is faster to add and remove rows than columns. You should set up all your columns in InterfaceBuilder, or while the table is empty, then add and remove rows afterwards. Rows are cached for use with the \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 method. This makes it very fast to change the contents of the table on a row-oriented basis. Despite the row-oriented bias, column-oriented operations can be performed at any time; they will just be slower than the corresponding row-oriented operations. This behavior is intrinsic to the implementation, it cannot be changed.\ \fs16 \ \fs28 Cell-prototypes are only used for columns. This behavior can only be changed by subclassing.\ \fs16 \ \fs28 Selection in the body of a table is done on a row-wise basis. This behavior can be changed programmatically via the \f3\fs24\fc1\cf1 -trackBy: \f0\fs28\fc0\cf0 method.\ \fs16 \ \fs28 There are numerous default settings which differ between columns and rows. Most of these options can be changed in InterfaceBuilder; all of them can be changed programmatically. Here is a summary of the defaults which differ between rows and columns:\ \fs16 \ \pard\tx6460\tx9360\tx10820\ul\fs28\li3600\fc0\cf0 Option \ulnone \ul Column Default \ulnone \ul Row Default \ulnone \ modifier drag NO YES\ uniform size NO YES\ user sizeable YES NO\ user draggable YES NO\ titles displayed YES NO\ title mode Custom Auto-Numbered\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \b Slot Sizing \b0 \ \fs16 \ \fs28 Uniform size is the simplest sizing mode. When you set the uniform size of a border to any non-zero value, all slots in that border will have the same (uniform) size. Setting the uniform size of a border to zero enables slots to have individual sizes. By default, rows are uniform size, columns are not.\ \fs16 \ \fs28 If uniform sizing is not set for a border, the following sizing information is maintained for each slot in the border:\ \fs16 \ \pard\fs28\li3600\fc0\cf0 target size\ minimum size\ maximum size\ adjusted size\ user-sizeable-flag\ autosize-flag\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Target size is the desired size for a particular slot. Minimum and maximum sizes are the lower and upper bounds for the size of a slot. Adjusted size is the final display size of the slot after all other factors have been taken into account. When a slot is marked as user-sizeable, the user will be able to resize the slot (subject to further conditions described below). The adjusted size of autosize slots will be increased if needed to prevent a "gap" from appearing when the table is smaller than the display region. The flag values are mutually independent, but user-sizeable and autosize do not mix well. They cause bizarre, counter-intuitive behavior on narrow tables in wide views.\ \fs16 \ \fs28 Users resize columns by dragging the right-hand edge of the column's title cell to the desired width. Likewise, users resize rows by dragging the bottom edge of the row's title cell to the desired height. The cursor changes to a horizontal or vertical resize cursor whenever the cursor is over one of the resizing areas. When users resize a slot, they are setting the target size for the slot on non-uniform-size borders. On uniform-size borders, they are setting the new uniform-size for the border.\ \fs16 \ \fs28 All of the following conditions must be met to enable the user to resize a particular slot:\ \fs16 \ \pard\fs28\fi-420\li4020\fc0\cf0 (a) The title cells must be displayed ( \f3\fs24\fc1\cf1 -border:setTitlesOn:YES \f0\fs28\fc0\cf0 )\ (b) The border in question must allow user-sizing of slots ( \f3\fs24\fc1\cf1 -border:setSizeableSlots:YES \f0\fs28\fc0\cf0 )\ (c) The border must be uniform-size ( \f3\fs24\fc1\cf1 -setBorder:uniformSizeSlots: \f0\fs28\fc0\cf0 ) or the slot in question must be user-sizeable ( \f3\fs24\fc1\cf1 -border:setSlot:sizeable:YES \f0\fs28\fc0\cf0 ).\ (d) There must be some room to grow or shrink between the slot's current adjusted size and the slot's minimum and maximum sizes.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 All of these conditions are met by default for new columns, unless you explicitly disable one of the global options for column sizing.\ \ \b Slot Dragging and Indexing -- Visual vs. Physical \b0 \ \fs16 \ \fs28 Dragging and sizing are independent of each other. You can have borders that are not sizeable in any way, but are still draggable, and vice versa. You can also have borders that are both draggable and sizeable, or neither draggable nor sizeable.\ \fs16 \ \fs28 Users drag slots by dragging the title cells until the leading edge is over the desired new location and "dropping" the slot there. For example, the left edge of the cell shows you where the column will end up when dragging a column to the left. Likewise, the right edge is used when the column is dragged to the right. This makes it possible to clearly see the new location without guessing.\ \fs16 \ \fs28 Dragging must be enabled for a border before users can drag slots in that border. By default, columns are dragged with an unmodified drag, and they are selected with a command-drag. By default, rows are selected with an unmodified drag, and they are dragged with a command-drag. By default, dragging is enabled for columns, but not for rows.\ \fs16 \ \fs28 If slot-dragging is enabled for a border then an internal mapping vector is maintained which translates the original physical position of the slot to its current visual position. All programmer-interface methods and all delegate call-back methods use the original physical position of the slot so you can ignore the current visual ordering in your programs. If you need or want to examine the current visual ordering, you can do so with the \f3\fs24\fc1\cf1 -border:slotPosition: \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -border:slotAtPosition: \f0\fs28\fc0\cf0 methods.\ \ \b Keyboard Operations \b0 \ \fs16 \ \fs28 MiscTableScroll provides keyboard control over almost all functions. Keyboard equivalents are available for scrolling, selection, and performing actions (simulating double-click). This class displays a dashed rectangle around the slot which is currently the focus of keyboard operations. Display of the cursor can be disabled and re-enabled with calls to the methods \f3\fs24\fc1\cf1 -disableCursor \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -reenableCursor \f0\fs28\fc0\cf0 .\ \fs16 \ \fs28 MiscTableScroll objects can be linked into the next-text chain just like TextFields. This can be done directly in InterfaceBuilder \f1 ä \f0 , or programmatically via \f3\fs24\fc1\cf1 -nextText \f0\i\fs28\fc0\cf0 , \f3\i0\fs24\fc1\cf1 -setNextText: \f0\fs28\fc0\cf0 , and related functions.\ \fs16 \ \fs28 The keyboard \i cursor \i0 can be moved with the standard arrow keys as well as the editing keys on the numeric keypad, including the page-up, page-down, home, and end keys -- as well as the \i real \i0 page-up, page-down, home, and end on keyboards which actually supply these keys. For functions which do not normally appear on any keyboard -- such as page-left and page-right -- modified arrow-keys can be used. Please refer to the following table:\ \fs16 \ \pard\tx4680\tx7200\f2\ul\fs24\li2880\fc0\cf0 Key(²) Action Action Modified(³)\ \ulnone space select slot select slot\ return perform action perform action\ up-arrow up page-up\ down-arrow down page-down\ left-arrow left page-left\ right-arrow right page-right\ page-up page-up top-edge\ page-down page-down bottom-edge\ home top-edge left-edge\ end bottom-edge right-edge\ enter(*) perform action perform action\ insert(*) select slot select slot\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3240\tx3720\tx4260\tx4800\tx5320\f2\fs24\fi-360\li3240\fc0\cf0 (²) These functions are recognized when generated from both the standard editing keys as well as those on the numeric keypad.\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3240\tx3720\tx4260\tx4800\tx5320\f2\fs24\fi-360\li3240\fc0\cf0 (³) Modified actions are produced by holding down a modifier while typing the primary key. Any of Shift, Control, or Alt can be used to produce a modified action -- and all have the same affect. So, for instance, one can generate a page-left from any of ctrl-left-arrow, shift-left-arrow, or alt-left-arrow.\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3240\tx3720\tx4260\tx4800\tx5320\f2\fs24\fi-360\li3240\fc0\cf0 (*) Applicable to the numeric keypad only.\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \fs28 Keys which perform the \i select-slot \i0 function simulate a single mouse-click. Keys which perform \i perform-action \i0 simulate a double mouse-click. When performing a \i select-slot \i0 via the keyboard, one can use the same modifier keys one uses when selecting via the mouse. In other words, one can use shift-single-click to select multiple slots (one at a time) with the mouse. Likewise one can use shift-space to select multiple slots (one at a time) with the keyboard.\ \ \b Selection Modes \b0 \ \fs16 \ \fs28 Three selection modes are supported: List, Highlight, and Radio. Unlike Matrix, this class treats the different selection modes as uniformly as possible (see \i Mouse Tracking \i0 below). Methods such as \f3\fs24\fc1\cf1 -selectionMode \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -setSelectionMode: \f0\fs28\fc0\cf0 allow direct control over the mode.\ \fs16 \ \fs28 Methods such as \f3\fs24\fc1\cf1 -hasRowSelection \f0\i\fs28\fc0\cf0 , \f3\i0\fs24\fc1\cf1 -numSelectedRows \f0\i\fs28\fc0\cf0 , \f3\i0\fs24\fc1\cf1 -rowIsSelected: \f0\i\fs28\fc0\cf0 , \i0 as well as the border and slot variations allow selection querying, while methods such as \f3\fs24\fc1\cf1 -selectedRows: \f0\i\fs28\fc0\cf0 , \f3\i0\fs24\fc1\cf1 -selectedRowTags: \f0\i\fs28\fc0\cf0 , \f3\i0\fs24\fc1\cf1 -selectRows: \f0\i\fs28\fc0\cf0 , \i0 and \f3\fs24\fc1\cf1 -selectRowTags: \f0\fs28\fc0\cf0 along with their variations allow batch-oriented selection modification.\ \ \b Mouse Tracking \b0 \ \fs16 \ \fs28 The manner in which MiscTableScroll performs mouse-tracking is different from the manner in which Matrix does so. This class gives the cells the opportunity to track the mouse in \i all \i0 selection modes, whereas Matrix allows the cells to participate in mouse-tracking in all \i but \i0 List mode. Matrix makes a special case of List mode, and in addition to the mouse-tracking difference it also modifies the cells' \i state \i0 variables in this mode. In all other modes Matrix allows the cell's mouse-tracking methods to manipulate the \i state \i0 rather than doing so itself. MiscTableScroll, on the other hand, treats all selection modes uniformly. It always highlights a cell via its \i highlight \i0 flag and \i never \i0 alters the cell's \i state \i0 -- instead it leaves alteration of \i state \i0 to the cell's mouse-tracking methods.\ \fs16 \ \fs28 Upon receipt of a \f3\fs24\fc1\cf1 -mouseDown: \f0\fs28\fc0\cf0 , this class gives the cell at the mouse-down location an opportunity to track the mouse by invoking its \f3\fs24\fc1\cf1 -trackMouse:inRect:ofView: \f0\fs28\fc0\cf0 method. That method normally tracks the mouse until either a mouse-up event in which case it returns YES, or until the mouse leaves the cell-frame in which case it returns NO. If \f3\fs24\fc1\cf1 -trackMouse:inRect:ofView: \f0\fs28\fc0\cf0 returns NO, then MiscTableScroll goes into its own modal-responder loops, continues tracking the mouse itself, and updates the selection appropriately until a mouse-up event. Only the cell under the mouse-down event is given a chance to participate in tracking -- after that no other cells are offered the opportunity.\ \ \b Image Dragging \b0 \ \fs16 \ \fs28 MiscTableScroll has built in support for dragging images directly out of cells using the standard AppKit dragging services. Dragging is enabled by implementing a few simple methods in the delegate or dataDelegate. Two required methods are \f3\fs24\fc1\cf1 -tableScroll:allowDragOperationAt:: \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -tableScroll:preparePasteboard:forDragOperationAt:: \f0\fs28\fc0\cf0 . Each method is passed a pointer to the MiscTableScroll and the cell's physical coordinates. The first method gives the delegate or dataDelegate a chance to permit or veto the drag operation. The second method is responsible for declaring the pasteboard types and providing the data.\ \fs16 \ \fs28 A third delegate method \f3\fs24\fc1\cf1 -tableScroll:imageForDragOperationAt:: \f0\fs28\fc0\cf0 is required for non-image cells and optional for cells which contain an image. This method allows the delegate or dataDelegate to supply an image for dragging. If the cell from which dragging is taking place contains its own image, then this method need not be implemented or can return 0, in which case the cell's own image is used by default.\ \fs16 \ \fs28 Other methods allow the delegate or dataDelegate to respond to the standard dragging source protocol methods. \f2\b\fs16\li1360 \ \f0\b0\li2100 \ \fs28 As with all operations using the NeXT dragging services, one must be careful to ensure that the Pasteboard \i owner, \i0 if non-null, remains valid for as long as the Pasteboard references it. The dragging Pasteboard will continue to reference the \i owner \i0 until such time when another dragging operation is performed -- whether in the same or a different application. In other words, the \i owner \i0 must remain valid even after the dragging operation has completed, and can only be safely discarded after receipt of Pasteboard's \f3\fs24\fc1\cf1 -pasteboardChangedOwner: \f0\fs28\fc0\cf0 message. Two common solutions to this requirement are to either write all the data to the Pasteboard immediately upon type declaration and specify a null \i owner \i0 , or use a reference-counting scheme to ensure that the \i owner \i0 is not destroyed while still referenced by the Pasteboard.\ \ \b Prototype Cells\ \b0\fs16 \ \fs28 In eager mode, each column maintains a prototype cell which is used when new rows are created. When new rows are created, a \f3\fs24\fc1\cf1 -copyFromZone: \f0\fs28\fc0\cf0 message is sent to the prototype cell for each column, and the new copy of the prototype cell is put into the new row. This means that all prototype cells must implement the \f3\fs24\fc1\cf1 -copyFromZone: \f0\fs28\fc0\cf0 method appropriately. They must make copies of all components that are freed when the cell itself is freed.\ \fs16 \ \fs28 The prototype cell can be one of the built-in types (text, icon, or button), it can be supplied by the delegate, or you can set it programmatically. If you set a prototype cell programmatically, the MiscTableScroll object will take "ownership" of the prototype cell -- it will free the cell when it is finished with it. If the delegate provides the prototype cell, the delegate retains ownership -- the MiscTableScroll object will not free prototype cells provided by the delegate.\ \ \b Cell Owner and Inherited Font and Color Attributes \b0 \ \fs16 \ \fs28 The MiscTableScroll class implements an informal \i owner \i0 protocol with the cells that it manages. The MiscTableCell class implements the other side this informal protocol. This protocol enables the cells to specify that they want to inherit their font and color attributes from their owner. In this case, the owner is the MiscTableScroll object. This makes it possible to propagate global \i default \i0 font and color attributes to all such cells easily and efficiently. At the same time, individual cells can use custom font and color attributes which will override the global default inherited values. Cells that use the inherited values do not need to store copies of those inherited values. Only cells that use custom values need to remember and store their own custom values. See the documentation for the MiscTableCell class for more details.\ \ \b Cell Owner and Owner-Draw \b0 \ \fs16 \ \fs28 Another feature of the informal \i owner \i0 protocol is a specialized notion of delegated drawing. All cells that respond YES to the \f3\fs24\fc1\cf1 -ownerDraw \f0\fs28\fc0\cf0 message are drawn by the MiscTableScroll rather than drawing themselves. Since the MiscTableScroll object typically manages many cells with similar font and color attributes, the MiscTableScroll object can eliminate large amounts of redundant font and color setting PostScript code. Likewise, contiguous cells with the same background colors have all of their backgrounds drawn with a single PostScript operator rather than several. The built-in drawing mechanism also eliminates a lot of very expensive clipping path operations by simply not drawing partial characters that would be clipped. (You can force the partially visible text to be displayed with the \f3\fs24\fc1\cf1 -setDrawClippedText:YES \f0\fs28\fc0\cf0 message.) Any object used as a cell in an instance of MiscTableScroll can take advantage of these facilities as long as the cell consists of plain (single font) text with a single (optional) icon, and does not have borders or other drawing requirements. This results in a very considerable improvement in drawing performance -- especially noticable on older, slower CPUs.\ \ \b Lazy vs. Eager \b0 \ \fs16 \ \fs28 In general, eager mode is much easier to use than lazy mode. In eager mode, you can usually take advantage of the cells themselves to store the data that you are retrieving and displaying. Even complex data types can be stored by allocating the record and a storing pointer in the tag for a cell, or the tag for a row. By contrast, lazy mode forces you to manage all the storage yourself. In eager mode, the MiscTableScroll object allocates and manages a dense matrix of cells, which you fill in with data as needed. In lazy mode, the MiscTableScroll object does not manage any cells at all. You are responsible for implementing \f3\fs24\fc1\cf1 -tableScroll:cellAt:: \f0\fs28\fc0\cf0 to provide the MiscTableScroll object with a cell whenever it needs one. In lazy mode, you generally want to implement many of the \f3\fs24\fc1\cf1 -tableScroll:...ValueAt:: \f0\fs28\fc0\cf0 methods to improve performance.\ \ \b Usage Tips \b0 \ \fs16 \ \fs28 For simple, flexible and maintainable access to the columns of the table scroll, you should declare an \b enum \b0 which identifies the columns in the MiscTableScroll, for instance:\ \fs16 \ \f3\fs24\fc1\cf1 enum\ \{\ PHOTO_SLOT,\ LAST_NAME_SLOT,\ FIRST_NAME_SLOT,\ AGE_SLOT\ \};\ \f0\fs16\fc0\cf0 \ \fs28 Then you use the enumeration identifiers whenever you need to specify a column. Using an enumeration this way lets you add, remove and shuffle the slots just by updating the enum declaration, rather than searching through the code to find all the places that need to be fixed. It also makes your code more readable.\ \fs16 \ \fs28 There are two standard patterns for putting the data into eager (non-lazy) MiscTableScroll objects: \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -addRow \f0\fs28\fc0\cf0 .\ \ \b -renewRows \b0 :\ When you know the number of rows in advance, it is most efficient to use the \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 method to tell the MiscTableScroll object the number of rows that you will need. Your code will usually be structured as follows:\ \fs16 \ \f3\fs24\fc1\cf1 int row;\ int const nrows = [dataSource count];\ \ [tableScroll \b renewRows \b0 :nrows];\ \b for \b0 (row = 0; row < nrows; row++)\ \{\ id item = [dataSource itemAt:row];\ [tableScroll setRow:row tag:(int)item];\ [[tableScroll cellAt:row:LAST_NAME_SLOT] setStringValue:[item lastName]];\ [[tableScroll cellAt:row:AGE_SLOT] setIntValue:[item age]];\ //... and so on ...\ \}\ \ if ([tableScroll autoSortRows])\ [tableScroll sortRows];\ \f0\fs28\fc0\cf0 \ \ \b -addRow \b0 \ When you do not know the final number of rows in advance, your code will usually be structured as follows:\ \fs16 \ \f3\fs24\fc1\cf1 id item;\ int row = 0;\ [tableScroll \b empty \b0 ];\ \ \b while \b0 ((item = [self getNextItem]) != 0)\ \{\ [tableScroll \b addRow \b0 ];\ [tableScroll setRow:row tag:(int)item];\ [[tableScroll cellAt:row:LAST_NAME_SLOT] setStringValue:[item lastName]];\ [[tableScroll cellAt:row:AGE_SLOT] setIntValue:[item age]]\ //... and so on ...\ row++;\ \}\ \ [tableScroll \b sizeToCells \b0 ];\ \ if ([tableScroll autoSortRows])\ [tableScroll sortRows];\ \f0\fs16\fc0\cf0 \ \fs28 A common programming mistake is forgetting to call \f3\fs24\fc1\cf1 -sizeToCells \f0\fs28\fc0\cf0 . You must call \f3\fs24\fc1\cf1 -sizeToCells \f0\fs28\fc0\cf0 after you have finished adding rows so that the MiscTableScroll can update the frames of its various subviews. If you forget to call \f3\fs24\fc1\cf1 -sizeToCells \f0\fs28\fc0\cf0 , the MiscTableScroll will appear to be empty when it is displayed.\ \ \b Smart Memory Management \b0 \ \fs16 \ \fs28 The MiscTableScroll class implements \i smart \i0 memory management. It does not allocate support structures until and unless they are needed. For example, since rows are uniform-size by default, the MiscTableScroll will not allocate the array of sizing-info structures until and unless you make the rows non-uniform size. In a complimentary fashion, if you make the columns uniform size, the MiscTableScroll object will free the sizing-info array for the columns. Similarly, custom titles must be stored in an array. However, no other title-mode requires this array, and the array will only exist for borders that have custom titles. Likewise, the visual-to-physical mapping vector that supports user-draggable slots is only created when the first slot is actually moved. Even if the draggable option is turned on, you will not incur the memory overhead until the option is used. The net result of all this is that you only pay for the features that you use. \ \fs16 \ \fs28 On the other hand, you do pay for the features that you do use. These extra features exact a price in storage and cpu. You should be careful about using them for rows when you expect thousands of rows.\ \fs16 \ \fs28 The MiscTableScroll class is designed to provide high-quality, consistent, flexible behavior to the user while supporting a wide range of load requirements -- from dozens of rows to hundreds of thousands of rows. Smart memory management is an important element in achieving that goal.\ \ \b Errors \b0 \ \fs16 \ \fs28 Whenever MiscTableScroll raises an exception, it places a description of the error in NXHandler's \f3\fs24\fc1\cf1 data1 \f0\fs28\fc0\cf0 field. If you catch the exception and wish to display the descriptive message manually then cast the contents of \f3\fs24\fc1\cf1 data1 \f0\fs28\fc0\cf0 to a \f3\fs24\fc1\cf1 (char const*) \f0\fs28\fc0\cf0 and treat it as a standard C-string or, if appropriate, simply call \f3\fs24\fc1\cf1 NXReportError() \f0\fs28\fc0\cf0 .\ \fs16 \ \fs28 The only exception currently raised by MiscTableScroll is \f3\fs24\fc1\cf1 MISC_TABLE_SCROLL_ASSERTION \f0\fs28 . This exception is raised when MiscTableScroll detects an internal inconsistency. This is typically indicative of a bug within this class.\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 This exception is also currently raised when an out-of-range slot index is passed as an argument to a method which can not sensibly handle the bad index. For instance, there is no sensible value which \f3\fs24 -rowTag: \f0\fs28 can return when given a bad index, hence it raises an exception. On the other hand no exception is raised by \f3\fs24 -selectRow: \f0\fs28 since it can simply ignore the bad index. \fc0\cf0 \ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Method Types\ \fs16 \ \pard\tx6140\tx9660\tx10180\f0\b0\fs28\fi-4040\li6140\fc1\cf1 Creating and freeing instances ±€initFrame:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€free\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fc1\cf1 Delegates ±€setDelgate:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€delegate\ ± setDataDelegate:\ ± dataDelegate\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Transmitting action ±€setTarget:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€target\ ± setDoubleTarget:\ ± doubleTarget\ ± setAction:\ ± action\ ± setDoubleAction:\ ± doubleAction\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± sendAction:to:forAllCells:\ ± sendAction:to:\ ± sendAction\ ± sendDoubleAction\ - sendActionIfEnabled\ - sendDoubleActionIfEnabled\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± tracking\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± borderClickedSlot:\ ± clickedRow\ ± clickedCol\ ± clickedCell\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Next-text chain ± setNextText:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€nextText\ ± setPreviousText:\ ± previousText\ ± isSelectable\ ± selectText:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Enabling and disabling ±€setEnabled:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€isEnabled\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Selection ± setSelectionMode:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ±€selectionMode\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:slotIsSelected:\ ± rowIsSelected:\ ± colIsSelected:\ ± cellIsSelected::\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± borderSelectedSlot:\ ± selectedRow\ ± selectedCol\ ± selectedCell\ ± border:selectedTags:\ ± selectedRowTags:\ ± selectedColTags:\ ± border:selectedSlots:\ ± selectedRows:\ ± selectedCols:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:selectSlot:byExtension:\ ± border:selectSlot:\ ± selectRow:byExtension:\ ± selectRow:\ ± selectCol:byExtension:\ ± selectCol:\ ± border:selectTags:byExtension:\ ± border:selectTags:\ ± selectRowTags:byExtension:\ ± selectRowTags:\ ± selectColTags:byExtension:\ ± selectColTags:\ ± border:selectSlots:byExtension:\ ± border:selectSlots:\ ± selectRows:byExtension:\ ± selectRows:\ ± selectCols:byExtension:\ ± selectCols:\ ± borderSelectAll:\ ± selectAllRows\ ± selectAllCols\ ± selectAll:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ±€border:deselectSlot:\ ±€deselectRow:\ ±€deselectCol:\ ± border:deselectTags:\ ±€deselectRowTags:\ ±€deselectColTags:\ ± border:deselectSlots:\ ±€deselectRows:\ ±€deselectCols:\ ± borderClearSelection:\ ± clearRowSelection\ ± clearColSelection\ ±€clearSelection\ ±€deselectAll:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± borderHasSelection:\ ± hasRowSelection\ ± hasColSelection\ ± borderHasMultipleSelection:\ ± hasMultipleRowSelection\ ± hasMultipleColSelection\ ± borderNumSelectedSlots:\ ± numSelectedRows\ ± numSelectedCols\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± trackBy:\ ± trackingBy\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± selectionChanged\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fc1\cf1 Keyboard cursor ± border:setCursor:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± borderClearCursor:\ ± borderCursor:\ ± borderHasValidCursor:\ ± clearCursor\ ± clearCursorCol\ ± clearCursorRow\ ± cursorCol\ ± cursorRow\ ± disableCursor\ ± hasValidCursorCol\ ± hasValidCursorRow\ ± isCursorEnabled\ ± reenableCursor\ ± setCursorCol:\ ± setCursorRow:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fc1\cf1 Incremental search ± incrementalSearch:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± doIncrementalSearch:col:\ ± getISearchCol:\ ± doGetISearchCol:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fc1\cf1 Scrolling ± scrollCellToVisible::\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± scrollColToVisible:\ ± scrollRowToVisible:\ ± scrollSelToVisible\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setFirstVisibleSlot:\ ± border:setLastVisibleSlot:\ ± border:slotIsVisible:\ ± firstVisibleSlot:\ ± lastVisibleSlot:\ ± numVisibleSlots:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± colIsVisible:\ ± firstVisibleCol\ ± lastVisibleCol\ ± numVisibleCols\ ± setFirstVisibleCol:\ ± setLastVisibleCol:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± rowIsVisible:\ ± firstVisibleRow\ ± lastVisibleRow\ ± numVisibleRows\ ± setFirstVisibleRow:\ ± setLastVisibleRow:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Titles \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 border:setTitlesOn:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± setColTitlesOn:\ ± setRowTitlesOn:\ ± borderTitlesOn:\ ± colTitlesOn\ ± rowTitlesOn\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setTitleMode:\ ± setColTitleMode:\ ± setRowTitleMode:\ ± borderTitleMode:\ ± colTitleMode\ ± rowTitleMode\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:title:\ ± setCol:title:\ ± setRow:title:\ ± border:slotTitle:\ ± colTitle:\ ± rowTitle:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± cornerTitle\ ± setCornerTitle:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Sizing \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 border:setUniformSizeSlots:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± border:setMinUniformSizeSlots:\ ± border:setMaxUniformSizeSlots:\ ± setUniformSizeCols:\ ± setMinUniformSizeCols:\ ± setMaxUniformSizeCols:\ ± setUniformSizeRows:\ ± setMinUniformSizeRows:\ ± setMaxUniformSizeRows:\ ± uniformSizeSlots:\ ± minUniformSizeSlots:\ ± maxUniformSizeSlots:\ ± uniformSizeCols\ ± minUniformSizeCols\ ± maxUniformSizeCols\ ± uniformSizeRows\ ± minUniformSizeRows\ ± maxUniformSizeRows\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSizeableSlots:\ ± setSizeableCols:\ ± setSizeableRows:\ ± sizeableSlots:\ ± sizeableCols:\ ± sizeableRows:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:size:\ ± setCol:size:\ ± setRow:size:\ ± border:slotSize:\ ± colSize:\ ± rowSize:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:minSize:\ ± setCol:minSize:\ ± setRow:minSize:\ ± border:slotMinSize:\ ± colMinSize:\ ± rowMinSize:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:maxSize:\ ± setCol:maxSize:\ ± setRow:maxSize:\ ± border:slotMaxSize:\ ± colMaxSize:\ ± rowMaxSize:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± border:slotAdjustedSize:\ ± colAdjustedSize:\ ± rowAdjustedSize:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:autosize:\ ± setCol:autosize:\ ± setRow:autosize:\ ± border:slotIsAutosize:\ ± colIsAutosize:\ ± rowIsAutosize:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:sizeable:\ ± setCol:sizeable:\ ± setRow:sizeable:\ ± border:slotIsSizeable:\ ± colIsSizeable:\ ± rowIsSizeable:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± constrainSize\ ± totalSize:\ ± totalHeight\ ± totalWidth\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:slotResized:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setTitlesSize:\ ± borderTitlesSize:\ ± setColTitlesHeight:\ ± colTitlesHeight\ ± setRowTitlesWidth:\ ± rowTitlesWidth\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± sizeToCells\ ± sizeToFit\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Dragging \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 border:setDraggableSlots:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± setDraggableCols:\ ± setDraggableRows:\ ± draggableSlots:\ ± draggableCols\ ± draggableRows\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setModifierDragSlots:\ ± setModifierDragCols:\ ± setModifierDragRows:\ ± modifierDragSlots:\ ± modifierDragCols\ ± modifierDragRows\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:moveSlotFrom:to:\ ± moveColFrom:to:\ ± moveRowFrom:to:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:slotAtPosition:\ ± colAtPosition:\ ± rowAtPosition:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:slotPosition:\ ± colPosition:\ ± rowPosition:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:physicalToVisual:\ ± border:visualToPhysical:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:slotDraggedFrom:to:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Inserting and deleting \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 numSlots:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± numCols\ ± numRows\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± addSlot:\ ± addCol\ ± addRow\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:insertSlotAt:\ ± insertColAt:\ ± insertRowAt:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:deleteSlotAt:\ ± deleteColAt:\ ± deleteRowAt:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± empty\ ± emptyAndFreeCells\ ± renewRows:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Cell prototypes \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 border:setSlot:cellType:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± setCol:cellType:\ ± setRow:cellType:\ ± border:slotCellType:\ ± colCellType:\ ± rowCellType:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:setSlot:cellPrototype:\ ± setCol:cellPrototype:\ ± setRow:cellPrototype:\ ± border:slotCellPrototype:\ ± colCellPrototype:\ ± rowCellPrototype:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Tags \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± \pard\tx6140\tx9660\tx10180\fi-4540\li6640\fc1\cf1 tag\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± setTag:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± border:setSlot:tag:\ ± setCol:tag:\ ± setRow:tag:\ ± border:slotTag:\ ± colTag:\ ± rowTag:\ ± tagAt::\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Drawing ± drawCellAt:: \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 \ ± border:drawSlot:\ ± drawRow:\ ± drawCol:\ ± border:drawSlotTitle:\ ± drawRowTitle:\ ± drawColTitle:\ ± selectionChanged\ ± setAutodisplay:\ ± getCellFrame:at::\ ± getDocClipFrame:\ ± drawClippedText\ ± setDrawClippedText:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Editing and first responder ± abortEditing \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 \ ± suspendEditing\ ± resumeEditing\ ± isEditing\ ± getPreviousEditRow:andCol:\ ± getNextEditRow:andCol:\ ± getNext:editRow:andCol:\ ± edit:at::\ ± canEdit:at::\ ± editIfAble:at::\ ± editCellAt::\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± textDidChange:\ ± textDidEnd:endChar:\ ± textDidGetKeys:isEmpty:\ ± textWillChange:\ ± textWillEnd:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± didBecomeFirstResponder:\ ± didResignFirstResponder:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Data control ± setLazy: \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 \ ± isLazy\ ± cellAt::\ ± buffCount\ ± addSlot:\ ± border:insertSlotAt:\ ± border:deleteSlotAt:\ ± numSlots:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± addCol\ ± insertColAt:\ ± deleteColAt:\ ± numCols\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± addRow\ ± insertRowAt:\ ± deleteRowAt:\ ± numRows\ ± renewRows:\ ± empty\ ± emptyAndFreeCells\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx9660\tx10180\fs28\fi-520\li6640\fc1\cf1 ± doRetireCell:at::\ ± doReviveCell:at::\ ± retireCell:at::\ ± reviveCell:at::\ ± sizeToCells\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± tagAt::\ ± intValueAt::\ ± floatValueAt::\ ± doubleValueAt::\ ± stringValueAt::\ ± titleAt::\ ± stateAt::\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Sorting ± \fi-4040\li6140 autoSortCols\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± autoSortRows\ ± autoSortSlots:\ ± border:setAutoSortSlots:\ ± border:setSlot:sortDirection:\ ± border:setSlot:sortFunc:\ ± border:setSlot:sortType:\ ± border:setSlotSortVector:len:\ ± border:slotSortDirection:\ ± border:slotSortFunc:\ ± border:slotSortReversed:\ ± border:slotSortType:\ ± border:sortSlot:\ ± colSortDirection:\ ± colSortFunc:\ ± colSortType:\ ± colSortVectorLen:\ ± compareSlotFunc\ ± rowSortDirection:\ ± rowSortFunc:\ ± rowSortType:\ ± rowSortVectorLen:\ ± setAutoSortCols:\ ± setAutoSortRows:\ ± setCol:sortDirection:\ ± setCol:sortFunc:\ ± setCol:sortType:\ ± setColSortVector:len:\ ± setCompareSlotFunc:\ ± setRow:sortDirection:\ ± setRow:sortFunc:\ ± setRow:sortType:\ ± setRowSortVector:len:\ ± slotSortVector:len:\ ± sortCol:\ ± sortCols\ ± sortRow:\ ± sortRows\ ± sortSlots:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± slotsAreSorted:\ ± rowsAreSorted\ ± colsAreSorted\ ± border:slotIsSorted:\ ± colIsSorted:\ ± rowIsSorted:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± border:compareSlots::\ ± border:compareSlots::info:\ ± compareCols::\ ± compareCols::info:\ ± compareRows::\ ± compareRows::info:\ \fs16\fc0\cf0 \ \fs28\fc1\cf1 ± sortInfoInit:border:\ ± sortInfoDone:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Font \fi-4040\li6140 + defaultFont\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± font\ ± setFont:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Color ± \fi-4040\li6140 backgroundColor\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± backgroundGray\ ± color\ + defaultBackgroundColor\ + defaultHighlightBackgroundColor\ + defaultHighlightTextColor\ + defaultTextColor\ ± highlightBackgroundColor\ ± highlightBackgroundGray\ ± highlightTextColor\ ± highlightTextGray\ ± setBackgroundColor:\ ± setBackgroundGray:\ ± setColor:\ ± setHighlightBackgroundColor:\ ± setHighlightBackgroundGray:\ ± setHighlightTextColor:\ ± setHighlightTextGray:\ ± setTextColor:\ ± setTextGray:\ ± textColor\ ± textGray\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Multicast ± \fi-4040\li6140 makeCellsPerform:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± makeCellsPerform:selectedOnly:\ ± makeCellsPerform:with:\ ± makeCellsPerform:with:with:\ ± makeCellsPerform:with:selectedOnly:\ ± makeCellsPerform:with:with:selectedOnly:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Finding cells / tags ± \fi-4040\li6140 border:findSlotWithTag:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± findCell:row:col:\ ± findCellWithTag:\ ± findCellWithTag:row:col:\ ± findColWithTag:\ ± findRowWithTag:\ ± getRow:andCol:forPoint:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Save / restore ± \fi-4040\li6140 border:setSlotOrder:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± border:setSlotOrderFromString:\ ± border:slotOrder:\ ± border:slotOrderAsString:size:canExpand:\ ± border:setSlotSizes:\ ± border:setSlotSizesFromString:\ ± border:slotSizes:\ ± border:slotSizesAsString:size:canExpand:\ ± colOrder:\ ± colOrderAsString:size:canExpand:\ ± colSizes:\ ± colSizesAsString:size:canExpand:\ ± rowOrder:\ ± rowOrderAsString:size:canExpand:\ ± rowSizes:\ ± rowSizesAsString:size:canExpand:\ ± setColOrder:\ ± setColOrderFromString:\ ± setColSizes:\ ± setColSizesFromString:\ ± setRowOrder:\ ± setRowOrderFromString:\ ± setRowSizes:\ ± setRowSizesFromString:\ \fs16\fc0\cf0 \ \pard\tx6140\tx9660\tx10180\fs28\fi-4040\li6140\fc1\cf1 Pasteboard and services ± copy:\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± cut:\ ± builtinCanWritePboardType:\ ± builtinReadSelectionFromPasteboard:\ ± builtinRegisterServicesTypes\ ± builtinValidRequestorForSendType:andReturnType:\ ± builtinWritePboard:type:toStream:\ ± builtinWriteSelectionToPasteboard:types:\ ± canWritePboardType:\ ± readSelectionFromPasteboard:\ ± registerServicesTypes\ ± validRequestorForSendType:andReturnType:\ ± writeNXAsciiPboardTypeToStream:\ ± writeNXTabularTextPboardTypeToStream:\ ± writePboard:type:toStream:\ ± writeSelectionToPasteboard:types:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fc1\cf1 Printing ± printPSCode:\ \fs16\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Methods implemented by delegate ± \fi-4040\li6140 tableScroll:a \fi-4540\li6640 bortEdit \fi-4040\li6140 At::\ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± tableScroll:allowDragOperationAt::\ ± tableScroll:backgroundColorChangedTo:\ ± tableScroll:border:slotDraggedFrom:to:\ ± tableScroll:border:slotPrototype:\ ± tableScroll:border:slotResized:\ ± tableScroll:border:slotSortReversed:\ ± tableScroll:border:slotTitle:\ ± tableScrollBuffCount:\ ± tableScroll:canEdit:at::\ ± tableScroll:canWritePboardType:\ ± tableScroll:cellAt::\ ± tableScroll:changeFont:to:\ ± tableScroll:didEdit:at::\ ± tableScrollDidBecomeFirstResponder:\ ± tableScroll:didPrint:\ ± tableScrollDidResignFirstResponder:\ ± tableScroll:doubleValueAt::\ ± tableScroll:draggingSourceOperationMaskForLocal:\ ± tableScroll:floatValueAt::\ ± tableScroll:fontChangedFrom:to:\ ± tableScroll:getISearchCol:\ ± tableScroll:highlightBackgroundColorChangedTo:\ ± tableScroll:highlightTextColorChangedTo:\ ± tableScrollIgnoreModifierKeysWhileDragging:\ ± tableScroll:imageForDragOperationAt::\ ± tableScroll:intValueAt::\ ± tableScroll:preparePasteboard:forDragOperationAt::\ ± tableScroll:readSelectionFromPasteboard:\ ± tableScrollRegisterServicesTypes:\ ± tableScroll:retireCell:at::\ ± tableScroll:reviveCell:at::\ ± tableScroll:setStringValue:at::\ ± tableScroll:shouldDelayWindowOrderingForEvent:\ ± tableScroll:stateAt::\ ± tableScroll:stringValueAt::\ ± tableScroll:tagAt::\ ± tableScroll:textColorChangedTo:\ ± tableScroll:titleAt::\ ± tableScroll:validRequestorForSendType:andReturnType:\ ± tableScroll:willEditAt::\ ± tableScrollWillPrint:\ ± tableScroll:willPrintPageFooter:info:\ ± tableScroll:willPrintPageHeader:info:\ ± tableScroll:writePboard:type:toStream:\ ± tableScroll:writeSelectionToPasteboard:types:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \fs28\fi-4540\li6640\fc1\cf1 Methods implemented by cells ± tableScroll:retireAt:: \fi-4040\li6140 \ \pard\tx9660\tx10180\fi-520\li6640\fc1\cf1 ± tableScroll:reviveAt::\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \ \fs36 Class Methods\ \fs16 \ \fs28\fi-380\li2480 defaultBackgroundColor\ \f0\b0\fi-760\li3240 + (NXColor) \b defaultBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORLTGRAY \f0\fs28\fc0\cf0 . This is the default background color for new MiscTableScroll objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 defaultFont\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (Font*) \b defaultFont \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the user's preferred font at 12pt size. This is the default font for new MiscTableScroll objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 defaultHighlightBackgroundColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultHighlightBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORWHITE \f0\fs28\fc0\cf0 . This is the default highlight background color for new MiscTableScroll objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 defaultHighlightTextColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultHighlightTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORBLACK \f0\fs28\fc0\cf0 . This is the default highlight text color for new MiscTableScroll objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 defaultTextColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORBLACK \f0\fs28\fc0\cf0 . This is the default text color for new MiscTableScroll objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs36\li1360\fc0\cf0 Instance Methods\ \fs16 \ \fs28\fi-380\li2480 abortEditing\ \f1\b0\fi-760\li3240 - \f0 (void) \b abortEditing \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Abort cell editing. Does not go though the normal \f3\fs24\fc1\cf1 -textWillEnd: \f0\fs28\fc0\cf0 validation method, nor does it go through the \f3\fs24\fc1\cf1 -textDidEnd:endChar: \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs28\fi-380\li2480\fc0\cf0 action\ \f1\b0\fi-760\li3240 - \f0 (SEL) \b action \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the action associated with a single click\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 addCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b addCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Appends a new column. See \b Usage Tips \b0 in the introduction for a more complete discussion. Equivalent to: \f3\fs24\fc1\cf1 -addSlot:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 addRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b addRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Appends a new row to the table. If you know how many rows you will need in advance, you should use \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 instead; it will be faster. If you do not know the number of rows in advance, use this method. This method is faster than \f3\fs24\fc1\cf1 -insertColAt: \f0\fs28\fc0\cf0 . Internally, the table pre-allocates rows with a geometric growth pattern so there are only a logarithmic number of allocations. See \b Usage Tips \b0 in the introduction for a more complete discussion. Equivalent to: \f3\fs24\fc1\cf1 -addSlot:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \ This method does no drawing, nor does it update the frames of the various subviews. (This enhances performance when adding hundreds or thousands of rows.) After you have finished adding rows, you must call \f3\fs24\fc1\cf1 -sizeToCells \f0\fs28\fc0\cf0 so that the MiscTableScroll can update the frames of the various subviews.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 addSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b addSlot: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Appends a new row or column to the table. Appending rows is fast (geometric growth, logarithmic allocations, no shifting). Appending columns is slower (linear growth, linear allocations, lots of shifting). See \b Usage Tips \b0 in the introduction for a more complete discussion.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -renewRows: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 autoSortCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b autoSortCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether columns will be automatically sorted when the user drags rows. Equivalent to \f3\fs24\fc1\cf1 -autoSortSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 autoSortRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b autoSortRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether rows will be automatically sorted when the user drags columns. Equivalent to \f3\fs24\fc1\cf1 -autoSortSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 autoSortSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b autoSortSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not slots on the given border will be automatically sorted when the user drags (rearranges) slots on the other border.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 backgroundColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b backgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current background color for the MiscTableScroll object. The background color is used as the background color of unhighlighted cells in the table body as well as the \i exposure color \i0 for areas not covered by cells.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 backgroundGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b backgroundGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method converts the results of calling \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 to a grayscale value.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:compareSlots::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 compareSlots: \b0 (int) \i slot1 \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 slot2 \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method compares two slots. Returns a value less than zero if \i slot1 \i0 should sort before \i slot2 \i0 , zero if \i slot1 \i0 should sort equally with \i slot2 \i0 , or greater than zero if \i slot1 \i0 should sort after \i slot2 \i0 . It calls \f3\fs24\fc1\cf1 -sortInfoInit:border: \f0\fs28\fc0\cf0 to compute the sorting information, then calls \f3\fs24\fc1\cf1 -border:compareSlots::info: \f0\fs28\fc0\cf0 , and finally cleans up with \f3\fs24\fc1\cf1 -slotInfoDone: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -border:compareSlots::info:, -border:slotIsSorted:, -border:sortSlot: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:compareSlots::info:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 compareSlots: \b0 (int) \i slot1 \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 slot2 \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 info: \b0 (MiscSlotSortInfo* \fc1\cf1 ) \i\fc0\cf0 sortInfo \i0 \ \fs16\li2100 \ \fs28 This method compares two slots, given a pointer to the precomputed sorting information. If you call this method, you are responsible for initializing \i sortInfo \i0 by calling \f3\fs24\fc1\cf1 -sortInfoInit:border: \f0\fs28\fc0\cf0 , and then releasing the resources by calling \f3\fs24\fc1\cf1 -sortInfoDone: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -border:compareSlots::, -sortInfoDone:, -sortInfoInit:border: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:deleteSlotAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 deleteSlotAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deletes a single row or column. All cells and other resources for the slot are deallocated immediately. If you are just emptying the table so that you can refill it with new data, use \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 or \f3\fs24\fc1\cf1 -empty \f0\fs28\fc0\cf0 instead since these methods cache the cells for later re-use. See \b Usage Tips \b0 in the introduction for a more complete discussion.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -empty, -emptyAndFreeCells, -renewRows: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:deselectSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 deselectSlot: \b0 (MiscCoord_P) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deselects the indicated slot.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:deselectSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 deselectSlots: \b0 (MiscIntList*) \i slots \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deselects each slot in \i slots \i0 , which should be a list of slot indexes.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:deselectTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 deselectTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deselects all slots whose tag value can be found in \i tags \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:drawSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 drawSlot: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Draws a single row or column. This method locks focus on the view if needed.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -drawCellAt::, -drawCol:, -drawRow: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:drawSlotTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 drawSlotTitle: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Draws the title cell for a single row or column. This method locks focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:findSlotWithTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 findSlotWithTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the first slot whose tag is \i x \i0 , or -1 if no match was found.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:insertSlotAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 insertSlotAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inserts a single row or column at the indicated position. Position is a zero-based index. The slot is inserted at physical index \i pos \i0 , and also at visual index \i pos \i0 . This method performs linear allocation, and is slower than the corresponding \f3\fs24\fc1\cf1 -addRow \f0\fs28\fc0\cf0 method when adding new rows to a table.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:moveSlotFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 moveSlotFrom: \b0 (int) \i from_pos \i0 \ \b to: \b0 (int) \i to_pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This is equivalent to the user dragging a slot from \i from_pos \i0 to \i to_pos \i0 . Both \i from_pos \i0 and \i to_pos \i0 are zero-based indexes into the current visual ordering of the slots.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:physicalToVisual:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 physicalToVisual: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method converts all the values in \i list \i0 . It assumes that all the values in \i list \i0 represent \i physical \i0 (original) slot indexes. It converts those values to their corresponding \i visual \i0 (current) values via a succession of calls to \f3\fs24\fc1\cf1 -border:slotPosition: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -border:slotPosition:, -border:visualToPhysical: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectSlot:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectSlot: \b0 (MiscCoord_P) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Selects the indicated slot. If \i flag \i0 is YES then does not clear the previous selection, hence \i slot \i0 is added to the existing selection. If \i flag \i0 is NO then the previous selection is cleared.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectSlot: \b0 (MiscCoord_P) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border: \i b \i0 selectSlot: \i slot \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectSlots:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectSlots: \b0 (MiscIntList*) \i slots \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Selects each slot in \i slots \i0 , which should be a list of slot indexes. If \i flag \i0 is YES then does not clear the previous selection, hence \i slots \i0 are added to the existing selection. If \i flag \i0 is NO then the previous selection is cleared.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectSlots: \b0 (MiscIntList*) \i slots \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border: \i b \i0 selectSlots: \i slots \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectTags:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Selects all slots whose tag value can be found in \i tags \i0 . If \i flag \i0 is YES then does not clear the previous selection, hence the slots found in \i tags \i0 are added to the existing selection. If \i flag \i0 is NO then the previous selection is cleared. This method is useful in conjunction with \f3\fs24\fc1\cf1 -border:selectedTags: \f0\fs28\fc0\cf0 to save and restore the user's selection when you have tag values that uniquely identify the slots.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border: \i b \i0 selectTags: \i tags \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectedSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectedSlots: \b0 (MiscIntList*) \i slots \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Fills the list \i slots \i0 with the indexes of all currently selected slots. You are responsible for allocating the \i slots \i0 list, and you are responsible for freeing it when you are finished with it.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:selectedTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 selectedTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Fills the list \i tags \i0 with the tags of all currently selected slots. You are responsible for allocating and freeing the \i tags \i0 list. This method is useful in conjunction with \f3\fs24\fc1\cf1 -border:selectTags: \f0\fs28\fc0\cf0 to save and restore the user's selection when you have tags that uniquely identify the slots.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setAutoSortSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setAutoSortSlots: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Instructs the MiscTableScroll object whether or not to automatically sort the slots in border \i b \i0 , when the user drags a slot from the other border. For example, when you tell the MiscTableScroll object to auto-sort rows, the rows will be automatically sorted every time the user drags a column to a new position. AutoSort is off by default.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setCursor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setCursor: \b0 (MiscCoord_P) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the keyboard cursor to \i slot \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setDraggableSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setDraggableSlots: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables reordering of the slots. To let the user drag slots, the titles must be displayed, and the slots must be draggable.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setModifierDragSlots:, -border:setSizeableSlots:, -border:setTitlesOn: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setFirstVisibleSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setFirstVisibleSlot: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the table so that slot \i n \i0 is the first slot displayed if possible. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setLastVisibleSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setLastVisibleSlot: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the table so that slot \i n \i0 is the last slot displayed if possible. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setMaxUniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setMaxUniformSizeSlots: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the upper bound for user-sizing of a uniform-sized border, \i b \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 border:setMinUniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setMinUniformSizeSlots: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the lower bound for user-sizing of a uniform-sized border, \i b \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 border:setModifierDragSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setModifierDragSlots: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This option controls whether an unmodified mouse-down initiates selection, or slot-dragging. When \i flag \i0 is YES, an unmodified mouse-down initiates selection, and the user must hold down the command-key to drag a slot. When \i flag \i0 is NO, an unmodified mouse-down initiates dragging, and the user must hold down the command-key to select a slot. By default, columns are dragged with an unmodified mouse-down and selected when the command-key modifier is used. By default, rows behave the other way; an unmodified mouse-down initiates selection, and a command-key modifier must be used to initiate dragging.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSizeableSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSizeableSlots: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables user-sizing of the slots. Many conditions must be met to enable the user to resize a particular slot. See \b Slot Sizing \b0 in the introduction for details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:autosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b autosize: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables \i autosizing \i0 for a particular slot. When YES, the slot will be adjusted proportionately with all other \i autosize \i0 slots in the border to meet global minimum or maximum size restrictions for the border as a whole. Currently, this only has effect for columns in narrow tables displayed in wide ScrollViews. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:cellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b cellPrototype: \b0 (id) \i cell \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Set the cell prototype for a slot. Currently, only column cell prototypes are used. When new rows are allocated for the table, the cell prototype from each column is sent a \f3\fs24\fc1\cf1 -copyFromZone: \f0\fs28\fc0\cf0 message. The newly created cell is placed into the newly created row. Thus all prototype cells must implement the \f3\fs24\fc1\cf1 -copyFromZone: \f0\fs28\fc0\cf0 message appropriately. (They must make copies of all components that are freed when the \f3\fs24\fc1\cf1 -free \f0\fs28\fc0\cf0 message is sent to the cell.) The MiscTableScroll object takes \i ownership \i0 of the prototype cell that is passed in. The caller must not free the prototype cell. The MiscTableScroll object will free the prototype cell when it is finished with it.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:cellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b cellType: \b0 (MiscTableCellStyle) \i t \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the type of cell that will be used for a particular slot. Currently, only column cell types have any effect; row cell types are ignored. The cell type, \i t \i0 , can be any of the following (declared in \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 ):\ \pard\f3\fs24\li3600\fc1\cf1 \ MISC_TABLE_CELL_TEXT\ MISC_TABLE_CELL_ICON\ MISC_TABLE_CELL_BUTTON\ MISC_TABLE_CELL_CALLBACK\ \ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 When this method is called, the MiscTableScroll object will create a prototype cell for the indicated slot of the indicated type. \f3\fs24\fc1\cf1 MISC_TABLE_CELL_TEXT \f0\fs28\fc0\cf0 creates a text-cell; \f3\fs24\fc1\cf1 MISC_TABLE_CELL_ICON \f0\fs28\fc0\cf0 creates an icon-cell; \f3\fs24\fc1\cf1 MISC_TABLE_CELL_BUTTON \f0\fs28\fc0\cf0 creates a button cell; and \f3\fs24\fc1\cf1 MISC_TABLE_CELL_CALLBACK \f0\fs28\fc0\cf0 instructs the MiscTableScroll object to ask the delegate for the for the prototype cell. \ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellPrototype: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:maxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b maxSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the maximum size for slot \i n \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:minSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b minSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the minimum size for slot \i n \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:size:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b size: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i target \i0 size for slot \i n \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:sizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b sizeable: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i user-sizeable \i0 flag for slot \i n \i0 . When \i flag \i0 is YES, the user will be able to resize the slot. When \i flag \i0 is NO, the user will not be able to resize the slot. There are many conditions which must be met for a user to be able to resize a slot. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:sortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b sortDirection: \b0 (MiscSortDirection) \i dir \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether slot \i n \i0 should be sorted in ascending or descending order. \i dir \i0 must be one of the following two values from \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 :\ \pard\f3\fs24\li3600\fc1\cf1 \ MISC_SORT_ASCENDING\ MISC_SORT_DESCENDING\ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ All other values are ignored.\ \fs16 \ \f2\b\fs28 See also: -border:setSlot:sortType:, -border:setSlot:sortFunc:, -border:slotSortDirection: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:sortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b sortFunc: \b0 (MiscCompareEntryFunc) \i func \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i func \i0 the cell-to-cell comparison routine for the cells in slot \i n \i0 . The function, \i func \i0 , must match the following prototype from \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 :\ \ \pard\tx5040\f3\fs24\li2100\fc1\cf1 typedef int (*MiscCompareEntryFunc)\ ( int r1, int c1, int r2, int c2, \ MiscEntrySortInfo const* entry_info,\ MiscSlotSortInfo* sort_info );\ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ The function is given the coordinates of the two cells, and two pointers to structures containing additional sorting information. The function should return an integer that is: (a) less than zero if the cell at (r1,c1) should sort before the cell at (r2,c2), (b) equal to zero if the two cells should sort equally, or (c) greater than zero if the cell at (r1,c1) should sort after the cell at (r2,c2).\ \ The sort direction (ascending or descending) is applied to the value returned by the cell-to-cell comparison function by the slot-to-slot comparison function. So if you supply a custom cell-to-cell comparison function you should ignore the sort direction for that slot. You should always return the \i ascending \i0 sort-order value.\ \ Use this method when you need to perform custom sorting that the built-in sort-types cannot accommodate.\ \fs16 \ \f2\b\fs28 See also: -border:setSlot:sortDirection:, -border:setSlot:sortType:, -border:slotSortFunc: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:sortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b sortType: \b0 (MiscSortType) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the type of sorting to be used by the built-in cell-to-cell comparison function for cells in slot \i n \i0 . The sort type, \i x \i0 , must be one of the following values from \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 :\ \ \pard\f3\fs24\li2880\fc1\cf1 MISC_SORT_STRING_CASE_INSENSITIVE\ MISC_SORT_STRING_CASE_SENSITIVE\ MISC_SORT_INT\ MISC_SORT_UNSIGNED_INT\ MISC_SORT_TAG\ MISC_SORT_UNSIGNED_TAG\ MISC_SORT_FLOAT\ MISC_SORT_DOUBLE\ MISC_SORT_SKIP\ \pard\tx2480\tx2860\tx3240\li2880\fc1\cf1 MISC_SORT_TITLE_CASE_INSENSITIVE\ MISC_SORT_TITLE_CASE_SENSITIVE\ MISC_SORT_STATE\ MISC_SORT_UNSIGNED_STATE\ \f0\fs28\li2100\fc0\cf0 \ All other values are ignored. Each of the types is described below.\ \ \pard\f3\fs24\li2100\fc1\cf1 MISC_SORT_STRING_CASE_INSENSITIVE\ MISC_SORT_STRING_CASE_SENSITIVE \fs10 \fs24\fi20\li2060 \ \f0\fs16\fi0\li2100\fc0\cf0 \ \fs28\li2880 The cells are compared as strings. The string values are retrieved using the \f3\fs24\fc1\cf1 -stringValueAt:: \f0\fs28 message. \fc0\cf0 \f3\fs24\fc1\cf1 MISC_SORT_STRING_CASE_INSENSITIVE \f0\fs28\fc0\cf0 is the default sort-type.\ \fs16\li2100 \ \f3\fs24\fc1\cf1 MISC_SORT_INT\ MISC_SORT_UNSIGNED_INT\ \f0\fs16\fc0\cf0 \ \fs28\li2880 The cells are compared as integers. The integer values are retrieved using the \f3\fs24\fc1\cf1 -intValueAt:: \f0\fs28\fc0\cf0 message. \f3\fs24\fc1\cf1 \ \f0\fs16\li2100\fc0\cf0 \ \f3\fs24\fc1\cf1 MISC_SORT_TAG\ MISC_SORT_UNSIGNED_TAG\ \f0\fs16\fc0\cf0 \ \fs28\li2880 The cells are compared as integers. The integer values are retrieved using the \f3\fs24\fc1\cf1 -tagAt:: \f0\fs28\fc0\cf0 message. This feature is useful for sorting that is handled "behind-the-scenes". For example, if the slot holds date information, you can put the UNIX time_t date value into the cell tag, and format the string value any way you wish. The slot will sort correctly regardless of the display format. It is also useful for slots that hold keywords from an ordered set of values, like the following enumeration:\ \fs16\li2100 \ \f3\fs24\li2880\fc1\cf1 enum Severity \{ Notice, Warning, Error, Fatal \};\ \f0\fs16\li2100\fc0\cf0 \ \fs28\li2880 Sorting these alphabetically does not make sense, but if you put the enum value into the tag of the cell, you can sort them correctly. This sort type also makes it possible to sort slots that hold icons.\ \fs16\li2100 \ \f3\fs24\fc1\cf1 MISC_SORT_FLOAT\ \f0\fs16\fc0\cf0 \ \fs28\li2880 The cells are compared as single-precision floating point numbers. The values are retrieved using the \f3\fs24\fc1\cf1 -floatValueAt:: \f0\fs28\fc0\cf0 message.\ \fs16\li2100 \ \f3\fs24\fc1\cf1 MISC_SORT_DOUBLE\ \f0\fs16\fc0\cf0 \ \fs28\li2880 The cells are compared as double-precision floating point numbers. The values are retrieved using the \f3\fs24\fc1\cf1 -doubleValueAt:: \f0\fs28\fc0\cf0 message.\ \fs16\li2100 \ \f3\fs24\fc1\cf1 MISC_SORT_SKIP\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\fs28\li2880\fc0\cf0 The cells are not compared. All cells in slots with the \f3\fs24\fc1\cf1 MISC_SORT_SKIP \f0\fs28\fc0\cf0 sort-type are considered equal. This can be used for slots that should not affect the sorting. \pard\tx2480\tx2860\tx3240\li2100\fc1\cf1 \ \fs16\fc0\cf0 \ \f3\fs24\fc1\cf1 MISC_SORT_TITLE_CASE_INSENSITIVE\ MISC_SORT_TITLE_CASE_SENSITIVE \fs10 \fs24\fi20\li2060 \ \f0\fs16\fi0\li2100\fc0\cf0 \ \fs28\li2880 The cells are compared as strings. The string values are retrieved using the \f3\fs24\fc1\cf1 -titleAt:: \f0\b\fs28\fc0\cf0 \b0 message. This is provided to support ButtonCells.\ \fs16\li2100 \ \f3\fs24\fc1\cf1 MISC_SORT_STATE\ MISC_SORT_UNSIGNED_STATE\ \f0\fs16\fc0\cf0 \ \fs28\li2880 The cells are compared as integers. The integer values are retrieved using the \f3\fs24\fc1\cf1 -stateAt:: \f0\fs28\fc0\cf0 message. This is provided to support ButtonCells. \f3\fs24\fc1\cf1 \ \f0\fs16\li2100\fc0\cf0 \ \ \f2\b\fs28 See also: -border:setSlot:sortDirection:, -border:setSlot:sortFunc:, -border:slotSortType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:tag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b tag: \b0 (int) \i tag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the tag for slot \i n \i0 to \i tag \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlot:title:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlot: \b0 (int) \i n \i0 \ \b title: \b0 (char const*) \i title \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the title for slot \i n \i0 to \i title \i0 . This method only works for borders with custom titles (that is, \f3\fs24\fc1\cf1 -border: \i b \i0 setTitleMode:MISC_CUSTOM_TITLE \f0\fs28\fc0\cf0 ). If the border does not have custom titles, the request is silently ignored. If the border does have custom titles, the MiscTableScroll object will make a private copy of the \i title \i0 string, and update the display if autodisplay is on.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setTitleMode: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlotOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlotOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Rearranges the slots to match the order specified by \i list \i0 . The list is organized in the \i physical \i0 (original) order of the slots. Each value in the list is the new \i visual \i0 position for the corresponding slot. In other words, \i list \i0 is a physical to visual mapping. This is useful for restoring the user's slot-order preference.\ \ \i List \i0 also encodes the sort direction. Negative values set the slot sort direction to descending. Positive values set the slot sort direction to ascending. Negative values are formed by using the 'C' bitwise complement operator (~). \ \ When \i list \i0 is \b 0 \b0 , the slots are "unsorted" -- they are returned to their original physical order, and they are reset to ascending sort-direction.\ \ Returns \b self \b0 on success, \b 0 \b0 on failure.\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrderFromString:, -border:setSlotSizes:, -border:slotOrder: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlotOrderFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlotOrderFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This is a convenience method which invokes \f3\fs24\fc1\cf1 -border:setSlotOrder: \f0\fs28\fc0\cf0 using an instance of \f3\fs24\fc1\cf1 MiscIntList \f0\fs28\fc0\cf0 constructed from \i s \i0 .\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrder:, -border:setSlotSizes:, -border:slotOrder:, -initFromString: \b0 (MiscIntList) \b , -readFromString: \b0 (MiscIntList) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlotSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlotSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the sizes of all slots to the values in \i list \i0 . List is organized in \i physical \i0 (original) slot order. Each value is the size of the corresponding slot. This method is useful for restoring the user's slot size preferences. Returns \b self \b0 on success, \b 0 \b0 on failure.\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrder:, -border:setSlotSizesFromString:, -border:slotSizes: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlotSizesFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlotSizesFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This is a convenience method which invokes \f3\fs24\fc1\cf1 -border:setSlotSizes: \f0\fs28\fc0\cf0 using an instance of \f3\fs24\fc1\cf1 MiscIntList \f0\fs28\fc0\cf0 constructed from \i s \i0 .\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrder:, -border:setSlotSizes:, -border:slotSizes:, -initFromString: \b0 (MiscIntList) \b , -readFromString: \b0 (MiscIntList) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setSlotSortVector:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setSlotSortVector: \b0 (int const*) \i v \i0 \ \b len: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the order in which slots are considered when sorting. Each value in \i v \i0 is the \i physical \i0 (original) position of a slot. The slots will be compared in the order that they appear in \i v \i0 . Use the one's complement (bitwise negation with the tilde, `~', operator) to reverse the sort direction (ascending / descending) of a slot. The current \i visual \i0 slot order is used by default; use this method to specify a different ordering. This method turns off auto-sort for the other border. That is, setting a \i slotSortVector \i0 for the columns turns off auto-sort for the rows. The auto-sort facility automatically sorts the table whenever a slot is dragged, so setting a slot sort vector invalidates the premise on which auto-sort works.\ \fs16 \ \f2\b\fs28 See also: -slotSortVector:len: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setTitleMode: \b0 (MiscTableTitleMode) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i title-mode \i0 for a border. The title-mode, \i x \i0 , can be any of the following (declared in \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 ):\ \fs16 \ \pard\tx7920\f3\fs24\li3600\fc1\cf1 MISC_NO_TITLE, // No titles on row/col cells.\ MISC_NUMBER_TITLE, // Titles are sequential numbers.\ MISC_ALPHA_TITLE, // Titles are sequential alphabetics...\ MISC_CUSTOM_TITLE, // Titles are user-supplied strings...\ MISC_DELEGATE_TITLE // Ask the delegate for titles.\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -tableScroll:border:slotTitle: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setTitlesOn:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setTitlesOn: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Determines whether titles will be displayed. When \i flag \i0 is YES, the titles will be displayed. When \i flag \i0 is NO, the titles will not be displayed. The titles must be displayed to let the user resize and drag slots. See \b Slot Sizing \b0 in the introduction for more details. Returns YES if the titles were changed, NO otherwise. For example, if this function is called to turn on the column titles, but the column titles are already on, the function will do nothing and return NO. The function will only return YES if the titles were actually turned on or off by the call.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setTitlesSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setTitlesSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the width/height of the row/column titles.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:setUniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 setUniformSizeSlots: \b0 (NXCoord) \i uniform_size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets or clears the \i uniform-size \i0 for a border. If \i uniform_size \i0 is zero, then each slot on that border will be able to have individually varying sizes. If \i uniform_size \i0 is non-zero, then every slot on that border will have the size, \i uniform_size \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotAdjustedSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotAdjustedSize: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current display size of \i slot \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotAtPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotAtPosition: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the original physical position of the slot in visual position \i pos \i0 . This is the visual-to-physical conversion routine.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:moveSlotFrom:to:, -border:slotPosition: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotCellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotCellPrototype: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell prototype for \i slot \i0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellPrototype:, -border:setSlot:cellType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotCellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableCellStyle) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotCellType: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell type for \i slot \i0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellPrototype:, -border:setSlot:cellType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotDraggedFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotDraggedFrom: \b0 (int) \i from_pos \i0 \ \b to: \b0 (int) \i to_pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method, invoked whenever the user drags a slot to a new position. Sends \f3\fs24\fc1\cf1 -tableScroll:border:slotDraggedFrom:to: \f0\fs28\fc0\cf0 to the \i delegate \i0 , or the \i dataDelegate \i0 if the delegate does not respond. Can be useful in subclasses to recognize a user-initiated slot drag event.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 border:slotIsAutosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotIsAutosize: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the autosize flag for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotIsSelected:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotIsSelected: \b0 (MiscCoord_P) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if \i slot \i0 is selected, else NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotIsSizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotIsSizeable: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the user-sizeable flag for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotIsSorted:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotIsSorted: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method compares \i slot \i0 with its neighbors. It returns YES if these slots are sorted relative to each other. It returns NO if any of these slots are out of order with respect to the others. This method can be useful for determining whether or not the table must be resorted when you are changing values in the table.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:sortSlot:, -slotsAreSorted: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotIsVisible:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotIsVisible: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if any part of \i slot \i0 is visible in the scrolling display. Returns NO otherwise.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotMaxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotMaxSize: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the maximum size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotMinSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotMinSize: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the minimum size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Puts the current slot order into \i list \i0 . The list is organized in \i physical \i0 (original) slot order. Each value in the list is the current \i visual \i0 position of the corresponding slot. In other words, \i list \i0 , is filled with the physical to visual mapping. This method is useful for saving the user's slot order preference. You are responsible for allocating and freeing \i list \i0 . \ \ \i List \i0 also encodes the sort direction. Negative values indicate slots that are sorted in descending order. The negative value is computed by using the 'C' bitwise complement operator (~).\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrder:, -border:setSlotSizes:, -border:slotOrderAsString:size:canExpand: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotOrderAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotOrderAsString: \b0 (char*) \i buff \i0 \ \b size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 -border:slotOrder: \f0\fs28\fc0\cf0 with a temporary MiscIntList object, then sends it the \f3\fs24\fc1\cf1 -writeToString:size:canExpand: \f0\fs28\fc0\cf0 message, with the values provided by the caller. This is useful for saving and restoring user slot order preferences.\ \fs16 \ \f2\b\fs28 See also: -border:setSlotOrder:, -border:slotOrder:, -writeToString:size:canExpand: \b0 (MiscIntList) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotPosition: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current \i visual \i0 position of the slot whose original \i physical \i0 position was \i slot \i0 . This is the physical-to-visual conversion routine.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:moveSlotFrom:to:, -border:slotAtPosition: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotResized:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotResized: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method called whenever the user resizes a slot. Sends \f3\fs24\fc1\cf1 -tableScroll:border:slotResized: \f0\fs28\fc0\cf0 to the \i delegate \i0 , or the \i dataDelegate \i0 if the delegate does not respond. Can be useful in subclasses to recognize user-initiated slot resizing.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSize: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the target size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Fills \i list \i0 with the sizes of all the slots. The list is organized in \i physical \i0 (original) slot order. The values are the sizes of the correspond slot. This method is useful for saving the user's slot size preferences.\ \fs16 \ \f2\b\fs28 See also: -border:setSlotSizes:, -border:slotOrder:, -border:slotSizesAsString:size:canExpand: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSizesAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSizesAsString: \b0 (char*) \i buff \i0 \ \b size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 -border:slotSizes: \f0\fs28\fc0\cf0 with a temporary MiscIntList object, then sends it the \f3\fs24\fc1\cf1 -writeToString:size:canExpand: \f0\fs28\fc0\cf0 message, with the values provided by the caller. This is useful for saving and restoring user slot size preferences.\ \fs16 \ \f2\b\fs28 See also: -border:slotSizes:, -writeToString:size:canExpand: \b0 (MiscIntList) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortDirection) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSortDirection: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the sort direction (ascending or descending) for slot \i n \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCompareEntryFunc) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSortFunc: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the custom sort function for slot \i n \i0 , if any, otherwise it returns 0.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotSortReversed:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSortReversed: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method, invoked whenever the user reverses the sort direction of a slot. Sends \f3\fs24\fc1\cf1 -tableScroll:border:slotSortReversed: \f0\fs28\fc0\cf0 to the \i delegate \i0 , or the \i dataDeleage \i0 if the delegate does not respond. Can be useful in subclasses to recognize a user-initiated sort reverse event.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 border:slotSortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortType) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotSortType: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the sort type of slot \i n \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotTag: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the tag value associated with \i slot \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:slotTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 slotTitle: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title for \i slot \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:sortSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 sortSlot: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Re-sorts a single slot. This method can be used to restore the sort order after a single slot has been added or changed in such a way that it might not be in the correct sort position. The results are unpredictable if the other slots are not already sorted. Returns YES if the slot sorted to a new visual location, otherwise it returns NO.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -sortSlots:, -sortCol:, -sortRow: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 border:visualToPhysical:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b border: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 visualToPhysical: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Converts a list of \i visual \i0 (current) slot positions to their \i physical \i0 (original) positions. This is accomplished via a succession of calls to \f3\fs24\fc1\cf1 -border:slotAtPosition: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -border:slotAtPosition:, -border:slotPosition: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderClickedSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b borderClickedSlot: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 During mouse-tracking, returns the slot underneath the mouse, otherwise returns the slot which was under the mouse when tracking ended.\ \fs16 \ \f2\b\fs28 See also: ± clickedCell \b0 , \b ± clickedCol \b0 , \b ± clickedRow \b0 , \b ± tracking \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderClearCursor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b borderClearCursor: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderClearSelection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b borderClearSelection: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deselects all slots that were selected.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderCursor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b borderCursor: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the slot that the keyboard cursor is currently on, or -1 if the keyboard cursor is not on any slot.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderHasMultipleSelection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b borderHasMultipleSelection: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if more than one slot is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderHasSelection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b borderHasSelection: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if at least one slot is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderHasValidCursor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b borderHasValidCursor: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the keyboard cursor is positioned on a valid slot, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderNumSelectedSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b borderNumSelectedSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of slots that are selected.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderSelectAll:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b borderSelectAll: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Selects all the slots. Does not send the action to the target.\ \fs16 \ \f2\b\fs28 See also: -selectAll: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderSelectedSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b borderSelectedSlot: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the currently selected slot, or -1 if no slots are selected.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableTitleMode) \b borderTitleMode: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title-mode for \i b \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderTitlesOn:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b borderTitlesOn: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the titles for border \i b \i0 are displayed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 borderTitlesSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b borderTitlesSize: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns either the height of column titles or the width of row titles, based upon \i b \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 buffCount\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b buffCount \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is only meaningful for lazy tables. If the \i delegate \i0 or \i dataDelegate \i0 provide multiple buffers for responding to \f3\fs24\fc1\cf1 -tableScroll:cellAt:: \f0\fs28\fc0\cf0 , they are encouraged to respond to \f3\fs24\fc1\cf1 -tableScroll:buffCount: \f0\fs28\fc0\cf0 with the number of buffers that they provide. If the \i delegate \i0 and \i dataDelegate \i0 do not respond, a default value of one (1) is returned, which indicates that all values from a call to \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 must be copied before making a second call to \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . This method is called internally during \f3\fs24\fc1\cf1 -sortInfoInit:border: \f0\fs28\fc0\cf0 to determine whether copying must be performed during sorting. \ \fs16 \ \f2\b\fs28 See also: -cellAt::, -isLazy, -setLazy:, -tableScrollBuffCount: \b0 (delegate method) \b , -tableScroll:cellAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinCanWritePboardType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b builtinCanWritePboardType: \b0 (NXAtom) \i type \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The built-in method for determining which data types can be placed on the pasteboard. This method returns YES for \f3\fs24\fc1\cf1 NXAsciiPboardType \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 NXTabularTextPboardType \f0\fs28\fc0\cf0 . Override this method in your subclass if you will provide additional pasteboard datatypes. This method is called from \f3\fs24\fc1\cf1 -canWritePboardType: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -canWritePboardType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinReadSelectionFromPasteboard:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b builtinReadSelectionFromPasteboard: \b0 (id) \i pboard \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method merely returns \b self \b0 . The current implementation of MiscTableScroll never reads anything from the pasteboard. Override this method in your subclass if you want to read data from the pasteboard. This method is called from \f3\fs24\fc1\cf1 -readSelectionFromPasteboard: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -readSelectionFromPasteboard: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinRegisterServicesTypes\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b builtinRegisterServicesTypes \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method sends \f3\fs24\fc1\cf1 -registerServicesMenuSendTypes:andReturnTypes: \f0\fs28\fc0\cf0 to NXApp. It registers \f3\fs24\fc1\cf1 NXTabularTextPboardType \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 NXAsciiPboardType \f0\fs28\fc0\cf0 as send types, and registers no return types. Override this method in your subclass if you want to send or return different data types. Called from \f3\fs24\fc1\cf1 -registerServicesTypes \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -registerServicesTypes, \fc1\cf1 -registerServicesMenuSendTypes:andReturnTypes: \b0 (Application) \f0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinValidRequestorForSendType:andReturnType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b builtinValidRequestorForSendType: \b0 (NXAtom) \i sendType \i0 \ \b\fi0 andReturnType: \b0 (NXAtom) \i returnType \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method returns \b self \b0 if \i sendType \i0 is either \f3\fs24\fc1\cf1 NXTabularTextPboardType \f0\fs28\fc0\cf0 or \f3\fs24\fc1\cf1 NXAsciiPboardType \f0\fs28 , and \i returnType \i0 is 0, and there is a selection, otherwise it returns \f3\fs24 [super validRequestorForSendType: \i sendType \i0 andReturnType: \i returnType \i0 ] \f0\fs28 . Override this method if your subclass can handle different combinations. Called from \f3\fs24 -validRequestorForSendType:andReturnType: \f0\fs28 . \fc0\cf0 \ \fs16 \ \f2\b\fs28 See also: -validRequestorForSendType:andReturnType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinWritePboard:type:toStream:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b builtinWritePboard: \b0 (id) \i pb \i0 \ \b\fi0 type: \b0 (NXAtom) \i type \i0 \ \b toStream: \b0 (NXStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i type \i0 is \f3\fs24\fc1\cf1 NXAsciiPboardType \f0\fs28\fc0\cf0 , then - \f3\fs24\fc1\cf1 writeNXAsciiPboardTypeToStream: \f0\fs28\fc0\cf0 is called, else if \i type \i0 is \f3\fs24\fc1\cf1 NXTabularTextPboardType \f0\fs28\fc0\cf0 , then - \f3\fs24\fc1\cf1 writeNXTabularTextPboardTypeToStream: \f0\fs28\fc0\cf0 is called. Otherwise it does nothing. Override this method in your subclass if you can write additional datatypes to the pasteboard. Called from -writePboard:type:toStream:.\ \fs16 \ \f2\b\fs28 See also: -writePboard:type:toStream: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 builtinWriteSelectionToPasteboard:types:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b builtinWriteSelectionToPasteboard: \b0 (id) \i pboard \i0 \ \b\fi0 types: \b0 (NXAtom*) \i types \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Writes all of the types that can be written to the pasteboard. Each entry in \i types \i0 is tested with \f3\fs24\fc1\cf1 -canWritePboardType: \f0\fs28\fc0\cf0 . If the result is YES, and there is a selection, it is passed on to \f3\fs24\fc1\cf1 -writePboard:type:toStream: \f0\fs28\fc0\cf0 . The data is written immediately, the MiscTableScroll object does not register a pasteboard owner. Override this method in your subclass if you need different behavior. Called from \f3\fs24\fc1\cf1 -writeSelectionToPasteboard:types: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -canWritePboardType:, -writePboard:type:toStream:, -writeSelectionToPasteboard:types: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 canEdit:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 ( \fc1\cf1 BOOL \fc0\cf0 ) \b canEdit: \b0\fc1\cf1 (NXEvent const*) \i event \b\i0\fc0\cf0 at: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Determines whether or not the cell at \i row \i0 , \i col \i0 can be edited. Attempts to send \f3\fs24\fc1\cf1 -tableScroll:canEdit:at:: \f0\fs28\fc0\cf0 to the \i delegate \i0 , the \i dataDelegate \i0 , or the cell at \i row \i0 , \i col \i0 , in that order. The result is taken from the first of these three to respond to \f3\fs24\fc1\cf1 -tableScroll:canEdit:at:: \f0\fs28\fc0\cf0 and is returned to the caller of \f3\fs24\fc1\cf1 -canEdit:at:: \f0\fs28\fc0\cf0 . If none of the three respond, then MiscTableScroll applies its own criteria to determine if editing is allowed. If the cell is not both enabled and editable then NO is returned. If \i event \i0 is NULL or represents a double-click by the mouse then YES is returned, otherwise NO.\ \fs16 \ \fs28 It is valid to specify NULL for \i event \i0 when editing needs to be invoked for a non-mouse-down event. (For instance, \f3\fs24\fc1\cf1 -getNext:editRow:andCol: \f0\fs28\fc0\cf0 operates in this fashion.) If \i event \i0 is non-NULL then it should point at a mouse-down event.\ \fs16 \ \f2\b\fs28 See also: -isEditable \b0 \f0\fc1\cf1 (Cell) \f2\fc0\cf0 , \b -isEnabled \b0 \f0\fc1\cf1 (Cell) \fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 canWritePboardType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b canWritePboardType: \b0 (NXAtom) \i type \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Responds to queries from \f3\fs24\fc1\cf1 -builtinWriteSelectionToPasteboard:types: \f0\fs28\fc0\cf0 . First it gives the \i delegate \i0 an opportunity to answer via \f3\fs24\fc1\cf1 -tableScroll:canWritePboardType: \f0\fs28\fc0\cf0 . If the \i delegate \i0 does not respond to that message, it gives the \i dataDelegate \i0 an opportunity to answer the same message. If neither object responds, the built-in implementation, \f3\fs24\fc1\cf1 -builtinCanWritePboardType: \f0\fs28\fc0\cf0 is called. Called from \f3\fs24\fc1\cf1 -builtinWriteSelectionToPasteboard:types: \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: \fc1\cf1 -builtinCanWritePboardType:, -builtinWriteSelectionToPasteboard:types:, -tableScroll:canWritePboardType: \b0 (delegate method) \f0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cellAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b cellAt: \b0 (int) \i row \i0 \b\fi0 : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the cell located at \i row \i0 , \i col \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cellIsSelected::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b cellIsSelected: \b0 (MiscCoord_P) \i row \i0 \b\fi0 : \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell at \i row \i0 , \i col \i0 is selected.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 changeFont:\ \fs6 \ \pard\f1\b0\fs28\fi-760\li3240\fc0\cf0 - \f0 (id) \b changeFont: \b0 (id) \i sender\ \pard\tx2480\tx2860\tx3240\i0\fs14\li2100\fc0\cf0 \ \fs28 Changes the font of the MiscTableScroll object as well all cells which inherit it. The FontManager sends the \f3\fs24\fc1\cf1 -changeFont: \f0\fs28\fc0\cf0 message whenever the user changes the font using either the FontPanel or the Font menu. This method changes the font by sending \f3\fs24\fc1\cf1 -convertFont: \f0\fs28\fc0\cf0 to the \i sender \i0 , which is presumed to be a FontManager or similarly capable object, and then passes the returned font to \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 . This method sends \f3\fs24\fc1\cf1 -tableScroll:changeFont:to: \f0\fs28\fc0\cf0 to the delegate after \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 has sent \f3\fs24\fc1\cf1 -tableScroll:fontChangedFrom:to: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: \f1\b0 - \f0\b setFont:, ± \f2 tableScroll:changeFont:to: \b0 (delegate method) \f0\b , \f2 ±tableScroll:fontChangedFrom:to: \b0 (delegate method) \f0\b \ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearColSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearColSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderClearSelection:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearCursor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearCursor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self clearCursorCol] \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 [self clearCursorRow] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearCursorCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearCursorCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the column border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearCursorRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearCursorRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the row border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearRowSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearRowSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderClearSelection:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clearSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b clearSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self clearRowSelection] \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 [self clearColSelection] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clickedCell\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b clickedCell \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 During mouse-tracking, returns the cell underneath the mouse, otherwise returns the cell which was under the mouse when tracking ended. This method only really makes sense for eager-mode MiscTableScroll objects since a unique cell inhabits each row & column position, whereas in lazy-mode only one cell exists per column.\ \fs16 \ \f2\b\fs28 See also: ± borderClickedSlot: \b0 , \b ± clickedCol \b0 , \b ± clickedRow \b0 , \b ± tracking \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clickedCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b clickedCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 During mouse-tracking, returns the column underneath the mouse, otherwise returns the column which was under the mouse when tracking ended.\ \fs16 \ \f2\b\fs28 See also: ± borderClickedSlot: \b0 , \b ± clickedCell \b0 , \b ± clickedRow \b0 , \b ± tracking \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 clickedRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b clickedRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 During mouse-tracking, returns the row underneath the mouse, otherwise returns the row which was under the mouse when tracking ended.\ \fs16 \ \f2\b\fs28 See also: ± borderClickedSlot: \b0 , \b ± clickedCell \b0 , \b ± clickedCol \b0 , \b ± tracking \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colAdjustedSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b colAdjustedSize: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current display width of \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotAdjustedSize: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: \fc1\cf1 -border:slotAdjustedSize: \f0\b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colAtPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b colAtPosition: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the original \i physical \i0 position of the column at the current \i visual \i0 position \i pos \i0 . This is the visual-to-physical conversion routine. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotAtPosition: \i pos \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:slotAtPosition:, -border:slotPosition:, -colPosition: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colCellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b colCellPrototype: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell prototype for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotCellPrototype: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellPrototype:, -border:slotCellPrototype: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colCellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableCellStyle) \b colCellType: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell type for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotCellType: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:cellType:, -border:slotCellType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colIsAutosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colIsAutosize: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the \i autosize \i0 flag for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotIsAutosize: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:autosize:, -border:slotIsAutosize: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colIsSelected:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colIsSelected: \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if column \i col \i0 is selected, else NO. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotIsSelected: \i col. \f0\i0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colIsSizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colIsSizeable: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the \i user-sizeable \i0 flag for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotIsSizeable: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:sizeable:, -border:slotIsSizeable: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colIsSorted:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colIsSorted: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if \i col \i0 is sorted relative to its neighboring columns. Returns NO otherwise. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotIsSorted: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colIsVisible:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colIsVisible: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if any part of \i col \i0 is visible in the scrolling display. Returns NO otherwise. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotIsVisible: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colMaxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b colMaxSize: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the maximum size for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotMaxSize: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:maxSize:, -border:slotMaxSize: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colMinSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b colMinSize: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the minimum size for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotMinSize: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:minSize:, -border:slotMinSize: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 color\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b color \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b colOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotOrder: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colOrderAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b colOrderAsString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotOrderAsString: \i buff \i0 size: \i buff_size \i0 canExpand: \i canExpand \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b colPosition: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current \i visual \i0 position of the column whose original \i physical \i0 position is \i pos \i0 . This is the physical-to-visual conversion routine. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotPosition: \i pos \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:moveSlotFrom:to:, -border:slotAtPosition:, -border:slotPosition:, -colAtPosition:, -moveColFrom:to: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colsAreSorted\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colsAreSorted \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if all columns are sorted. Equivalent to \f3\fs24\fc1\cf1 -slotsAreSorted:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -colIsSorted:, -slotsAreSorted: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b colSize: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the target size for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSize: \i col \f0\i0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:size:, -border:slotSize: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b colSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSizes: \i list \f0\i0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSizesAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b colSizesAsString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSizesAsString: \i buff \i0 size: \i buff_size \i0 canExpand: \i canExpand \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortDirection) \b colSortDirection: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the sort direction (ascending or descending) of column \i n \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSortDirection: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCompareEntryFunc) \b colSortFunc: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSortFunc: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortType) \b colSortType: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotSortType: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colSortVectorLen:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int const*) \b colSortVectorLen: \b0 (int*) \i len \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -slotSortVector:MISC_COL_BORDER len: \i len \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b colTag: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the tag for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotTag: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b colTitle: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotTitle: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colTitleMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableTitleMode) \b colTitleMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the \i title-mode \i0 for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER slotTitleMode: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colTitlesHeight\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b colTitlesHeight \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderTitlesSize:MISC_COL_BORDER. \f0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 colTitlesOn\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b colTitlesOn \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not column titles are displayed. Equivalent to: \f3\fs24\fc1\cf1 -borderTitlesOn:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 compareCols::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b compareCols: \b0\fc1\cf1 (int) \i col1 \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col2 \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Compares two columns. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER compareSlots: \i col1 \i0 : \i col2 \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 compareCols::info:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b compareCols: \b0\fc1\cf1 (int) \i col1 \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col2 \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 info: \b0 (MiscSlotSortInfo* \i )sortInfo \i0 \ \fs16\li2100 \ \fs28 Compares two columns. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER compareSlots: \i col1 \i0 : \i col2 \i0 info: \i sortInfo \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 compareRows::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b compareRows: \b0\fc1\cf1 (int) \i row1 \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i row2 \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Compares two columns. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER compareSlots: \i row1 \i0 : \i row2 \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 compareRows::info:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b compareRows: \b0\fc1\cf1 (int) \i row1 \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i row2 \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 info: \b0 (MiscSlotSortInfo* \i )sortInfo \i0 \ \fs16\li2100 \ \fs28 Compares two columns. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER compareSlots: \i row1 \i0 : \i row2 \i0 info: \i sortInfo \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 compareSlotFunc\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCompareSlotFunc) \b compareSlotFunc \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the slot comparison function.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 constrainSize\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b constrainSize \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method that checks and applies new slot counts and min total size constraints to update the frames of the components of the MiscTableScroll object.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 copy:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b copy: \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Copies the selection to the pasteboard. Calls \f3\fs24\fc1\cf1 -writeSelectionToPasteboard:types: \f0\fs28\fc0\cf0 , with \f3\fs24\fc1\cf1 NXTabularTextPboardType \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 NXAsciiPboardType \f0\fs28\fc0\cf0 for types that should be written. Override this method in your subclass if you want to write different datatypes to the pasteboard.\ \fs16 \ \f2\b\fs28 See also: -writeSelectionToPasteboard:types: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cornerTitle\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b cornerTitle \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title for the corner cell.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cursorCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b cursorCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the column that the column keyboard cursor is on. Meaningless if tracking is by rows.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cursorRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b cursorRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the row that the row keyboard cursor is on. Meaningless if tracking is by columns.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 cut:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b cut: \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self copy: \i sender \i0 ] \f0\fs28\fc0\cf0 . Nothing is deleted.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 dataDelegate\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b dataDelegate \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the data delegate of the MiscTableScroll object.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 delegate\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b delegate \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the delegate of the MiscTableScroll object.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deleteColAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b deleteColAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deletes column \i n \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER deleteSlot: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deleteRowAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b deleteRowAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deletes row \i n \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER deleteSlot: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectAll:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b deselectAll: \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self clearSelection] \f0\fs28\fc0\cf0 followed by \f3\fs24\fc1\cf1 [self sendActionIfEnabled] \f0\fs28\fc0\cf0 . \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fc1\cf1 de \fc0\cf0 selectCol: \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER deselectSlot: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b deselectCols: \b0 (MiscIntList*) \i cols \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER deselectSlots: \f0\i\fs28\fc0\cf0 cols \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectColTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b deselectColTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER deselectTags: \i tags \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fc1\cf1 de \fc0\cf0 selectRow: \b0 (MiscCoord_P) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER deselectSlot: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b deselectRows: \b0 (MiscIntList*) \i rows \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER deselectSlots: \f0\i\fs28\fc0\cf0 rows \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 deselectRowTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b deselectRowTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER deselectTags: \i tags \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 didBecomeFirstResponder\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b didBecomeFirstResponder \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method, invoked by the \i docView \i0 's \f3\fs24\fc1\cf1 -becomeFirstResponder \f0\fs28\fc0\cf0 method whenever it becomes first responder. The document view is an instance of the private class MiscTableView. Sends \f3\fs24\fc1\cf1 -setSelFont:isMultiple: \f0\fs28\fc0\cf0 to the shared NSFontManager with the current font setting, and then sends \f3\fs24\fc1\cf1 -tableScrollDidBecomeFirstResponder: \f0\fs28\fc0\cf0 to the \i delegate \i0 , or the \i dataDelegate \i0 if the delegate does not respond. Subclasses which need to perform additional processing when the document view becomes first responder may wish to override this method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 didResignFirstResponder\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b didResignFirstResponder \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method, invoked by the \i docView \i0 's \f3\fs24\fc1\cf1 -resignFirstResponder \f0\fs28\fc0\cf0 method whenever it resigns first responder. The document view is an instance of the private class MiscTableView. Sends \f3\fs24\fc1\cf1 -tableScrollDidResignFirstResponder: \f0\fs28\fc0\cf0 to the \i delegate \i0 , or the \i dataDelegate \i0 if the delegate does not respond. Subclasses which need to perform additional processing when the document view resigns first responder may wish to override this method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 disableCursor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b disableCursor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inhibits display of the keyboard cursor. Calls to this method nest and should be balanced by calls to \f3\fs24\fc1\cf1 -reenableCursor \f0\fs28\fc0\cf0 . The keyboard cursor is a dashed rectangle drawn around a row or column indicating which slot keyboard actions will affect. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± isCursorEnabled \b0 , \b ± reenableCursor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doGetISearchCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b doGetISearchCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Built-in method to choose the incremental search column. Returns YES if incremental search should be enabled and sets * \i col \i0 to the physical index of the column that should be searched, otherwise returns NO. To enable incremental search via this function, autoSortRows must be YES; the first sorting column must be string-based (stringValue or title); and there cannot be a custom sort function for the column. This method works appropriately for normal tables, as long as autoSortRows is turned on. Whenever the user drags a string-based column to the first position, incremental search will be enabled. Non-sorting (skip) columns are ignored. You can override this behavior by implementing the \f3\fs24\fc1\cf1 -tableScroll:getISearchCol: \f0\fs28\fc0\cf0 method in your delegate.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -incrementalSearch:, -tableScroll:getISearchCol: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doIncrementalSearch:col:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b doIncrementalSearch: \b0 (NXEvent*) \i event \b\i0 col: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Built-in method that performs incremental search. \i Event \i0 must be the key-down event that invoked incremental searching. \i Col \i0 must be the column that will be searched. The table must be sorted in \i col \i0 order (ascending or descending). The sort-type for \i col \i0 must be string-based (stringValue or title). \i Col \i0 cannot have a custom sort function. You are responsible for ensuring that the table is sorted in \i col \i0 order. This method runs a modal event loop, processing keystrokes and scrolling the table appropriately. Returns YES if \i col \i0 was acceptable and \i event \i0 was processed. Returns NO if \i col \i0 failed any of the tests mentioned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -incrementalSearch:, -tableScroll:getISearchCol: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doRetireCell:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b doRetireCell: \b0 (id) \i cell \i0 \ \b\fi0 at: \b0 (int) \i row:(int)col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This built-in implementation tries to recover storage before the cell is idled. An attepmpt is made to send the following messages to the cell in this order: \f3\fs24\fc1\cf1 -setTitle:0 \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -setStringValueNoCopy:0 \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -setStringValue:0 \f0\fs28\fc0\cf0 . If the cell responds to the message, that message is sent, otherwise the next message is tried. Override this method in your subclass if you need to do different processing when cells are retired to the cache. Called from: \f3\fs24\fc1\cf1 -retireCell:at:: \f0\fs28\fc0\cf0 . Returns \i cell \i0 . \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doReviveCell:at:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b doReviveCell: \b0 (id) \i cell \i0 \ \b\fi0 at: \b0 (int) \i row:(int)col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method tries to reset the cell so that it will " \f3\fs24\fc1\cf1 useOwner \f0\fs28 ... \fc0\cf0 " values for font, textColor, backgroundColor, highlightTextColor, and highlightBackgroundColor. It tries to set the MiscTableScroll object as the \i owner \i0 of the cell. Then it tries to initialize the font, textColor, backgroundColor, highlightTextColor, and highlightBackgroundColor by first trying the " \f3\fs24\fc1\cf1 setOwner \f0\fs28\fc0\cf0 ..." value method, and then trying the straight " \f3\fs24\fc1\cf1 set \f0\fs28\fc0\cf0 ..." method if the cell does not respond to the " \f3\fs24\fc1\cf1 setOwner \f0\fs28\fc0\cf0 ..." version. Override this method in your subclass if you need different behavior when a cell is brought into active service. Called from \f3\fs24\fc1\cf1 -reviveCell:at:: \f0\fs28\fc0\cf0 . Returns \i cell \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doubleAction\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (SEL) \b doubleAction \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the selector message that is sent to the \i doubleTarget \i0 on a double-click event.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doubleTarget\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b doubleTarget \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the object which will receive the \i doubleAction \i0 message on a double-click event.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 doubleValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (double) \b doubleValueAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -doubleValue \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -doubleValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero is returned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:doubleValueAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 draggableCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b draggableCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the user will be allowed to drag (rearrange) the columns. Equivalent to: \f3\fs24\fc1\cf1 -draggableSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 draggableRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b draggableRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the user will be allowed to drag (rearrange) the rows. Equivalent to: \f3\fs24\fc1\cf1 -draggableSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 draggableSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b draggableSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the user will be allowed to drag (rearrange) the slots on this border. To enable the user to drag slots, the slots must be draggable, and the titles must be displayed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawCellAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawCellAt: \b0 (int) \i row \i0 \b\fi0 : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Instructs the MiscTableScroll object to redraw the cell at position \i row \i0 , \i col \i0 . This should be called whenever the contents of a single cell are changed and the screen should be updated to reflect the new state. This method will lock focus on the view if needed.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:drawSlot:, -display \b0 (View) \b , -drawCol:, -drawRow: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawClippedText\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b drawClippedText \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the MiscTableScroll object will use clipping rectangles and draw partially visible text. Returns NO if the MiscTableScroll object will simply not draw partially visible text that would require clipping rectangles.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawCol: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Instructs the MiscTableScroll object to redraw all the cells in column \i col \i0 . This method will lock focus on the view if needed.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -drawCellAt:: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawColTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawColTitle: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Draws the title for column \i col \i0 . This method will lock focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawRow: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Instructs the MiscTableScroll object to redraw all the cells in row \i row \i0 . This method will lock focus on the view if needed.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -drawCellAt:: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 drawRowTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawRowTitle: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Draws the title for row \i row \i0 . This method will lock focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 edit:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 ( \fc1\cf1 void \fc0\cf0 ) \b edit: \b0\fc1\cf1 (NXEvent const*) \i event \b\i0\fc0\cf0 at: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the \i delegate \i0 or \i dataDelegate \i0 that editing is commencing by sending \f3\fs24\fc1\cf1 -tableScroll:willEditAt:: \f0\fs28\fc0\cf0 , then initiates editing at \i row, col \i0 . It is valid to specify NULL for \i event \i0 when editing needs to be invoked for a non-mouse-down event. If \i event \i0 is non-NULL then it should be the mouse-down event which initiates editing.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 editCellAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 ( \fc1\cf1 void \fc0\cf0 ) \b editCellAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Clears the selection, then selects the row (or column, if tracking by columns) of the cell, and invokes: \f3\fs24\fc1\cf1 -edit:0 at: \i row \i0 : \i co \f0\fs28\fc0\cf0 l \i0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± trackingBy \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 editIfAble:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 ( \fc1\cf1 BOOL \fc0\cf0 ) \b editIfAble: \b0\fc1\cf1 (NXEvent const*) \i event \b\i0\fc0\cf0 at: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 -canEdit:at:: \f0\fs28\fc0\cf0 , and then calls \f3\fs24\fc1\cf1 -edit:at:: \f0\fs28 if YES was returned \fc0\cf0 . Returns YES if editing was initiated, and NO if not. \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 empty\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b empty \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Resets the number of rows in the MiscTableScroll to zero. Does not deallocate the rows, nor does it affect the number of columns. The rows are retained in the cache for future use. See \b Usage Tips \b0 in the introduction for more details.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -addRow, -border:deleteSlotAt:, -deleteRowAt:, -emptyAndFreeCells, -renewRows: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 emptyAndFreeCells\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b emptyAndFreeCells \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Resets the number of rows in the MiscTableScroll to zero; frees all cells stored in the cache, and deallocates all cache resources. Does not affect the number of columns.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -addRow, -border:deleteSlotAt:, -deleteRowAt:, -empty, -renewRows: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 findCell:row:col:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b findCell: \b0 (id) \i cell \i0 \ \b\fi0 row: \b0 (int*) \i row \i0 \ \b col: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Finds the location of \i cell \i0 in the MiscTableScroll object. If \i cell \i0 is found, \i row \i0 and \i col \i0 are set to the coordinates of the cell in the table, and the method returns \b self \b0 . If \i cell \i0 is not found, \i row \i0 and \i col \i0 are set to -1, and the method returns 0.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 findCellWithTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b findCellWithTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the first cell in the body of the table with tag \i x \i0 , otherwise 0.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 findCellWithTag:row:col:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b findCellWithTag: \b0 (int) \i x \i0 \ \b\fi0 row: \b0 (int*) \i row \i0 \ \b col: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the first cell in the body of the table with tag \i x \i0 , and assigns the cell's coordinates to \i row \i0 and \i col \i0 . If no cell in the table has tag \i x \i0 , \i row \i0 and \i col \i0 are set to -1, and 0 is returned.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 findColWithTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b findColWithTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the first column with tag \i x \i0 , or -1 if no columns have tag \i x \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER findSlotWithTag: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 findRowWithTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b findRowWithTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the first row with tag \i x \i0 , or -1 if no row has tag \i x \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER findSlotWithTag: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 finishEditing\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b finishEditing \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If cell editing is in progress, then this method attempts to finish it. This method invokes the normal edit termination routines, and the \f3\fs24\fc1\cf1 -textWillEnd: \f0\fs28\fc0\cf0 validation method gets an opportunity to veto the new value. Returns YES if no cell editing was in progress to start with, or if the editing session terminated successfully. Returns NO if the new cell value was rejected.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 firstVisibleCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b firstVisibleCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -firstVisibleSlot:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 firstVisibleRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b firstVisibleRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -firstVisibleSlot:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 firstVisibleSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b firstVisibleSlot: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the physical coordinate of the first fully visible slot, if any. If there are two partially visible slots, it returns the physical coordinate of the \i last \i0 slot. If there is one partially visible slot, it returns the physical coordinate of that slot. If there are no slots (the MiscTableScroll is empty), it returns -1.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 floatValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b floatValueAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -floatValue \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:floatValueAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -floatValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero is returned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:floatValueAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 font\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b font \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current font for the MiscTableScroll object. The current font is used to initialize new cells in the table.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 free\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b free \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Destroys the MiscTableScroll object, reclaiming all resources allocated by it.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs28\fi-380\li2480\fc0\cf0 getCellFrame:at::\ \fs6 \ \f1\b0\fs28\fi-760\li3240 - \f0 (id) \b getCellFrame: \b0 (NXRect*) \i rect\ \b\i0\fi0 at: \b0 (int) \i row \b\i0 : \b0 (int) \i col\ \pard\tx2480\tx2860\tx3240\i0\fs14\li2100\fc0\cf0 \ \fs28 Returns by reference the frame of the cell at the specified coordinates. If \i row \i0 or \i col \i0 are out of bounds, then \i rect \i0 is set to the empty rectangle. Returns \b self \b0 . \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getDocClipFrame:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b getDocClipFrame: \b0 (NXRect*) \i rect \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns by reference the frame of the ClipView which contains the document view.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getISearchCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b getISearchCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is responsible for determining whether incremental searching should be enabled, and identifying the column on which the table is sorted. If the \i delegate \i0 responds to \f3\fs24\fc1\cf1 -tableScroll:getISearchCol: \f0\fs28\fc0\cf0 , then it is called, otherwise, the \i dataDelegate \i0 is tried. If neither object responds, the built-in \f3\fs24\fc1\cf1 -doGetISearchCol: \f0\fs28\fc0\cf0 method is called. Returns YES if incremental searching should be enabled, otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -doGetISearchCol:, -incrementalSearch:, -tableScroll:getISearchCol: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getNext:editRow:andCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b getNext: \b0\fc1\cf1 (BOOL) \i forward \b\i0\fc0\cf0 \ \fi0 editRow: \b0\fc1\cf1 (int*) \i row \b\i0\fc0\cf0 \ andCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 When \i forward \i0 is YES, this method returns the coordinates of the next cell that is editable as determined by \f3\fs24\fc1\cf1 -canEdit:at:: \f0\fs28\fc0\cf0 . When \i forward \i0 is NO, this method returns the coordinates of the nearest previous cell that is editable. The search order is based on the visual order of slots in the MiscTableScroll. Normally this method is used by assigning the physical coordinates of the cell that is currently being edited to \i row \i0 and \i col \i0 . The method then searches for the next/previous cell that is editable and updates the values of \i row \i0 and \i col \i0 to the coordinates of the next/previous editable cell. This method is used in the \f3\fs24\fc1\cf1 -textDidEnd:endChar: \f0\fs28\fc0\cf0 method to find the next / previous cell when the user presses TAB / SHIFT-TAB to terminate cell editing. Returns YES if a new editable cell was found. Returns NO if there are no other editable cells.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getNextEditRow:andCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b getNextEditRow: \b0\fc1\cf1 (int*) \i row \b\i0\fc0\cf0 andCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -getNext:YES editRow: \i row \i0 andCol: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getPreviousEditRow:andCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b getPreviousEditRow: \b0\fc1\cf1 (int*) \i row \b\i0\fc0\cf0 andCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -getNext:NO editRow: \i row \i0 andCol: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getRow:andCol:forPoint:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b getRow: \b0\fc1\cf1 (int*) \i row \b\i0\fc0\cf0 andCol: \b0 (int*) \i col \b\i0\fc1\cf1 forPoint: \b0 (NXPoint const*) \i\fc0\cf0 point \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calculates the physical slot row and column coordinates for a \i point \i0 , which must be in the coordinate system of the receiving MiscTableScroll object. If \i point \i0 is outside and left of the MiscTableScroll, or there are no columns, then \i col \i0 is set to -1. If \i point \i0 is outside and right of the MiscTableScroll, \i col \i0 is set to the last valid column index. Out of range values are handled similarly for \i row \i0 . Returns \b self \b0 unless \i point \i0 was out of bounds, in which case \b nil \b0 is returned.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasColSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasColSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if any columns are selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasMultipleColSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasMultipleColSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if more than one column is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasMultipleRowSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasMultipleRowSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if more than one row is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasRowSelection\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasRowSelection \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if any rows are selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasValidCursorCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasValidCursorCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the column keyboard cursor has a valid position in the body of the table, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 hasValidCursorRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b hasValidCursorRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the row keyboard cursor has a valid position in the body of the table, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 highlightBackgroundColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b highlightBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current highlightBackgroundColor.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 highlightBackgroundGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b highlightBackgroundGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self highlightBackgroundColor] \f0\fs28\fc0\cf0 , and converts the color to a gray scale value which is returned.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 highlightTextColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b highlightTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current highlightTextColor.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 highlightTextGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b highlightTextGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls [self highlightTextColor], and converts the color to a gray scale value which is returned.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 incrementalSearch:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b incrementalSearch: \b0 (NXEvent*) \i event \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Invokes incremental searching if \i event \i0 is an appropriate keyboard event to start incremental search, and if \f3\fs24\fc1\cf1 -getISearchCol: \f0\fs28\fc0\cf0 determines that incremental searching should be enabled. Returns YES if incremental searching was invoked (and \i event \i0 was processed), otherwise returns NO. This method should be called from within a \f3\fs24\fc1\cf1 -keyDown: \f0\fs28\fc0\cf0 method.\ \fs16 \ \f2\b\fs28 See also: -doIncrementalSearch:col, -getISearchCol: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 initFrame:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b initFrame: \b0 (NXRect const*) \i frameRect \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Initializes a newly allocated MiscTableScroll object. This is the designated initializer for this class. The newly allocated object will have the following properties set by default: \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 insertColAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b insertColAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inserts a new column at position \i pos \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER insertSlotAt: \i pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 insertRowAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b insertRowAt: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inserts a new row at position \i pos \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER insertSlotAt: \i pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 intValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b intValueAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -intValue \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:intValueAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -intValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero is returned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:intValueAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isCursorEnabled\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isCursorEnabled \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether cursor display is enabled or disabled. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± disableCursor \b0 , \b ± reenableCursor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isEditing\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isEditing \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if a cell editing session is in progress.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isEnabled\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isEnabled \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the MiscTableScroll object is enabled for user interaction.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isLazy\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isLazy \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the MiscTableScroll object is using \i lazy-mode \i0 memory management.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isSelectable\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isSelectable \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Always returns YES. This enables the MiscTableScroll object to participate in the next-text chain with TextField objects.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 lastVisibleCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 last \pard\fi-760\li3240\fc1\cf1 VisibleC \fc0\cf0 ol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 - \pard\tx7140\fi-380\li2480\fc1\cf1 last \pard\tx2480\tx2860\tx3240\li2100\fc1\cf1 VisibleSlot:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 lastVisibleRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 last \pard\fi-760\li3240\fc1\cf1 VisibleR \fc0\cf0 ow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 - \pard\tx7140\fi-380\li2480\fc1\cf1 last \pard\tx2480\tx2860\tx3240\li2100\fc1\cf1 VisibleSlot:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 lastVisibleSlot:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 last \pard\fi-760\li3240\fc1\cf1 VisibleS \fc0\cf0 lot: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the physical coordinate of the last fully visible slot, if any. If there are two partially visible slots, it returns the physical coordinate of the \i first \i0 slot. If there is one partially visible slot, it returns the physical coordinate of that slot. If there are no visible slots (the MiscTableScroll is empty), it returns -1.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self makeCellsPerform: \i aSel \i0 selectedOnly:NO] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:selectedOnly:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \b\fi0 selectedOnly: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self makeCellsPerform: \i aSel \i0 with:0 with:0 selectedOnly: \i flag \i0 ] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:with:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \b\fi0 with: \b0 (id) \i arg1 \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self makeCellsPerform: \i aSel \i0 with: \i arg1 \i0 selectedOnly:NO] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:with:with:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \b\fi0 with: \b0 (id) \i arg1 \i0 \ \b with: \b0 (id) \i arg2 \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self makeCellsPerform: \i aSel \i0 with: \i arg1 \i0 with: \i arg2 \i0 selectedOnly:NO] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:with:selectedOnly:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \b\fi0 with: \b0 (id) \i arg1 \i0 \ \b selectedOnly: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self makeCellsPerform: \i aSel \i0 with: \i arg1 \i0 with:0 selectedOnly: \i flag \i0 ] \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 makeCellsPerform:with:with:selectedOnly:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b makeCellsPerform: \b0 (SEL) \i aSel \i0 \ \b\fi0 with: \b0 (id) \i arg1 \i0 \ \b with: \b0 (id) \i arg2 \i0 \ \b selectedOnly: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sends the message \i aSel \i0 to the cells in the table. When \i flag \i0 is YES, the message is sent only to selected cells. When \i flag \i0 is NO, the message is sent to all cells. First the cell is tested with \f3\fs24\fc1\cf1 -respondsTo: \i aSel \f0\i0\fs28\fc0\cf0 . If the cell responds to the message, then the message is sent. Then the return value from the call is inspected. If the cell returns any non-zero value, the process continues. The first cell that returns 0 stops the process. The process also terminates when all cells have been processed. This method returns the number of cells that returned non-zero values. \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 maxUniformSizeCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b maxUniformSizeCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -maxUniformSizeSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 maxUniformSizeRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b maxUniformSizeCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -maxUniformSizeSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 maxUniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b maxUniformSizeSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current upper bound for user-sizing of uniform-sized border, \i b \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 minUniformSizeCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b minUniformSizeCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -minUniformSizeSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 minUniformSizeRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b minUniformSizeCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -minUniformSizeSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 minUniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b minUniformSizeSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current lower bound for user-sizing of uniform-sized border, \i b \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 modifierDragCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b modifierDragCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the command-key must be held down to drag columns. It is NO by default. Equivalent to: \f3\fs24\fc1\cf1 -modifierDragSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setModifierDragSlots:, -modifierDragSlots: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 modifierDragRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b modifierDragRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the command-key must be held down to drag rows. It is YES by default. Equivalent to: \f3\fs24\fc1\cf1 -modifierDragSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setModifierDragSlots:, -modifierDragSlots: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 modifierDragSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b modifierDragSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the command-key must be held down to drag the slots on this border.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 moveColFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b moveColFrom: \b0 (int) \i from_pos \i0 \ \b\fi0 to: \b0 (int) \i to_pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Moves the column at visual position \i from_pos \i0 to visual position \i to_pos \i0 . Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER moveSlotFrom: \i from_pos \i0 to: \i to_pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 moveRowFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b moveRowFrom: \b0 (int) \i from_pos \i0 \ \b\fi0 to: \b0 (int) \i to_pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Moves the row at visual position \i from_pos \i0 to visual position \i to_pos \i0 . Equivalent to \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER moveSlotFrom: \i from_pos \i0 to: \i to_pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 nextText\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b nextText \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the object that will become the first responder when the user presses the TAB key while the MiscTableScroll object is the first responder.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b numCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of columns in the MiscTableScroll object. Equivalent to: \f3\fs24\fc1\cf1 -numSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b numRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of rows in the MiscTableScroll object. This is the number of \i active \i0 rows currently being displayed. The MiscTableScroll object performs caching on a row-oriented basis. There may be additional rows allocated, and stored in the cache. Equivalent to: \f3\fs24\fc1\cf1 -numSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numSelectedCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b numSelectedCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of selected columns.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numSelectedRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b numSelectedRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of selected rows.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b numSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of slots for the border \i b \i0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -addSlot:, -border:deleteSlotAt:, -border:insertSlotAt:, -numCols, -numRows \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numVisibleCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 numVisible \pard\fi-760\li3240\fc1\cf1 C \fc0\cf0 ols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of columns visible in the scrolling display. A column is visible if any part of the column (even a single pixel) appears in the scrolling display. Equivalent to: \f3\fs24\fc1\cf1 -numVisibleSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numVisibleRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 numVisible \pard\fi-760\li3240\fc1\cf1 Ro \fc0\cf0 ws \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of rows visible in the scrolling display. A row is visible if any part of the row (even a single pixel) appears in the scrolling display. Equivalent to: \f3\fs24\fc1\cf1 -numVisibleSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 numVisibleSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \pard\tx7140\b\fi-380\li2480\fc1\cf1 numVisible \pard\fi-760\li3240\fc1\cf1 Sl \fc0\cf0 ots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of slots visible in the scrolling display. A slot is visible if any part of the slot (even a single pixel) appears in the scrolling display.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 previousText\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b previousText \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the object that will become the first responder if the user presses the SHIFT-TAB key while the MiscTableScroll object is the first responder.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 printPSCode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b\fc1\cf1 printPSCode \fc0\cf0 : \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Prints the MiscTableScroll object, including row and column titles if they are turned on. If the user cancels the job, or if there are any errors in generating the PostScript code, this method returns \b nil \b0 ; otherwise it returns \b self \b0 . This method dispatches the delegate messages \f3\fs24\fc1\cf1 -tableScrollWillPrint: \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -tableScroll:didPrint: \f0\fs28\fc0\cf0 to bracket the actual printing. You can implement those methods to perform special operations before and after printing.\ \fs14 \ \fs28 This method normally brings up the PrintPanel before actually initiating printing, but if \i sender \i0 implements a \f3\fs24\fc1\cf1 -shouldRunPrintPanel: \f0\fs28\fc0\cf0 method, the View will invoke that method to query \i sender \i0 . If \i sender \i0 's \f3\fs24\fc1\cf1 -shouldRunPrintPanel: \f0\fs28\fc0\cf0 method returns NO, the PrintPanel will not be brought up as part of the printing process, and the View will be printed using the last settings of the PrintPanel.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 readSelectionFromPasteboard:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b readSelectionFromPasteboard: \b0 (id) \i pboard \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is invoked when a service returns some data. If the \i delegate \i0 responds to the \f3\fs24\fc1\cf1 -tableScroll:readSelectionFromPasteboard: \f0\fs28\fc0\cf0 message, it is sent to the \i delegate \i0 . If not, then the \i dataDelegate \i0 is given the opportunity. If neither responds to the message, \f3\fs24\fc1\cf1 -builtinReadSelectionFromPasteboard: \f0\fs28\fc0\cf0 is called. Returns the results of the subroutine that was called. Override this method in your subclass if you need different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinReadSelectionFromPasteboard:, -tableScroll:readSelectionFromPasteboard: \b0 (delegate method) \b , -readSelectionFromPasteboard: \b0 (NXServicesRequests) \b , -writeSelectionToPasteboard:types: \b0 (NXServicesRequests) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 reenableCursor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b reenableCursor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Re-enables display of the keyboard cursor after a call to \f3\fs24\fc1\cf1 -disableCursor \f0\fs28\fc0\cf0 . Calls to this method should be made to balance previous calls to \f3\fs24\fc1\cf1 -disableCursor \f0\fs28\fc0\cf0 . The keyboard cursor is a dashed rectangle drawn around a row or column indicating which slot keyboard actions will affect. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± disableCursor \b0 , \b ± isCursorEnabled \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 registerServicesTypes\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b registerServicesTypes \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to the \f3\fs24\fc1\cf1 -tableScrollRegisterServicesTypes: \f0\fs28\fc0\cf0 message, the message is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If neither responds to the message, \f3\fs24\fc1\cf1 -builtinRegisterServicesTypes \f0\fs28\fc0\cf0 is called. This method is invoked when an instance of MiscTableScroll is initialized. Override this method in your subclass if you need different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinRegisterServicesTypes, -tableScrollRegisterServicesTypes: \b0 (delegate method) \b \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 renewRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b renewRows: \b0 (int) \i count \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the number of active rows in the MiscTableScroll object to \i count \i0 ; does not affect the number of columns. This is the fastest way to change the size of a MiscTableScroll object when you know the number of rows in advance. See \b Usage Tips \b0 in the introduction for more details.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -addRow, -addSlot:, -border:deleteSlotAt:, -border:insertSlotAt:, -deleteRowAt:, -empty, -emptyAndFreeCells, -insertRowAt: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 resumeEditing\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b resumeEditing \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Resumes a cell editing session that was suspended by \f3\fs24\fc1\cf1 -suspendEditing \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 retireCell:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b retireCell: \b0 (id) \i cell \i0 \ \b\fi0 at: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method called whenever a cell is being removed from active use. The method must return \i cell \i0 , or a suitable replacement object to place in the cache. This method provides an opportunity to substitute a different object for \i cell \i0 before it is placed in the cache. This method also provides an opportunity to reclaim storage when a cell is no longer active. If the \i delegate \i0 responds to the \f3\fs24\fc1\cf1 -tableScroll:retireCell:at:: \f0\fs28\fc0\cf0 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 also does not respond to the message, the cell itself is checked. If none of these objects responds to the message, a built-in default method, \f3\fs24\fc1\cf1 -doRetireCell:at:: \f0\fs28\fc0\cf0 is called. Override this method in your subclass if you need different behavior.\ \fs16 \ \f2\b\fs28 See also: -doRetireCell:at::, -tableScroll:retireCell:at:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 reviveCell:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b reviveCell: \b0 (id) \i cell \i0 \ \b\fi0 at: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method called whenever a cell is is being moved into active use. This method is applied to both newly created cells returned by the \f3\fs24\fc1\cf1 -copyFromZone: \f0\fs28\fc0\cf0 method of the column's cell prototype and cells retrieved from the cache. If the \i delegate \i0 responds to the \f3\fs24\fc1\cf1 -tableScroll:reviveCell:at:: \f0\fs28\fc0\cf0 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is checked. If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to the message, the cell itself is checked. If none of these objects respond to the message, a built-in default method \f3\fs24\fc1\cf1 -doReviveCell:at:: \f0\fs28\fc0\cf0 is called. Override this method in your subclass if you need different behavior.\ \fs16 \ \f2\b\fs28 See also: -doReviveCell:at::, -tableScroll:reviveCell:at:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowAdjustedSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b rowAdjustedSize: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current display height of \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotAdjustedSize: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowAtPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b rowAtPosition: \b0 (int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the original \i physical \i0 position of the row at the current \i visual \i0 position \i pos \i0 . This is the visual-to-physical conversion routine. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotAtPosition: \i pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowCellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b rowCellPrototype: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell prototype for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotCellPrototype: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowCellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableCellStyle) \b rowCellType: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell type for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotCellType: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowIsAutosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowIsAutosize: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the \i autosize \i0 flag for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotIsAutosize: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowIsSelected:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowIsSelected: \b0 (MiscCoord_P) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if \i row \i0 is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowIsSizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowIsSizeable: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the state of the \i user-sizeable \i0 flag for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotIsSizeable: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowIsSorted:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowIsSorted: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if \i row \i0 is sorted relative to its neighboring rows. Returns NO otherwise. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotIsSorted: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowIsVisible:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowIsVisible: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if any part of \i row \i0 is visible in the scrolling display. Returns NO otherwise. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotIsVisible: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowMaxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b rowMaxSize: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the maximum size for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotMaxSize: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowMinSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b rowMinSize: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the minimum size for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotMinSize: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b rowOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotOrder: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowOrderAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b rowOrderAsString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotOrderAsString: \i buff \i0 size: \i buff_size \i0 canExpand: \i canExpand \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowPosition:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b rowPosition: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current \i visual \i0 position of the row whose original \i physical \i0 position is \i pos \i0 . This is the physical-to-visual conversion routine. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotPosition: \i pos \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowsAreSorted\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowsAreSorted \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if all rows are sorted. Equivalent to \f3\fs24\fc1\cf1 -slotsAreSorted:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b rowSize: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the target size for row \i row \i0 . For the actual current display size, use \b -rowAdjustedSize: \b0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSize: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b rowSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSizes: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSizesAsString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b rowSizesAsString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i canExpand \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSizesAsString: \i buff \i0 size: \i buff_size \i0 canExpand: \i canExpand \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortDirection) \b rowSortDirection: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSortDirection: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCompareEntryFunc) \b rowSortFunc: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSortFunc: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSortType) \b rowSortType: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotSortType: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowSortVectorLen:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int const*) \b rowSortVectorLen: \b0 (int*) \i len \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -slotSortVector:MISC_ROW_BORDER len: \i len \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b rowTag: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the tag for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotTag: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b rowTitle: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotTitle: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowTitleMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscTableTitleMode) \b rowTitleMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the title-mode for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER slotTitleMode: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowTitlesOn\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b rowTitlesOn \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not row titles are displayed. Equivalent to: \f3\fs24\fc1\cf1 -borderTitlesOn:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 rowTitlesWidth\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b rowTitlesWidth \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderTitlesSize:MISC_ROW_BORDER. \f0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 scrollCellToVisible::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b scrollCellToVisible: \b0 (int) \i row \i0 \b\fi0 : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the display as necessary until the cell at position \i row \i0 , \i col \i0 is visible.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 scrollColToVisible:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b scrollColToVisible: \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the display as necessary until \i col \i0 is visible.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 scrollRowToVisible:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b scrollRowToVisible: \b0 (int) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the display as necessary until \i row \i0 is visible.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 scrollSelToVisible\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b scrollSelToVisible \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Scrolls the display as necessary until the selection is visible.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectAll:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b selectAll: \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self selectAllRows] \f0\fs28\fc0\cf0 followed by \f3\fs24\fc1\cf1 [self sendActionIfEnabled] \f0\fs28\fc0\cf0 . \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectAllCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectAllCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderSelectAll:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectAllRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectAllRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderSelectAll:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectCol:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectCol: \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER selectSlot: \i col \i0 byExtension \i :flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectCol: \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectCol: \i col \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectCols:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectCols: \b0 (MiscIntList*) \i cols \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER selectSlots: \f0\i\fs28\fc0\cf0 cols \f3\i0\fs24\fc1\cf1 byExtension: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectCols: \b0 (MiscIntList*) \i cols \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectCols: \f0\i\fs28\fc0\cf0 cols \f3\i0\fs24\fc1\cf1 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectColTags:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectColTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER selectTags: \i tags \i0 byExtension: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectColTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fc1\cf1 selectColTags \fc0\cf0 : \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectColTags: \i tags \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedCell\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b selectedCell \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell at the intersection of \f3\fs24\fc1\cf1 -selectedCol \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -selectedRow \f0\fs28\fc0\cf0 or \b nil \b0 if there is no selected cell. This method really only has meaning in eager-mode, though it can be used in lazy-mode as well.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedCol\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b selectedCol \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderSelectedSlot:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectedCols: \b0 (MiscIntList*) \i cols \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER selectedSlots: \i cols \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedColTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectedColTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER selectedTags: \i tags \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedRow\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscCoord_P) \b selectedRow \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -borderSelectedSlot:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectedRows: \b0 (MiscIntList*) \i rows \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER selectedSlots: \i cols \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectedRowTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectedRowTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER selectedTags: \i tags \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectionChanged\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectionChanged \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If auto-display is enabled and drawing is possible, then updates the display to reflect the currently selected rows and columns. When the selection is modified programmatically or via user-interaction this method is called automatically to reflect the new selection. You need never call this method directly, but subclasses may want to override it.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectionMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscSelectionMode) \b selectionMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current setting of the selection mode.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRow:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRow: \b0 (MiscCoord_P) \i row \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER selectSlot: \i row \i0 byExtension: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRow: \b0 (MiscCoord_P) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectRow: \i row \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRows:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRows: \b0 (MiscIntList*) \i rows \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER selectSlots: \f0\i\fs28\fc0\cf0 rows \f3\i0\fs24\fc1\cf1 byExtension: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRows: \b0 (MiscIntList*) \i rows \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectRows: \f0\i\fs28\fc0\cf0 rows \f3\i0\fs24\fc1\cf1 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRowTags:byExtension:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRowTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\b\li3240\fc0\cf0 byExtension: \b0 (BOOL) \i flag \i0 \ \fs16\li2100 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER selectTags: \i tags \i0 byExtension: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectRowTags:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b selectRowTags: \b0 (MiscIntList*) \i tags \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -selectRowTags: \i tags \i0 byExtension:NO \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 selectText:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b selectText: \b0 (id) \i sender \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes the MiscTableScroll object the first responder, allowing it to accept keyboard input.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -isEnabled, -isSelectable, -nextText, -previousText \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendAction\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendAction \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sends the \i action \i0 message to the \i target \i0 object. Implemented via \f3\fs24\fc1\cf1 -sendAction:to: \f0\fs28\fc0\cf0 . Returns \b self \b0 if the action was successfully sent, otherwise returns \b nil \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendAction:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendAction: \b0 (SEL) \i aSelector \i0 \ \b\fi0 to: \b0 (id) \i anObject \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Uses the Application class's \f3\fs24\fc1\cf1 -sendAction:to:from: \f0\fs28\fc0\cf0 method to send the message \i aSelector \i0 to the object \i anObject \i0 from the MiscTableScroll object itself. Returns \b self \b0 if the action was successfully sent, otherwise returns \b nil \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendAction:to:forAllCells:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendAction: \b0 (SEL) \i aSelector \i0 \ \b\fi0 to: \b0 (id) \i anObject \i0 \ \b forAllCells: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Iterates through all the cells in the table if flag is YES, or just the selected cells if flag is NO, sending \i aSelector \i0 to \i anObject \i0 for each. Iteration begins with the cell in the upper-left corner of the table, preceeding through the appropriate entries in the first row, then on to the next. \i aSelector \i0 must represent a method which takes a single argument, which is the \f3\fs24\fc1\cf1 id \f0\fs28\fc0\cf0 of the current cell in the iteration. \i aSelector \i0 's return value must be a \f3\fs24\fc1\cf1 BOOL \f0\fs28\fc0\cf0 . If \i aSelector \i0 returns NO for any cell, the iteration terminates immediately, without sending the message to the remaining cells. If it returns YES, iteration continues with the next cell.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendActionIfEnabled\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendActionIfEnabled \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \f3\fs24\fc1\cf1 [self isEnabled] \f0\fs28\fc0\cf0 returns YES then \f3\fs24\fc1\cf1 [self sendAction] \f0\fs28\fc0\cf0 is called. Returns \b self \b0 is the action was successfully sent, otherwise returns \b nil. \b0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendDoubleAction\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendDoubleAction \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sends the \i doubleAction \i0 message to the \i doubleTarget \i0 object. Returns \b self \b0 is the action was successfully sent, otherwise returns \b nil. \b0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sendDoubleActionIfEnabled\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sendDoubleActionIfEnabled \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \f3\fs24\fc1\cf1 [self isEnabled] \f0\fs28\fc0\cf0 returns YES then \f3\fs24\fc1\cf1 [self sendDoubleAction] \f0\fs28\fc0\cf0 is called. Returns \b self \b0 is the action was successfully sent, otherwise returns \b nil. \b0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setAction:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setAction: \b0 (SEL) \i new_sel \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the action method to \i new_sel \i0 . The action message is sent to the \i target \i0 upon a single mouse click. The argument of an action method is the table scroll. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setAutoSortCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setAutoSortCols: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setAutoSortSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setAutoSortRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setAutoSortRows: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setAutoSortSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setAutodisplay:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setAutodisplay: \b0 (BOOL) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Overridden from View. Propagates the autodisplay setting to the component subviews. Returns \b self \b0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: \f1\b0 - \f0 € \b setAutodisplay: \b0 (View)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setBackgroundColor: \b0 (NXColor) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the backgroundColor. The backgroundColor is used to initialize new cells, and also to paint the background of areas that are not covered by cells of the table. By default, this is the value returned by \f3\fs24\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setBackgroundGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setBackgroundGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The gray scale value, \i value \i0 , is converted to a color value, and the color value is sent to \f3\fs24\fc1\cf1 -setBackgroundColor: \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:autosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 autosize: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the autosize flag for column \i col \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 autosize: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:cellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 cellPrototype: \b0 (id) \i cell \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell prototype for column \i col \i0 to \i cell \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 cellPrototype: \i cell \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:cellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 cellType: \b0 (MiscTableCellStyle) \i type \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell type for column \i col \i0 to \i type \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 cellType: \i type \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:maxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 maxSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the maximum size of column \i col \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 maxSize: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:minSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 minSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the minimum size of column \i col \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 minSize: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:size:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 size: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the target size of column \i col \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 size: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:sizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 sizeable: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i user-sizeable \i0 flag for column \i col \i0 to \i flag \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 sizeable: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:sortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i n \i0 \ \b\fi0 sortDirection: \b0 (MiscSortDirection) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i n \i0 sortDirection: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:sortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i n \i0 \ \b\fi0 sortFunc: \b0 (MiscCompareEntryFunc) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i n \i0 sortFunc: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:sortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i n \i0 \ \b\fi0 sortType: \b0 (MiscSortType) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i n \i0 sortType: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:tag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 tag: \b0 (int) \i tag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the tag for column \i col \i0 to \i tag \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 tag: \i tag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCol:title:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCol: \b0 (int) \i col \i0 \ \b\fi0 title: \b0 (char const*) \i title \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the title for column \i col \i0 to \i title \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlot: \i col \i0 title: \i title \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setColOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotOrder: \i list \f0\i0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColOrderFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setColOrderFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotOrderFromString: \i s \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setColSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotSizes: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColSizesFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setColSizesFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotSizesFromString:s \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColSortVector:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setColSortVector: \b0 (int const*) \i v \i0 \ \b\fi0 len: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotSortVector: \i v \i0 len: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setColTitleMode: \b0 (MiscTableTitleMode) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i title-mode \i0 for columns to \i x \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSlotTitleMode: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColTitlesHeight:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setColTitlesHeight: \b0 (NXCoord) \i height \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setTitlesSize: \i height \i0 . \f0\fs28\fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColTitlesOn:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b setColTitlesOn: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Turns the column titles on or off. When \i flag \i0 is YES, column titles will be displayed. When \i flag \i0 is NO, column titles will not be displayed. Column titles are displayed by default. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setTitlesOn: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setColor: \b0 (NXColor) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -setBackgroundColor: \i value \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCompareSlotFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCompareSlotFunc: \b0 (MiscCompareSlotFunc) \i f \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i f \i0 the slot comparison function to be used for sorting. It must conform to the following prototype from \f3\fs24\fc1\cf1 MiscTableTypes.h \f0\fs28\fc0\cf0 :\ \ \f3\fs24\fc1\cf1 typedef int (*MiscCompareSlotFunc)( int slot1, int slot2, MiscSlotSortInfo* );\ \f0\fs28\fc0\cf0 \ The function must return an integer value which is: (a) less than zero if \i slot1 \i0 should come before \i slot2 \i0 , or (b) equal to zero if \i slot1 \i0 should sort equally with \i slot2 \i0 , or (c) greater than zero if \i slot1 \i0 should come after \i slot2 \i0 . This function is responsible for comparing the cells of the two slots in the order defined by the \i slotSortVector \i0 , or visual order if no explicit \i slotSortVector \i0 has been set. This function is also responsible for applying the sort direction to the individual cell-wise comparisons. This function is also responsible for calling user-installed custom slot sorting functions, or interpreting and applying the sort-type for slots that do not have a custom function. The default, built-in implementation of this function is \f3\fs24\fc1\cf1 MiscDefaultCompareSlotFunc \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -border:setSlot:sortDirection:, -border:setSlot:sortFunc:, -border:setSlot:sortType:, -border:setSlotSortVector:len:, -compareSlotFunc, -sortInfoDone:, -sortInfoInit:border: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCornerTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCornerTitle: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the title for the corner cell.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCursorCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCursorCol: \b0 (MiscCoord_P) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setCursor: \i col \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setCursorRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setCursorRow: \b0 (MiscCoord_P) \i row \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setCursor: \i row \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDataDelegate:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setDataDelegate: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the data delegate for the MiscTableScroll object. Returns \b self \b0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -setDelegate:, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDelegate:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setDelegate: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the delegate for the MiscTableScroll object. Returns \b self \b0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -setDataDelegate: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDoubleAction:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setDoubleAction: \b0 (SEL) \i new_sel \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the double-action method to \i new_sel \i0 . The double-action message is sent to the \i doubleTarget \i0 upon a double mouse click. The argument of an action method is the table scroll. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDoubleTarget:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setDoubleTarget: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the \i doubleTarget \i0 of the MiscTableScroll object. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDraggableCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setDraggableCols: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables \i user-dragging \i0 of columns. When \i flag \i0 is YES, columns will be user-draggable. When \i flag \i0 is NO, columns will not be user-draggable. The column titles must be displayed to enable the user to drag columns. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setDraggableSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDraggableRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setDraggableRows: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables \i user-dragging \i0 of rows. When \i flag \i0 is YES, rows will be user-draggable. When \i flag \i0 is NO, rows will not be user-draggable. The row titles must be displayed to enable the user to drag rows. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setDraggableSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setDrawClippedText:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setDrawClippedText: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 When \i flag \i0 is YES, the MiscTableScroll object will use clipping rectangles to draw partially visible text in cells that respond YES to the \f3\fs24\fc1\cf1 -ownerDraw \f0\fs28\fc0\cf0 message. When \i flag \i0 is NO, the MiscTableScroll object will simply not draw partially visible text that would require clipping rectangles for cells that respond YES to the \f3\fs24\fc1\cf1 -ownerDraw \f0\fs28\fc0\cf0 message. This is a drawing performance optimization. The clipping rectangles are quite slow (especially noticable on older, slower CPUs). Drawing clipped text is disabled by default. You must send this message with \i flag \i0 equal to YES to enable partially visible text to be drawn. If the new setting is different than the existing setting, \f3\fs24\fc1\cf1 [self update] \f0\fs28\fc0\cf0 is called.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setEnabled:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setEnabled: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables user-interaction with the MiscTableScroll object. The only feature affected by this flag is the dispatch of the \i action \i0 and \i doubleAction \i0 . When \i flag \i0 is YES, \i action \i0 and \i doubleAction \i0 are sent as appropriate. When \i flag \i0 is NO, neither messsage is sent. All other operations are unaffected and remain available. These include, pasteboard and service operations, selection, column reordering & sizing, etc.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -isEnabled, -isSelectable \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setFirstVisibleCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fi0 setFirstVisible \fi-760 Col \fi0 : \b0 (int) \i\fi-760 col \i0\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setFirstVisibleSlot: \i col \f0\i0\fs28\fc0\cf0 . \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setFirstVisibleRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fi0 setFirstVisible \fi-760 Row \fi0 : \b0 (int) \i\fi-760 row \i0\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setFirstVisibleSlot: \i row \f0\i0\fs28\fc0\cf0 . \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setFont:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setFont: \b0 (id) \i newFont \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the font for the MiscTableScroll object. The font is used to initialize new cells in the table. If rows are uniformly sized, the uniform row size is adjusted proportionately based on the sizes of the old font and the new font. Then all the cells are updated. If the cells respond to the \f3\fs24\fc1\cf1 -setOwnerFont: \f0\fs28\fc0\cf0 message, that message is sent. Otherwise the \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 message is tried. Then the \f3\fs24\fc1\cf1 -tableScroll:fontChangedFrom:to: \f0\fs28\fc0\cf0 message is sent to the delegate if the delegate responds to it. Finally, the display is updated.\ \fs16 \ \f2\b\fs28 See also: -tableScroll:fontChangedFrom:to: \b0 (delegate method) \b , -setOwnerFont: \b0 (MiscTableCell) \b , -setFont: \b0 (Cell, MiscTableCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setHighlightBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightBackgroundColor: \b0 (NXColor) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i highlightBackgroundColor \i0 for the MiscTableScroll object. The \i highlightBackgroundColor \i0 is used to initialize new cells added to the table. This information is propagated to the cells of the table as follows. If the cells respond to the \f3\fs24\fc1\cf1 -setOwnerHighlightBackgroundColor: \f0\fs28\fc0\cf0 message, that message is sent, else if the cells respond to the \f3\fs24\fc1\cf1 -setHighlightBackgroundColor: \f0\fs28\fc0\cf0 message, that message is sent instead. If the cells do not respond to either of these messages, no message is sent to the cell. Finally, the display is updated.\ \fs16 \ \f2\b\fs28 See also: -setHighlightBackgroundColor: \b0 (MiscTableCell) \b , -setOwnerHighlightBackgroundColor: \b0 (MiscTableCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setHighlightBackgroundGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightBackgroundGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method takes the gray scale value, \i value \i0 , converts it to a color value which is passed to \f3\fs24\fc1\cf1 -setHighlightBackgroundColor: \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setHighlightTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightTextColor: \b0 (NXColor) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i highlightTextColor \i0 for the MiscTableScroll object. The \i highlightTextColor \i0 is used to initialize new cells added to the table. This message is also propagated to the existing cells of the table as follows. If the cells respond to the \f3\fs24\fc1\cf1 -setOwnerHighlightTextColor: \f0\fs28\fc0\cf0 message, that message is sent, else if the cells respond to the \f3\fs24\fc1\cf1 -setHighlightTextColor: \f0\fs28\fc0\cf0 message, that message is sent. If the cells do not respond to either of these messages, no message is sent to the cell. Finally, the display is updated.\ \fs16 \ \f2\b\fs28 See also: -setHighlightTextColor: \b0 (MiscTableCell) \b , -setOwnerHighlightTextColor: \b0 (MiscTableCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setHighlightTextGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightTextGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method takes the gray scale value, \i value \i0 , converts it to a color value which is passed to \f3\fs24\fc1\cf1 -setHighlightTextColor: \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setLastVisibleCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fi0 set \fi-760 La \fi0 stVisible \fi-760 Col \fi0 : \b0 (int) \i\fi-760 col \i0\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setLastVisibleSlot: \i col \f0\i0\fs28\fc0\cf0 . \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setLastVisibleRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b\fi0 set \fi-760 La \fi0 stVisible \fi-760 Row \fi0 : \b0 (int) \i\fi-760 row \i0\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setLastVisibleSlot: \i row \f0\i0\fs28\fc0\cf0 . \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setLazy:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setLazy: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables lazy-mode memory management. When \i flag \i0 is YES, the MiscTableScroll object will use lazy-mode memory management, asking the \i delegate \i0 , and then if necessary the \i dataDelegate \i0 to provide the cells in the body of the table. When \i flag \i0 is NO, the MiscTableScroll object will use eager-mode memory management, maintaining a dense, 2-D array of cell pointers, one pointer for each cell in the table, and caching cells on a row-wise basis. MiscTableScroll uses eager-mode memory management by default. See \b Usage Tips \b0 , and \b Lazy vs. Eager \b0 , in the introduction for more details.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -dataDelegate, -isLazy, -setDataDelegate: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setMaxUniformSizeCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setMaxUniformSizeCols: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setMaxUniformSizeSlots: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setMaxUniformSizeRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setMaxUniformSizeRows: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setMaxUniformSizeSlots: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setMinUniformSizeCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setMinUniformSizeCols: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setMinUniformSizeSlots: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setMinUniformSizeRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setMinUniformSizeRows: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setMinUniformSizeSlots: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setModifierDragCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setModifierDragCols: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets whether or not the command-key must be held down to drag columns. By default, columns require the command-key to perform selection. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setModifierDragSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setModifierDragRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setModifierDragRows: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets whether or not the command-key must be held down to drag rows. By default, rows do not require the command-key to perform selection. Equivalent to \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setModifierDragSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setNextText:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setNextText: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the object that will become first responder when the user presses the TAB key while the MiscTableScroll object is the first responder. The \f3\fs24\fc1\cf1 -setPreviousText: \f0\fs28\fc0\cf0 message will be sent to \i obj \i0 if \i obj \i0 responds to that message, so that the next-text chain will be maintained properly.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setPreviousText:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setPreviousText: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the object that will become first responder when the user presses the SHIFT-TAB key while the MiscTableScroll object is the first responder.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:autosize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 autosize: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i autosize \i0 flag for row \i row \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 autosize: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:cellPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 cellPrototype: \b0 (id) \i cell \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell prototype for row \i row \i0 to \i cell \i0 . Currently, only column cell prototypes are used. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 cellPrototype: \i cell \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:cellType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 cellType: \b0 (MiscTableCellStyle) \i type \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell type for row \i row \i0 to \i type \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 cellType: \i type \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:maxSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 maxSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the maximum size of row \i row \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 maxSize: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:minSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 minSize: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the minimum size of row \i row \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 minSize: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:size:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 size: \b0 (NXCoord) \i size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the target size of row \i row \i0 to \i size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 size: \i size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:sizeable:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 sizeable: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the user-sizeable flag for row \i row \i0 to \i flag \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 sizeable: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:sortDirection:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i n \i0 \ \b\fi0 sortDirection: \b0 (MiscSortDirection) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i n \i0 sortDirection: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:sortFunc:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i n \i0 \ \b\fi0 sortFunc: \b0 (MiscCompareEntryFunc) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i n \i0 sortFunc: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:sortType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i n \i0 \ \b\fi0 sortType: \b0 (MiscSortType) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i n \i0 sortType: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:tag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 tag: \b0 (int) \i tag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the tag for row \i row \i0 to \i tag \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 tag: \i tag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRow:title:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRow: \b0 (int) \i row \i0 \ \b\fi0 title: \b0 (char const*) \i title \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the title for row \i row \i0 to \i title \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlot: \i row \i0 title: \i title \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowOrder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setRowOrder: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotOrder: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowOrderFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setRowOrderFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotOrderFromString: \i s \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowSizes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setRowSizes: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotSizes: \i list \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowSizesFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setRowSizesFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotSizesFromString: \i s \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowSortVector:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRowSortVector: \b0 (int const*) \i v \i0 \ \b\fi0 len: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotSortVector: \i v \i0 len: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRowTitleMode: \b0 (MiscTableTitleMode) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the title-mode for rows to \i x \i0 . Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSlotTitleMode: \i x \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowTitlesOn:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b setRowTitlesOn: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Turns the row titles on or off. When \i flag \i0 is YES, row titles will be displayed. When \i flag \i0 is NO, row titles will not be displayed. Row titles are not displayed by default. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setTitlesOn: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowTitlesWidth:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRowTitlesWidth: \b0 (NXCoord) \i width \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setTitlesSize: \i width \f0\i0\fs28\fc0\cf0 . \fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setSelectionMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setSelectionMode: \b0 (MiscSelectionMode) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the selection mode for the MiscTableScroll object. The selection mode, \i x \i0 , can be any of the following:\ \pard\f3\fs24\li3600\fc1\cf1 \ MISC_LIST_MODE,\ MISC_RADIO_MODE,\ MISC_HIGHLIGHT_MODE\ \ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 The modes each correspond to the similarly named selection modes declared in the Matrix class. The MiscTableScroll object extends the highlight mode selection by implementing the Alternate-key modifier in the same fashion that it works in list mode.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setSizeableCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setSizeableCols: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables user-sizing of columns. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setSizeableSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setSizeableRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setSizeableRows: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Enables or disables user-sizing of rows. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setSizeableSlots: \i flag \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \b tag \b0 of the MiscTableScroll object to \i x \i0 . Returns \b self \b0 .\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:setSlot:tag:, -setCol:tag:, -setRow:tag:, -tag \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setTarget:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTarget: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Makes \i obj \i0 the object which will receive the \i action \i0 message whenever there is a single mouse-click on the body of the table. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTextColor: \b0 (NXColor) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i textColor \i0 for the MiscTableScroll object. The \i textColor \i0 is used to initialize new cells added to the table. The message is propagated to existing cells as follows. If the cell responds to the \f3\fs24\fc1\cf1 -setOwnerTextColor: \f0\fs28\fc0\cf0 message, that message is sent, else if the cell responds to the \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 message, that message is sent. If the cell does not respond to either of these messages, no message is sent to the cell. Finally, the display is updated.\ \fs16 \ \f2\b\fs28 See also: -setOwnerTextColor: \b0 (MiscTableCell) \b , -setTextColor: \b0 (Cell, MiscTableCell) \b . \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setTextGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTextGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The gray scale value, \i value \i0 , is converted to a color value which is passed to the \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setUniformSizeCols:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setUniformSizeCols: \b0 (NXCoord) \i uniform_size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets or clears the \i uniform-size \i0 property for columns. When \i uniform_size \i0 is a non-zero value, all columns will have the same, fixed (uniform) size. When \i uniform_size \i0 is zero, each column can be assigned sizes individually. By default, columns are not uniformly sized. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER setUniformSizeSlots: \i uniform_size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setUniformSizeRows:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setUniformSizeRows: \b0 (NXCoord) \i uniform_size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets or clears the \i uniform-size \i0 property for rows. When \i uniform_size \i0 is a non-zero value, all rows will have the same, fixed (uniform) size. When \i uniform_size \i0 is zero, each row can be assigned sizes individually. By default, row are uniformly sized. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER setUniformSizeSlots: \i uniform_size \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sizeableCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b sizeableCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not columns can be resized by the user. Equivalent to: \f3\fs24\fc1\cf1 -sizeableSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sizeableRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b sizeableRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not rows can be resized by the user. Equivalent to: \f3\fs24\fc1\cf1 -sizeableSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sizeableSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b sizeableSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Indicates whether or not the user can resize the slots on border \i b \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sizeToCells\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sizeToCells \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Instructs the MiscTableScroll object to adjust the frames of its subviews.\ \fs16 \ \f2\b\fs28 See also: -addRow \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sizeToFit\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b sizeToFit \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calculates the size of every cell in the MiscTableScroll object using \f3\fs24\fc1\cf1 -calcCellSize: \f0\fs28\fc0\cf0 . Then uses the maximum size for each slot to set the size of the slot. For uniform-size borders, the size is set to the maximum size of all slots. Finally, this method calls \f3\fs24\fc1\cf1 -sizeToCells \f0\fs28\fc0\cf0 to finish the process of updating the frames of all the subviews.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 slotsAreSorted:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b slotsAreSorted: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the slots are sorted, NO otherwise.\ \fs16 \ \f2\b\fs28 See also: -border:slotIsSorted:, -border:sortSlot:, -sortSlots: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 slotSortVector:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int const*) \b slotSortVector: \b0 (MiscBorderType) \i b \i0 \ \b\fi0 len: \b0 (int*) \i len \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current \i slotSortVector \i0 for border \i b \i0 , and puts its length into \i len \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortCol: \b0\fc1\cf1 (int) \i n \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Re-sorts a single column. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_COL_BORDER sortSlot: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -sortSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortInfoDone:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortInfoDone: \b0 (MiscSlotSortInfo*) \i sortInfo \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method reclaims temporary storage held in the \i sortInfo \i0 structure. You must call this method whenever you are finished using a \i sortInfo \i0 object.\ \fs16 \ \f2\b\fs28 See also: -sortInfoInit:border: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortInfoInit:border:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortInfoInit: \b0 (MiscSlotSortInfo*) \i sortInfo \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method precomputes the sorting information needed by the sorting methods. If you call any of the sorting methods that accept an \f3\fs24\fc1\cf1 info: \f0\fs28\fc0\cf0 argument, you must initialize the \i sortInfo \i0 structure by calling this method first. After you have finished using the \i sortInfo \i0 structure, you must reclaim the storage by passing the \i sortInfo \i0 structure to \f3\fs24\fc1\cf1 -sortInfoDone: \f0\fs28\fc0\cf0 . NOTE: The \i sortInfo \i0 structure stores the current sorting information for the table. Any changes made to the sorting environment after the \i sortInfo \i0 structure has been initialized will not affect the contents of the \i sortInfo \i0 structure, and therefore will not affect comparisons made using the \i sortInfo \i0 structure. Actions that affect the sorting environment include: rearranging columns/rows, installing a slotSortVector, installing a custom slot comparison function, changing the sort-type or sort-direction of a slot. Actions which alter the structure of the "other" border (like removing columns/rows) can potentially cause catastrophic failures.\ \fs16 \ \f2\b\fs28 See also: -border:compareSlots::info: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortRow:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortRow: \b0\fc1\cf1 (int) \i n \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Re-sorts a single row. Equivalent to: \f3\fs24\fc1\cf1 -border:MISC_ROW_BORDER sortSlot: \i n \f0\i0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -sortSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 sortSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sorts the slots in border \i b \i0 .\ \fs16 \ \f2\b\fs28 See also: -border:setSlot:sortDirection:, -border:setSlot:sortFunc:, -border:setSlot:sortType:, -border:setSlotSortVector:len:, -setCompareSlotFunc: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 stateAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b stateAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -state \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:stateAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -state \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero is returned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -state \b0 (ButtonCell) \b , -tableScroll:stateAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 stringValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b stringValueAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -stringValue \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:stringValueAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -stringValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero (a NULL pointer) is returned. NOTE: If you are using ButtonCells, you probably want \f3\fs24\fc1\cf1 -titleAt:: \f0\fs28\fc0\cf0 , not this method.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:stringValueAt:: \b0 (delegate method) \b , -titleAt:: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 suspendEditing\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b suspendEditing \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Internal method that temporarily suspends the current cell editing session (if any), while slots are being resized or rearranged. The editing session is resumed by \f3\fs24\fc1\cf1 -resumeEditing \f0\fs28\fc0\cf0 . These calls nest. These methods do nothing if cell editing is not in progress.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tag\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tag \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the \i tag \i0 of the MiscTableScroll object.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -border:slotTag:, -colTag:, -rowTag:, -setTag: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tagAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tagAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -tag \f0\fs28\fc0\cf0 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:tagAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:doubleValueAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f3\fs24\fc1\cf1 -tag \f0\fs28\fc0\cf0 message, that value is returned; otherwise, zero is returned.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:tagAt:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 target\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b target \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the object which receives the \i action \i0 message on a single mouse-click event.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b textColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current textColor.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textDidEnd:endChar:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b textDidEnd: \b0\fc1\cf1 (id) \i sender \b\i0 endChar: \b0 (unsigned short) \i whyEnd \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Invoked by \i sender \i0 , a Text object, when text editing ends. If the text changed then attempts to set the cell's new value by sending \f3\fs24\fc1\cf1 -tableScroll:setStringValue:at:: \f0\fs28\fc0\cf0 to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds, then sends \f3\fs24\fc1\cf1 -setStringValue: \f0\fs28\fc0\cf0 to the cell instead. It then sends the delegate notification \f3\fs24\fc1\cf1 -tableScroll:didEdit:at:: \f0\fs28\fc0\cf0 , sorts the data if auto-sorting is enabled, and finally sends the delegate notification \f3\fs24\fc1\cf1 -tableScroll:textDidEnd:endChar: \f0\fs28\fc0\cf0 . Lastly, \i whyEnd \i0 is checked for one of \i return \i0 , \i tab \i0 , or \i shift-tab \i0 . If \i whyEnd \i0 is return, then the action is sent to the target, else if it is tab or shift-tab, then \f3\fs24\fc1\cf1 -getNext:editRow:andCol: \f0\fs28\fc0\cf0 is invoked to determine which cell should be edited next and editing is initiated for that cell using \f3\fs24\fc1\cf1 -editCellAt:: \f0\fs28\fc0\cf0 . If no cell is eligible for editing, then \f3\fs24\fc1\cf1 -selectText: \f0\fs28\fc0\cf0 is sent to the object returned by \f3\fs24\fc1\cf1 -nextText \f0\fs28\fc0\cf0 or \f3\fs24\fc1\cf1 -previousText \f0\fs28\fc0\cf0 , as appropriate.\ \fs16 \ \fs28 You should never need to call this method manually, though subclasses may want to override it. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textDidChange:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b textDidChange: \b0\fc1\cf1 (id) \i sender \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Forwards this message to the \i delegate \i0 or \i dataDelegate \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textDidGetKeys:isEmpty:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b textDidGetKeys: \b0\fc1\cf1 (id) \i sender \b\i0 isEmpty: \b0 (BOOL) \i flag \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Forwards this message to the \i delegate \i0 or \i dataDelegate \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b textGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self textColor] \f0\fs28\fc0\cf0 , and converts the color to a gray scale value which is returned.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textWillChange:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b textWillChange: \b0\fc1\cf1 (id) \i sender \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Invoked automatically during editing to determine if it is okay to edit the cell. Forwards the message to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds then returns NO which indicates that the change is acceptable.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± textWillChange: \f0\b0\fc1\cf1 (Text delegate) \fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 textWillEnd:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b textWillEnd: \b0\fc1\cf1 (id) \i sender \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Invoked automatically before text editing ends. Forwards the message to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds then returns NO which indicates that it is acceptable to end editing.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: ± textWillEnd: \f0\b0\fc1\cf1 (Text delegate) \fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 titleAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b titleAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the value of sending a \f3\fs24\fc1\cf1 -title \f0\fs28\fc0\cf0 message to the cell at \i row, col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f3\fs24\fc1\cf1 -tableScroll:titleAt:: \f0\fs28\fc0\cf0 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f3\fs24\fc1\cf1 -tableScroll:titleAt:: \f0\fs28\fc0\cf0 message, then the cell is retrieved via \f3\fs24\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the -title message, that value is returned; otherwise, zero (a NULL pointer) is returned. NOTE: ButtonCell implements the \f3\fs24\fc1\cf1 -stringValue \f0\fs28\fc0\cf0 message by formatting the integer value of its state as a string. To retrieve the text label displayed on the button, you must use the \f3\fs24\fc1\cf1 -title \f0\fs28\fc0\cf0 method.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: -cellAt::, -isLazy, -setLazy:, -tableScroll:titleAt:: \b0 (delegate method) \b , -title \b0 (ButtonCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 totalHeight\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b totalHeight \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -totalSize:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 totalSize:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b totalSize: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the total display size. The sum of \f3\fs24\fc1\cf1 -border: \i b \i0 slotAdjustedSize: \f0\fs28\fc0\cf0 for all slots on the border.\ \fs16 \ \f2\b\fs28 See also: -border:slotAdjustedSize: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 totalWidth\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b totalWidth \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Equivalent to: \f3\fs24\fc1\cf1 -totalSize:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 trackBy:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b trackBy: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the orientation by which the mouse is tracked for selection. If \i b \i0 is MISC_ROW_BORDER then selection is performed on a row-wise basis. If \i b \i0 is MISC_COL_BORDER then selection is performed on a column-wise basis.\ \fs16 \ \f2\b\fs28 See also: ± trackingBy \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tracking\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tracking \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the mouse is currently being tracked by a cell, else NO. Technically, this method returns YES after the cell which will track the mouse has been highlighted, and NO after it has been unhighlighted. The cell which is tracking the mouse can be accessed via \f3\fs24\fc1\cf1 -clickedCell \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -clickedCol \f0\fs28\fc0\cf0 , or \f3\fs24\fc1\cf1 -clickedRow \f0\fs28\fc0\cf0 . Although setting a Cell's \i highlight \i0 flag is sufficient during mouse tracking in eager-mode, it is not sufficient in lazy-mode. Therefore MiscTableScroll uses this method in lazy-mode to determine when a cell should be drawn highlighted. You should rarely need to call this method, though it might be useful in subclasses.\ \fs16 \ \f2\b\fs28 See also: ± borderClickedSlot: \b0 , \b ± clickedCell \b0 , \b ± clickedCol \b0 , \b ± clickedRow \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 trackingBy\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscBorderType) \b trackingBy \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current orientation of keyboard tracking.\ \fs16 \ \f2\b\fs28 See also: ± trackBy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 uniformSizeCols\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b uniformSizeCols \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the uniform size for columns. If columns are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all columns have the same size as the value returned by this method. By default, columns are not uniformly sized. Equivalent to: \f3\fs24\fc1\cf1 -uniformSizeSlots:MISC_COL_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 uniformSizeRows\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b uniformSizeRows \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the uniform size for rows. If rows are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all rows have the same size as the value returned by this method. Rows are uniformly sized by default. Equivalent to: \f3\fs24\fc1\cf1 -uniformSizeSlots:MISC_ROW_BORDER \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 uniformSizeSlots:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXCoord) \b uniformSizeSlots: \b0 (MiscBorderType) \i b \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the uniform size for slots in border \i b \i0 . If slots are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all slots have the same size as the value returned by this method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 validRequestorForSendType:andReturnType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b validRequestorForSendType: \b0 (NXAtom) \i t_write \i0 \ \b\fi0 andReturnType: \b0 (NXAtom) \i t_read \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is called by the services system to update the services menu. If the \i delegate \i0 responds to the \f3\fs24\fc1\cf1 -tableScroll:validRequestorForSendType:andReturnType: \f0\fs28\fc0\cf0 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is checked. If neither object responds, \f3\fs24\fc1\cf1 -builtinValidRequestorForSendType:andReturnType: \f0\fs28\fc0\cf0 is called. Override this method in your subclass if you need different behavior. Returns the result of the called method.\ \fs16 \ \f2\b\fs28 See also: -builtinValidRequestorForSendType:andReturnType:, -tableScroll:validRequestorForSendType:andReturnType: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 writeNXAsciiPboardTypeToStream:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b writeNXAsciiPboardTypeToStream: \b0 (NXStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Writes the selected cells to \i stream \i0 as ASCII text. Columns are separated by tab characters (ASCII decimal 9). Rows are terminated with newline characters (ASCII decimal 10). The text is retrieved from the cells by first trying the -title message. If the cell does not respond to the \f3\fs24\fc1\cf1 -title \f0\fs28\fc0\cf0 message, then the \f3\fs24\fc1\cf1 -stringValue \f0\fs28\fc0\cf0 message is tried. Each tab character in the text retrieved from the cell is replaced with a single space character (ASCII decimal 32) before the text is written to \i stream \i0 . The selection is written in the current (visual) ordering. Called from \f3\fs24\fc1\cf1 -builtinWritePboard:type:toStream: \f0\fs28\fc0\cf0 , and \f3\fs24\fc1\cf1 -writeNXTabularTextPboardTypeToStream: \f0\fs28\fc0\cf0 . Override this method in your subclass if you want different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinWritePboard:type:toStream:, -writeNXTabularTextPboardTypeToStream: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 writeNXTabularTextPboardTypeToStream:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b writeNXTabularTextPboardTypeToStream: \b0 (NXStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Calls \f3\fs24\fc1\cf1 [self writeNXAsciiPboardTypeToStream: \i stream \i0 ] \f0\fs28\fc0\cf0 . Called from \f3\fs24\fc1\cf1 -builtinWritePboard:type:toStream: \f0\fs28\fc0\cf0 . Override this method in your subclass if you want different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinWritePboard:type:toStream:, -writeNXAsciiPboardTypeToStream: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 writePboard:type:toStream:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b writePboard: \b0 (id) \i pboard \i0 \ \b\fi0 type: \b0 (NXAtom) \i type \i0 \ \b toStream: \b0 (NXStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is responsible for writing data to the pasteboard. If the \i delegate \i0 responds to \f3\fs24\fc1\cf1 -tableScroll:writePboard:type:toStream: \f0\fs28\fc0\cf0 , the message is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If neither object responds to the message, the default method, \f3\fs24\fc1\cf1 -builtinWritePboard:type:toStream: \f0\fs28\fc0\cf0 , is called. Called from \f3\fs24\fc1\cf1 -builtinWriteSelectionToPasteboard:types: \f0\fs28\fc0\cf0 . Override this method in your subclass if you want different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinWritePboard:type:toStream:, -builtinWriteSelectionToPasteboard:types:, -tableScroll:writePboard:type:toStream: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 writeSelectionToPasteboard:types:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b writeSelectionToPasteboard: \b0 (id) \i pboard \i0 \ \b\fi0 types: \b0 (NXAtom*) \i types \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is invoked from the services system. If the \i delegate \i0 responds to \f3\fs24\fc1\cf1 -tableScroll:writeSelectionToPasteboard:types: \f0\fs28\fc0\cf0 , the message is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If neither object responds to the message, the default method, \f3\fs24\fc1\cf1 -builtinWriteSelectionToPasteboard:types: \f0\fs28\fc0\cf0 is called. Override this method in your subclass if you want different behavior.\ \fs16 \ \f2\b\fs28 See also: -builtinWriteSelectionToPasteboard:types:, -tableScroll:writeSelectionToPasteboard:types: \b0 (delegate method) \b , -readSelectionFromPasteboard: \b0 (NXServicesRequests) \b , -writeSelectionToPasteboard:types: \b0 (NXServicesRequests) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \fs28 \ \fs36\fi0\li1360 Methods Implemented by Cell Subclasses\ \fs16 \ \fi-380\li2480 \ \fs28 tableScroll:retireAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 retireAt: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to \f3\fs24\fc1\cf1 -tableScroll:retireCell:at:: \f0\fs28\fc0\cf0 then the MiscTableScroll tries sending this message to the cell itself to give it the opportunity to perform special handling when it is being retired from active use and returned to the cache. Must return \b self \b0 , or a suitable replacement object for storage in the cache.\ \fs16 \ \f2\b\fs28 See also: ±retireCell:at:: \b0 , \b ±tableScroll:retireCell:at:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \fs28 tableScroll:reviveAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 reviveAt: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to \b -tableScroll:reviveCell:at:: \b0 then the MiscTableScroll tries sending this message to the cell itself to give it the opportunity to perform special handling when it is being brought into use for the first time, or is being retrieved from the cache for reuse. Must return \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: ±reviveCell:At:: \b0 , \b ±tableScroll:reviveCell:at:: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs36\fi0\li1360 Methods Implemented by the Delegate\ \fs16 \ \fi-380\li2480 \ \fs28 tableScroll:abortEditAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 abortEditAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the delegate that a cell editing session has been aborted. This means that the normal \f3\fs24\fc1\cf1 -textWillEnd: \f0\fs28\fc0\cf0 validation did not take place.\ \fs16 \ \f2\b\fs28 See also: Cell Editing \b0 (Introduction) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \fs28 tableScroll:backgroundColorChangedTo:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 backgroundColorChangedTo: \b0 (NXColor) \i newColor \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 when the MiscTableScroll receives a \f3\fs24\fc1\cf1 -setBackgroundColor: \f0\fs28\fc0\cf0 message that actually changes the background color.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 tableScroll:border:slotDraggedFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \b slotDraggedFrom: \b0 (int) \i from_pos \i0 \ \b to: \b0 (int) \i to_pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 whenever the user drags a slot to a new position.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \fs28 tableScroll:border:slotPrototype:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \b slotPrototype: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sent to the \i delegate \i0 whenever the MiscTableScroll object needs the prototype cell for a column which has the \f3\fs24\fc1\cf1 MISC_TABLE_CELL_CALLBACK \f0\fs28\fc0\cf0 cell type. If the \i delegate \i0 does not respond to the message, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -border:setSlot:cellType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:border:slotResized:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \b slotResized: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 whenever the user resizes a slot.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:border:slotSortReversed:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \b slotSortReversed: \b0 (int) \i n \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 whenever the user reverses the sort direction of a slot.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:border:slotTitle:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 border: \b0 (MiscBorderType) \i b \i0 \ \b slotTitle: \b0 (int) \i slot \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sent to the \i delegate \i0 whenever the MiscTableScroll object needs a title for a border which has the \f3\fs24\fc1\cf1 MISC_DELEGATE_TITLE \f0\fs28\fc0\cf0 title mode. If the \i delegate \i0 does not respond to the message, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -border:setTitleMode: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollBuffCount:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tableScrollBuffCount: \b0 (MiscTableScroll*) \i scroll \i0 \ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fs16\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs28\li2100\fc0\cf0 Gives the \i delegate \i0 and \i dataDelegate \i0 of a lazy-mode MiscTableScroll the opportunity to report the number of buffers used for each slot. This information can be used to optimize-away string copying during sorting. This is a micro- optimization for sorting lazy-mode tables based on string values. It will probably not make a noticable difference until you have at least 10,000 rows in the table.\ \ Sorting retrieves the values of two cells from the same slot to compare them. In eager mode, it is sufficient to perform the comparison in a manner similar to this:\ \ \f4\fs20 strcmp( [cell1 stringValue], [cell2 stringValue] ) \f0\fs28 \ \ However, it is common for lazy-mode delegates to simply recycle a single cell to handle the \f3\fs24\fc1\cf1 -tableScroll:cellAt:: \f0\fs28\fc0\cf0 message. In that case, the first value is no longer valid when the second value is retrieved, so the MiscTableScroll object needs to copy the first value before retrieving the second value. By default, the MiscTableScroll object makes the pessimistic (but safe) assumption that it needs to copy the first string value before retrieving the second string value. Sophisticated delegates can eliminate this copy operation if they provide at least two buffers for each slot, or if they implement the string retrieval methods ( \f3\fs24\fc1\cf1 -tableScroll:stringValueAt:: \f0\fs28\fc0\cf0 and/or \f3\fs24\fc1\cf1 -tableScroll:titleAt:: \f0\fs28\fc0\cf0 ) in a way that makes it possible to retrieve a second string value from the same slot without invalidating the previous string value retrieved from that slot.\ \ If the value returned is greater than or equal to two (2), the string values will not be copied.\ \fs16 \ \f2\b\fs28 See also: -buffCount \b0\fs24 \ \pard\tx7140\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:canEdit:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 canEdit: \b0 (NXEvent const*) \i event \b\i0\fc1\cf1 at: \b0 (int) \i\fc0\cf0 row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Gives the \i delegate \i0 the opportunity to decide whether or not an editing session should be started for the cell at \i row \i0 , \i col \i0 . This method is invoked from both a \f4\fs20\fc1\cf1 -mouseDown: \f0\fs28\fc0\cf0 event, in which case \i event \i0 is the mouse-down event itself, and also from keyboard events in which case \i event \i0 is 0. This message is sent both on single-click events and multi-click events. It is the responsibility of the \i delegate \i0 to decide whether or not editing should begin. If the \i delegate \i0 returns YES, an editing session will begin for the cell. If the \i delegate \i0 returns NO, no editing session will begin. This message is tested with the \i delegate \i0 , \i dataDelegate \i0 and the cell itself. The first object that responds to the message decides the outcome. If none of those objects respond to the message, the default behavior will allow editing only on a double-click or keyboard event, and only if the cell is both editable and enabled.\ \fs16 \ \f2\b\fs28 See also: Cell Editing \b0 (Introduction) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:canWritePboardType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 canWritePboardType: \b0 (NXAtom) \i type \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to select which datatypes will be written to the pasteboard. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is given the opportunity.\ \fs16 \ \f2\b\fs28 See also: -canWritePboardType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:cellAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 cellAt: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the table scroll is in \i lazy \i0 mode this message is sent first to the \i delegate \i0 and then to the \i dataDelegate \b\i0 \b0 (if \i delegate \i0 does not respond) whenever the cell at \i row \i0 , \i col \i0 is needed. You must implement this method in either the \i delegate \i0 or the \i dataDelegate \i0 whenever you use a MiscTableScroll in lazy mode. The table scroll does not manage the cells for itself in lazy mode; the \i delegate \i0 or the \i dataDelegate \i0 must.\ \fs16 \ \pard\f2\b\fs28\fi-1440\li3540\fc0\cf0 See also: \f0\b0 ± \b setLazy: \b0 , ± \b isLazy\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:changeFont:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 changeFont: \b0 (Font*) \i oldFont \i0 \ \b to: \b0 (Font*) \i newFont \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 whenever a \f4\fs20\fc1\cf1 changeFont: \f0\fs28\fc0\cf0 message is received and the new font is different than the current font. The FontManager sends the \f4\fs20\fc1\cf1 changeFont: \f0\fs28\fc0\cf0 message whenever the user changes the font using either the FontPanel or the Font menu. This is distinguished from programmatic changes via the \f4\fs20\fc1\cf1 setFont: \f0\fs28\fc0\cf0 method so that you can record user preferences. This notification message is sent after the font change has been applied, but before the new font is displayed.\ \fs16 \ \f2\b\fs28 See also: -changeFont:, -setFont:, -tableScroll:fontChangedFrom:to: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollDidBecomeFirstResponder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScrollDidBecomeFirstResponder: \b0 (MiscTableScroll*) \i scroll \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that the MiscTableScroll's \i docView \i0 became first resonder.\ \fs16 \ \f2\b\fs28 See also: -tableScrollDidResignFirstResponder: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:didEdit:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 didEdit: \b0\fc1\cf1 (BOOL) \i changed \b\i0\fc0\cf0 at: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that a cell-editing session terminated, and whether or not the value in the cell changed. This is a notification-only message. The \i delegate \i0 is not given any veto power at this point. Veto power is available in the \f4\fs20\fc1\cf1 -textWillEnd: \f0\fs28\fc0\cf0 (Text) delegate message. This message is sent immediately after the \f4\fs20\fc1\cf1 -tableScroll:abortEdit:at:: \f0\fs28\fc0\cf0 messages and the \f4\fs20\fc1\cf1 -tableScroll:setStringValue:at:: \f0\fs28\fc0\cf0 messages, so this message is always sent in all cases when a cell editing session terminates.\ \fs16 \ \f2\b\fs28 See also: -tableScroll:willEditAt:: \b0 (delegate method) \b , Cell Editing \b0 (Introduction) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:didPrint:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 didPrint: \b0\fc1\cf1 (BOOL) \i didPrint \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that a printing session terminated. This method is called from \f3\fs24\fc1\cf1 -printPSCode: \f0\fs28\fc0\cf0 after printing has completed. This gives the \i delegate \i0 the opportunity to peform post-print cleanup, such as restoring global PrintInfo values. If the user pressed the "Cancel" button on the Print Panel, \i didPrint \i0 will be \f3\fs24\fc1\cf1 NO \f0\fs28\fc0\cf0 . If the user pressed the "OK" button on the Print Panel, \i didPrint \i0 will be \f3\fs24\fc1\cf1 YES \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: -tableScrollWillPrint: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollDidResignFirstResponder:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScrollDidResignFirstResponder: \b0 (MiscTableScroll*) \i scroll \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that the MiscTableScroll's \i docView \i0 resigned first resonder.\ \fs16 \ \f2\b\fs28 See also: -tableScrollDidBecomeFirstResponder: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:doubleValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (double) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 doubleValueAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -doubleValueAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -doubleValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 double \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -doubleValueAt::, -isLazy, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:floatValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 floatValueAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -floatValueAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -floatValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 float \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -floatValueAt::, -isLazy, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:fontChangedFrom:to:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 fontChangedFrom: \b0 (Font*) \i oldFont \i0 \ \b to: \b0 (Font*) \i newFont \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 whenever a - \f4\fs20\fc1\cf1 setFont: \f0\fs28\fc0\cf0 message is received and the new font is different than the current font. This notification message is sent after all font changes, both user-initiated and programmatic. This message is sent after the font change has been applied, but before the new font is displayed.\ \fs16 \ \f2\b\fs28 See also: -changeFont:, -setFont:, -tableScroll:changeFont:to: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:getISearchCol:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 getISearchCol: \b0 (int*) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 First the \i delegate \i0 and then the \i dataDelegate \i0 is tested for response to this message whenever a keystroke is received that could start incremental searching. If the \i delegate \i0 responds, the message is sent to the \i delegate \i0 . Otherwise, if the \i dataDelegate \i0 responds, the message is sent to the \i dataDelegate \i0 . Return YES if incremental searching should be enabled, and set * \i col \i0 to the physical index of the column that the table is sorted on, otherwise return NO. The delegates have the opportunity to decide whether or not incremental searching should be enabled, and indicate which column the table is sorted on. If you want to enable incremental searching and you do not use the auto-sort facilities, then you must implement this method to tell the MiscTableScroll object which column the table is sorted on. The table must be sorted in \i col \i0 order (ascending or descending). \f4\fs20\fc1\cf1 -doIncrementalSearch:col: \f0\fs28\fc0\cf0 calls \f3\fs24\fc1\cf1 [self border:MISC_COL_BORDER slotSortType: \i col \i0 ] \f0\fs28\fc0\cf0 to determine the sort-type. The sort-type for \i col \i0 must be one of the string-based sort-types: \f3\fs24\fc1\cf1 MISC_SORT_STRING_CASE_INSENSITIVE \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 MISC_SORT_STRING_CASE_SENSITIVE \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 MISC_SORT_TITLE_CASE_INSENSITIVE \f0\fs28\fc0\cf0 or \f3\fs24\fc1\cf1 MISC_SORT_TITLE_CASE_SENSITIVE \f0\fs28\fc0\cf0 . \i Col \i0 must not have a custom sort function. You are responsible for ensuring that the table is sorted in \i col \i0 order. \f4\fs20\fc1\cf1 -doIncrementalSearch:col: \f0\fs28\fc0\cf0 calls \f3\fs24\fc1\cf1 [self border:MISC_COL_BORDER slotSortDirection: \i col \i0 ] \f0\fs28\fc0\cf0 to determine the sort-direction. If the table is sorted in the other direction, use the complement of the column's physical index ( \i ~col \i0 ).\ \fs16 \ \f2\b\fs28 See also: -doGetISearchCol:, -doIncrementalSearch:col:, -getISearchCol:, -incrementalSearch: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:highlightBackgroundColorChangedTo:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 highlightBackgroundColorChangedTo: \b0 (NXColor) \i newColor \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 when the MiscTableScroll receives a \f3\fs24\fc1\cf1 -setHighlightBackgroundColor: \f0\fs28\fc0\cf0 message that actually changes the highlighted background color.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:highlightTextColorChangedTo:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 highlightTextColorChangedTo: \b0 (NXColor) \i newColor \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 when the MiscTableScroll receives a \f3\fs24\fc1\cf1 -setHighlightTextColor: \f0\fs28\fc0\cf0 message that actually changes the highlighted text color.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:intValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 intValueAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -intValueAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -intValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 int \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -intValueAt::, -isLazy, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:readSelectionFromPasteboard:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 readSelectionFromPasteboard: \b0 (id) \i pboard \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to take over the process of reading data from the pasteboard. If the \i delegate \i0 does not respond to this message, the \i dataDelegate \i0 is tried. The delegate should return \b self \b0 if the data was successfully read from the pasteboard, else it should return \b nil \b0 .\ \fs16 \ \f2\b\fs28 See also: -readSelectionFromPasteboard: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollRegisterServicesTypes:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScrollRegisterServicesTypes: \b0 (MiscTableScroll*) \i scroll \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to register different datatypes with the services system. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -registerServicesTypes: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:retireCell:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 retireCell: \b0 (id) \i\fc1\cf1 cell \b\i0\fc0\cf0 \ at: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to perform special handling of cells that are being retired to the cache. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 does not respond either, the cell itself is tried (with \f4\fs20\fc1\cf1 -tableScroll:retireAt:: \f0\fs28\fc0\cf0 ). Must return \i cell \i0 , or a suitable replacement object for storage in the cache.\ \fs16 \ \f2\b\fs28 See also: -retireCell:at:: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:reviveCell:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 reviveCell: \b0 (id) \i cell \i0 \ \b at: \b0 (int) \i row \i0 \b : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to perform special handling of cells that are being brought into use for the first time, or are being retrieved from the cache for reuse. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 does not respond either, the cell itself is tried (with \f4\fs20\fc1\cf1 -tableScroll:reviveAt:: \f0\fs28\fc0\cf0 ). Must return \i cell \i0 .\ \fs16 \ \f2\b\fs28 See also: -reviveCell:at:: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:setStringValue:at::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 setStringValue: \b0\fc1\cf1 (char const*) \i s \b\i0\fc0\cf0 at: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent from within \f4\fs20\fc1\cf1 -textDidEnd:endChar: \f0\fs28\fc0\cf0 when a cell editing session has successfully finished (not aborted) and the string value for the cell was actually changed. This method provides the \i delegate \i0 with an after-the-fact veto option. If the \i delegate \i0 returns NO, then the MiscTableScroll object assumes that the change was rejected, and that the cell retains its previous contents. If the \i delegate \i0 returns YES, then the MiscTableScroll object assumes that the \i delegate \i0 stored the new string value into the appropriate cell, and that slot needs to have its sort position reevaluated. This method is optional for delegates of eager MiscTableScroll objects. This method is mandatory for delegates of lazy MiscTableScroll objects that allow cell editing. If the \i delegate \i0 implements this method, the \i delegate \i0 is responsible for setting the string value in the appropriate cell in the MiscTableScroll object. \ \fs16 \ \f2\b\fs28 See also: Cell Editing \b0 (Introduction) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:stateAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 stateAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -stateAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -state \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 state \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -stateAt::, -isLazy, -setLazy:, -state \b0 (ButtonCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:stringValueAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 stringValueAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -stringValueAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -stringValue \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 string \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -stringValueAt::, -isLazy, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:tagAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 tagAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -tagAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -tag \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 tag \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -tagAt::, -isLazy, -setLazy: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:textColorChangedTo:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 textColorChangedTo: \b0 (NXColor) \i newColor \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 and then the \i dataDelegate \i0 when the MiscTableScroll receives a \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 message that actually changes the text color.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:titleAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char const*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 titleAt: \b0 (int) \i row \b\i0\fc1\cf1 : \b0 (int) \i\fc0\cf0 col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f4\fs20\fc1\cf1 -titleAt:: \f0\fs28\fc0\cf0 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f4\fs20\fc1\cf1 -cellAt:: \f0\fs28\fc0\cf0 . If the cell responds to the \f4\fs20\fc1\cf1 -title \f0\fs28\fc0\cf0 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f3\fs24\fc1\cf1 title \f0\fs28\fc0\cf0 values.\ \fs16 \ \f2\b\fs28 See also: -cellAt::, -isLazy, -setLazy:, -stringValueAt::, -title \b0 (ButtonCell) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:validRequestorForSendType:andReturnType:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 validRequestorForSendType: \b0 (NXAtom) \i t_write \i0 \ \b andReturnType: \b0 (NXAtom) \i t_read \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to interact with the services system using different combinations of send and return types than the MiscTableScroll object alone normally does. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -validRequestorForSendType:andReturnType: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:willEditAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 willEditAt: \b0 (int) \i row \b\i0 : \b0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that a cell editing session is about to start. This is a notification-only message. There is no veto option associated with this message. A veto option is provided with the \f4\fs20\fc1\cf1 -tableScroll:canEdit:at:: \f0\fs28\fc0\cf0 message. This message, and its counterpart, \f4\fs20\fc1\cf1 -tableScroll:didEdit:at:: \f0\fs28\fc0\cf0 , bracket cell editing sessions for delegates that want to perform extra operations before and after cell editing sessions without interfering with any of the begin/end decisions. This message is offered to the \i delegate \i0 , and then the \i dataDelegate \i0 if the delegate does not respond.\ \fs16 \ \f2\b\fs28 See also: -tableScroll:didEdit:at::, Cell Editing \b0 (Introduction) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollWillPrint:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScrollWillPrint: \b0 (MiscTableScroll*) \i scroll \i0\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Notifies the \i delegate \i0 that a printing session is about to start. This is a notification-only message. There is no veto option associated with this message. This message is sent from \f3\fs24\fc1\cf1 -printPSCode: \f0\fs28\fc0\cf0 before the PrintPanel is presented to the user. This message, and its counterpart, \f4\fs20\fc1\cf1 -tableScroll:didPrint: \f0\fs28\fc0\cf0 , bracket printing sessions for delegates that want to perform extra operations before and after printing sessions. This method is useful for pre-print setup operations like overriding global PrintInfo settings. This message is offered to the \i delegate \i0 , and then the \i dataDelegate \i0 if the delegate does not respond.\ \fs16 \ \f2\b\fs28 See also: -tableScroll:didPrint: \b0\fc1\cf1 (delegate method) \f0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28\fc1\cf1 tableScroll:willPrintPageFooter:info:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 \ \fi0 willPrintPageFooter: \b0 (id) \i footer \i0 \ \b\fc1\cf1 info: \b0\fc0\cf0 (MiscTablePrintInfo const*) \i info \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 \ \fs16 \ \f2\b\fs28 See also: -tableScroll:willPrintPageHeader:info: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:willPrintPageHeader:info:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 \ \fi0 willPrintPageHeader: \b0 (id) \i header \i0 \ \b\fc1\cf1 info: \b0\fc0\cf0 (MiscTablePrintInfo const*) \i info \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 \ \fs16 \ \f2\b\fs28 See also: -tableScroll:willPrintPageFooter:info: \b0 (delegate method) \f0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:writePboard:type:toStream:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 writePboard: \b0 (id) \i pboard \i0 \ \b type: \b0 (NXAtom) \i type \i0 \ \b toStream: \b0 (NXStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to write new datatypes to the pasteboard, or change the way that the built-in types are written. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -writePboard:type:toStream: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:writeSelectionToPasteboard:types:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 writeSelectionToPasteboard: \b0 (id) \i pboard \i0 \ \b types: \b0 (NXAtom*) \i types \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to completely take over the writing of data to the pasteboard. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \fs16 \ \f2\b\fs28 See also: -writeSelectionToPasteboard:types: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \fi0\li1360 \ \fs36 Delegate Methods for Dragging Source Operations\ \fs16 \ \fi-380\li2480 \ \fs28 tableScroll:allowDragOperationAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 allowDragOperationAt: \b0 (int) \i row \b : \b0\i0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \b\i0 \b0 if necessary by the MiscTableScroll to determine whether or not dragging an image from a cell should be allowed. The appropriate delegate should return YES if dragging the image from the cell at \i row \i0 and \i col \i0 is allowed, or NO if it is not.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:draggingSourceOperationMaskForLocal:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXDraggingOperation) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 draggingSourceOperationMaskForLocal: \b0 (BOOL) \i isLocal \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to NXDraggingSource's \f4\fs20\fc1\cf1 -draggingSourceOperationMaskForLocal: \f0\fs28\fc0\cf0 metho \fc1\cf1 d. If the delegate does not implement this method, then MiscTableScroll returns \f4\fs20 NX_DragOperationGeneric \f0\fs28 by default.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScrollIgnoreModifierKeysWhileDragging:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScrollIgnoreModifierKeysWhileDragging: \b0 (MiscTableScroll*) \i scroll \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to NXDraggingSource's \f4\fs20\fc1\cf1 -ignoreModifierKeysWhileDragging \f0\fs28\fc0\cf0 method \fc1\cf1 . If the delegate does not implement this method, then MiscTableScroll returns YES by default.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:imageForDragOperationAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXImage*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 imageForDragOperationAt: \b0 (int) \i row \b : \b0\i0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary to give the delegate a chance to provide the image used for the dragging operation. This method is required for non-image cells. It is optional for image cells, in which case, if the \i delegate \i0 does not implement it or if it returns 0, then the image stored in the cell is used for dragging instead.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:preparePasteboard:forDragOperationAt::\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 preparePasteboard: \b0 (Pasteboard*) \i pb \i0 \ \b\fc1\cf1 forDragOperationAt \fc0\cf0 : \b0 (int) \i row \b : \b0\i0 (int) \i col \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to have the Pasteboard \i pb \i0 prepared for the dragging operation. The appropriate delegate \i must \i0 send a \f4\fs20\fc1\cf1 -declareTypes:num:owner: \f0\fs28\fc0\cf0 message to the Pasteboard followed by appropriate \f4\fs20\fc1\cf1 -writeType \f0\i\fs28\fc0\cf0 ... \i0 messages if needed. Extra precaution should be taken when declaring a non-null pasteboard \i owner \i0 as discussed in the \b Image Dragging \b0 section of this document.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 tableScroll:shouldDelayWindowOrderingForEvent:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \ \b\fi0 shouldDelayWindowOrderingForEvent: \b0 (NXEvent*) \i event \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to View's - \f4\fs20\fc1\cf1 shouldDelayWindowOrderingForEvent: \f0\fs28\fc0\cf0 method \fc1\cf1 . This method is only invoked if the delegate's \f4\fs20 -tableScroll:allowDragOperationAt:: \f0\fs28 method indicates that the cell under the mouse is a potential a dragging source. If the delegate does not implement this method, then this method returns YES by default.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs36\fi0\li1360 Constants and Defined Types\ \fs16\fi-380\li2480 \ \ \pard\tx6480\f3\b0\fs24\li2100\fc1\cf1 typedef int MiscPixels;\ typedef int MiscCoord_V; // Visual coordinate.\ typedef int MiscCoord_P; // Physical coordinate.\ \ #define MISC_MIN_PIXELS_SIZE ((MiscPixels) 10)\ #define MISC_MAX_PIXELS_SIZE ((MiscPixels) 0x7FFF0000)\ \ \pard\tx7380\li2100\fc1\cf1 #define MISC_TABLE_SCROLL_ERROR_BASE 33000\ \pard\tx6480\li2100\fc1\cf1 \ typedef enum\ \{\ MISC_TABLE_SCROLL_ASSERTION = MISC_TABLE_SCROLL_ERROR_BASE\ \} MiscTableScrollErrorTokens;\ \ \pard\tx7200\li2100\fc1\cf1 #define MISC_TABLE_SCROLL_ERROR_MAX MISC_TABLE_SCROLL_ASSERTION\ \pard\tx6480\li2100\fc1\cf1 \ typedef enum\ \{\ MISC_COL_BORDER,\ MISC_ROW_BORDER\ \} MiscBorderType;\ \ #define MISC_MAX_BORDER MISC_ROW_BORDER\ #define MISC_OTHER_BORDER(B) \\\ (B == MISC_ROW_BORDER ? MISC_COL_BORDER : MISC_ROW_BORDER)\ \ \ typedef struct\ \{\ NXRect page_rect; // [PrintInfo paperRect]\ NXRect print_rect; // MiscTableView rect.\ MiscCoord_V first_print_row;// one's comp if started on prev page.\ MiscCoord_V last_print_row; // one's comp if ends on later page.\ MiscCoord_V first_print_col;// one's comp if started on prev page.\ MiscCoord_V last_print_col; // one's comp if ends on later page.\ int print_page; // 1 <= print_page <= num_print_pages\ int print_row; // 1 <= print_row <= num_print_rows\ int print_col; // 1 <= print_col <= num_print_cols\ int num_print_pages;\ int num_print_rows;\ int num_print_cols;\ double scale_factor;\ BOOL is_scaled;\ \} MiscTablePrintInfo;\ \ \ typedef enum\ \{\ MISC_NO_TITLE, // No titles on row/col cells.\ MISC_NUMBER_TITLE, // Titles are sequential numbers.\ MISC_ALPHA_TITLE, // Titles are sequential alphabetics...\ MISC_CUSTOM_TITLE, // Titles are user-supplied strings...\ MISC_DELEGATE_TITLE // Ask the delegate for titles.\ \} MiscTableTitleMode;\ \ #define MISC_MAX_TITLE MISC_DELEGATE_TITLE\ \ \ typedef enum\ \{\ MISC_LIST_MODE,\ MISC_RADIO_MODE,\ MISC_HIGHLIGHT_MODE\ \} MiscSelectionMode;\ \ #define MISC_MAX_MODE MISC_HIGHLIGHT_MODE\ \ \ typedef enum\ \{\ MISC_TABLE_CELL_TEXT,\ MISC_TABLE_CELL_ICON,\ MISC_TABLE_CELL_BUTTON,\ MISC_TABLE_CELL_CALLBACK\ \} MiscTableCellStyle;\ \ #define MISC_TABLE_CELL_MAX MISC_TABLE_CELL_CALLBACK\ \ \ \pard\tx6660\li2100\fc1\cf1 #define MISC_SIZING_SPRINGY_BIT (1 << 0) // Adjusts for global limits.\ #define MISC_SIZING_USER_BIT (1 << 1) // User can resize.\ \ \ typedef enum\ \{\ MISC_NUSER_NSPRINGY_SIZING,\ MISC_NUSER_SPRINGY_SIZING,\ MISC_USER_NSPRINGY_SIZING,\ MISC_USER_SPRINGY_SIZING,\ \} MiscTableSizing;\ \ #define MISC_MAX_SIZING MISC_USER_SPRINGY_SIZING\ \pard\tx6480\li2100\fc1\cf1 \ \ typedef enum\ \{\ MISC_SORT_ASCENDING,\ MISC_SORT_DESCENDING\ \} MiscSortDirection;\ \ #define MISC_SORT_DIR_MAX MISC_SORT_DESCENDING\ #define MISC_OTHER_DIRECTION(D) \\\ ((D) == MISC_SORT_DESCENDING ? \\\ MISC_SORT_ASCENDING : MISC_SORT_DESCENDING)\ \ \ \pard\tx7680\li2100\fc1\cf1 typedef enum // Selector used to get data:\ \{\ MISC_SORT_STRING_CASE_INSENSITIVE, // -stringValue\ MISC_SORT_STRING_CASE_SENSITIVE, // -stringValue\ MISC_SORT_INT, // -intValue\ MISC_SORT_UNSIGNED_INT, // -intValue\ MISC_SORT_TAG, // -tag\ MISC_SORT_UNSIGNED_TAG, // -tag\ MISC_SORT_FLOAT, // -floatValue\ MISC_SORT_DOUBLE, // -doubleValue\ MISC_SORT_SKIP, // Don't compare cells in this slot.\ MISC_SORT_TITLE_CASE_INSENSITIVE, // -title\ MISC_SORT_TITLE_CASE_SENSITIVE, // -title\ MISC_SORT_STATE, // -state\ MISC_SORT_UNSIGNED_STATE, // -state\ \} MiscSortType;\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \ \pard\tx6480\li2100\fc1\cf1 #define MISC_SORT_TYPE_MAX MISC_SORT_UNSIGNED_STATE\ #define MISC_SORT_CUSTOM ((MiscSortType)(int(MISC_SORT_TYPE_MAX) + 1))\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \ \ \pard\tx5040\li2100\fc1\cf1 @class MiscTableScroll;\ \ typedef struct MiscEntrySortInfo MiscEntrySortInfo;\ typedef struct MiscSlotSortInfo MiscSlotSortInfo;\ \ typedef int (*MiscCompareEntryFunc)\ ( int r1, int c1, int r2, int c2, \ MiscEntrySortInfo const* entry_info,\ MiscSlotSortInfo* sort_info );\ \ typedef int (*MiscCompareSlotFunc)\ ( int slot1, int slot2, MiscSlotSortInfo* );\ \ extern int MiscDefaultCompareSlotFunc\ ( int slot1, int slot2, MiscSlotSortInfo* );\ \ #define MISC_TS_TYPE_AT( TYPE, NAME ) \\\ typedef TYPE (*MISC_TS_##NAME##_AT)(id,SEL,id,int r,int c, ...);\ \ \pard\tx8340\li2100\fc1\cf1 MISC_TS_TYPE_AT( int, INT ) // MISC_TS_INT_AT\ MISC_TS_TYPE_AT( float, FLOAT ) // MISC_TS_FLOAT_AT\ MISC_TS_TYPE_AT( double, DOUBLE ) // MISC_TS_DOUBLE_AT\ MISC_TS_TYPE_AT( char const*, STRING ) // MISC_TS_STRING_AT\ \pard\tx5040\li2100\fc1\cf1 \ typedef union\ \pard\tx3220\tx6500\li2100\fc1\cf1 \{\ MISC_TS_INT_AT i;\ MISC_TS_FLOAT_AT f;\ MISC_TS_DOUBLE_AT d;\ MISC_TS_STRING_AT s;\ \} MISC_TS_VAL_AT_FUNC;\ \pard\tx5040\li2100\fc1\cf1 \ \pard\tx2880\li2100\fc1\cf1 #define MISC_TS_TYPE_VAL( TYPE, NAME ) \\\ typedef TYPE (*MISC_TS_##NAME##_VAL)(id,SEL);\ \pard\tx5040\li2100\fc1\cf1 \ \pard\tx8340\li2100\fc1\cf1 MISC_TS_TYPE_VAL( int, INT ) // MISC_TS_INT_VAL\ MISC_TS_TYPE_VAL( float, FLOAT ) // MISC_TS_FLOAT_VAL\ MISC_TS_TYPE_VAL( double, DOUBLE ) // MISC_TS_DOUBLE_VAL\ MISC_TS_TYPE_VAL( char const*, STRING ) // MISC_TS_STRING_VAL\ \pard\tx5040\li2100\fc1\cf1 \ typedef union\ \pard\tx3220\tx6500\li2100\fc1\cf1 \{\ MISC_TS_INT_VAL i;\ MISC_TS_FLOAT_VAL f;\ MISC_TS_DOUBLE_VAL d;\ MISC_TS_STRING_VAL s;\ \} MISC_TS_VAL_FUNC;\ \ \ // *** WARNING ***\ // The sizes of these structures are likely to change between versions.\ // *** WARNING ***\ \ struct MiscEntrySortInfo\ \{\ int slot;\ int ascending;\ MISC_TS_VAL_AT_FUNC value_func;\ id value_target;\ SEL value_sel;\ id value_obj;\ IMP cell_at_func;\ id cell_class;\ SEL cell_sel;\ MISC_TS_VAL_FUNC cell_func;\ MiscSortType sort_type;\ MiscCompareEntryFunc compare_func;\ \};\ \ \ struct MiscSlotSortInfo\ \{\ MiscTableScroll* table_scroll;\ NXZone* zone;\ MiscBorderType border_type;\ int num_entries;\ MiscEntrySortInfo const* entry_info;\ BOOL need_copy;\ char* buff;\ int buff_size;\ \};\ } MiscKit/Documentation/Classes/MiscTableCell.rtf100444 1750 1750 303443 6757716172 22071 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh9020 \margl120 \margr0 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 Version 1.0, Copyright \f1 ã \f0 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. All Rights Reserved.\ Paul S. McCarthy and Eric Sunshine -- July 1, 1997\ \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \pard\f2\b\fs56\li2100\fc0\cf0 MiscTableCell\ \pard\tx4880\f0\b0\fs16\fi-2780\li4880\fc0\cf0 \ \ \ \ \f2\b\fs28 Inherits From: \f0\b0 Cell : Object\ \fs16 \ \f2\b\fs28 Declared In: \f0\b0 MiscTableCell.h\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Class Description\ \fs16 \ \pard\tx2480\tx2860\tx3240\f0\b0\fs28\li2100\fc0\cf0 This is the cell class used by {{\NeXTHelpLink288 \markername ;\linkFilename MiscTableScroll.rtf;\linkMarkername ;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i0\ulnone\fs28\li2100\fc0\cf0 MiscTableScroll to display either text or an icon. This class provides a tag and separate text and background colors for normal and highlighted states. In addition to the \f3\fs24\fc1\cf1 -setIcon: \f0\fs28\fc0\cf0 and \f3\fs24\fc1\cf1 -icon \f0\fs28\fc0\cf0 methods which are inherited from Cell, this class provides support for unnamed images with the {{\NeXTHelpLink577 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setImage:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -setImage: \f0\fs28\fc0\cf0 and {{\NeXTHelpLink593 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername image;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -image \f0\fs28\fc0\cf0 methods. Finally, this class also supports the concept of an \i owner \i0 , and inherited font and color values.\ \fs16 \ \ {\b\fs28{\NeXTHelpMarker709 \markername Owner_discussion;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 Owner and Inheritence of Colors and Font \b0 \ \fs16 \ \fs28 This class implements the concept of an \i owner \i0 . An owner provides the default font and colors used by the cells that it owns. This makes it fast and easy to change the appearance of an entire table: set the font and colors of the owner, and all of the cells that it owns automatically inherit the new font and colors. However, you can also set font and color values for individual cells. Values that you explicitly set supercede values implicitly inherited from the owner. You can use this feature to emphasize special cells while still using inherited values for normal cells.\ \f2\b\fs16\li1360 \ \f0\b0\fs28\li2100 Another benefit of inherited values is reduced memory usage. Inherited values don't have to be stored in the individual cells. They just ask their owner for the current value whenever it is needed. This can lead to significant savings in large tables. \ \fs16 \ \ \pard\tx2480\tx2860\tx3240\b\fs28\li2100\fc0\cf0 Owner drawing \b0 \ \fs16 \ \fs28 This class also supports a specialized concept of delegated drawing. The MiscTableScroll class will draw cells that respond with YES to the \f3\fs24\fc1\cf1 -ownerDraw \f0\fs28\fc0\cf0 message. This enables the MiscTableScroll object to eliminate many redundant font and color setting operations, greatly improving drawing performance. See the description of owner drawing in MiscTableScroll for a more detailed discussion.\ \fs16 \ \ {\pard\tx2480\tx2860\tx3240\fs28\li2100\fc0\cf0{\NeXTHelpMarker2003 \markername tc1_discussion;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 Extensible Memory Management \b0 \ \fs16 \ \fs28 To minimize memory usage, storage for optional items is allocated on an as-needed basis. Memory is allocated only for the values that are actually set. If no optional items are set, then no extra memory at all is allocated.\ \f2\b\fs16\li1360 \ \f0\b0\fs28\li2100 The optional allocation scheme is extensible. Subclasses of MiscTableCell can extend this allocation scheme by appending their own dynamic variables to the end of the list used by this class. There is a strict ordering for the information stored in the variable length {{\NeXTHelpLink2532 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1_data;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i0\ulnone\fs28\li2100\fc0\cf0 data. This ordering is enumerated by the {\i{\NeXTHelpLink2575 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1_flags;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i\ulnone\fs28\li2100\fc0\cf0 tc1_flags \i0 . Subclasses should append their data after the last of the information stored by this class. Methods are provided to determine whether or not a piece of information is stored in the data field as well as for finding its address. Convenience methods for extracting a given piece of information complete the interface.\ \f2\b\fs16\li1360 \ \f0\b0\fs28\li2100 The methods which return the address of the piece of data in \i tc1_data \i0 are dynamic in nature. For instance, text color is stored prior to background color in \i tc1_data \i0 so if both text color and background color have been set then the address of the storage for the background color will follow the text color. However, if text color is never set ± that is it is inherited from the owner ± and the background color has been set then the address of the background color will be at a different location. If text color gets set later then the storage for background color is shifted up to make room for the text color. Ergo, the strict ordering is maintained.\ \f2\b\fs16\li1360 \ \f0\b0\fs28\li2100 For example, code to locate the address of the highlighted background color is stored in the cell would look like this:\ \fs16 \ \pard\tx2880\tx3240\f3\fs24\li2520\fc1\cf1 - (unsigned int) tc1HighlightBackgroundColorPos\ \{\ unsigned int pos = [self tc1HighlightTextColorPos];\ if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H)\ pos += [self tc1HighlightTextColorLen];\ return pos;\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \fs28\fc1\cf1 Since the highlighted background color is stored following the highlighted text color it first determines the location of the highlighted text color then adds the length of the highlighted text color to that address if the highlighted text color is in fact being stored locally. The actual shifting of the dynamic memory is done in the \f3\fs24 -setUseOwner \f0\fs28 ... methods. For instance:\ \fs16\fc0\cf0 \ \pard\tx2880\tx3240\tx3600\tx3960\f3\fs24\li2520\fc1\cf1 - setUseOwnerHighlightBackgroundColor: (BOOL) flag\ \{\ if ([self useOwnerHighlightBackgroundColor] != flag)\ \{\ unsigned int const pos = [self tc1HighlightBackgroundColorPos];\ unsigned int const len = [self tc1HighlightBackgroundColorLen];\ if (flag)\ \{\ [self tc1DeleteDataPos:pos len:len];\ tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR_H);\ \}\ else // (!flag)\ \{\ NXColor color = [[self class] defaultHighlightBackgroundColor];\ [self tc1InsertData:&color pos:pos len:len];\ tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR_H;\ \}\ \}\ return self;\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \fs28\fc1\cf1 Finally, the \f3\fs24 -setHighlightBackgroundColor: \f0\fs28 method makes room for the data and then stores it:\ \fs16\fc0\cf0 \ \pard\tx2880\tx3240\f3\fs24\li2520\fc1\cf1 - setHighlightBackgroundColor: (NXColor) c\ \{\ NXColor* p;\ [self setUseOwnerHighlightBackgroundColor:NO];\ p = [self tc1HighlightBackgroundColorPtr];\ *p = c;\ return self;\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \fs28\fc1\cf1 A subclass adding more data to the end of \i tc1_data \i0 would provide similar methods. Its counterpart to \f3\fs24 -tc1HighlightBackgroundColorPos \f0\i\fs28 \i0 would first call \f3\fs24 -tc1HighlightBackgroundColorPos \f0\i\fs28 \i0 to determine its address and then add the correct offset returned by \f3\fs24 -tc1HighlightBackgroundColorLen \f0\fs28 as appropriate.\ \fs16\fc0\cf0 \ \ \pard\f2\b\li1360\fc0\cf0 \ \ \fs36 Instance Variables\ \fs16 \ \pard\tx2860\f0\b0\fs28\li2100\fc0\cf0 id \b owner \b0 ;\ int \b tag \b0 ;\ unsigned \b tc1_flags \b0 ;\ void* \b tc1_data \b0 ;\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \ \ \fs28 owner The owner of this cell; queried for font and color information.\ \fs16 \ \fs28 tag A general purpose slot for your use.\ \fs16 \ \fs28 tc1_flags Bit {{\NeXTHelpLink5630 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1_flags;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc0\cf0 flags describing the contents of \i tc1_data \i0 .\ \fs16 \ {\fs28{\NeXTHelpMarker5675 \markername tc1_data;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc0\cf0 tc1_data Variable length {{\NeXTHelpLink5701 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1_discussion;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc0\cf0 data which is allocated only as needed for storage of color values.\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \fs36 Method Types\ \fs16 \ \pard\tx6140\tx9660\tx10180\f0\b0\fs28\fi-4040\li6140\fc1\cf1 Initializing, freeing, and copying {{\NeXTHelpLink5823 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initIconCell:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± initIconCell:\ {{\NeXTHelpLink5842 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initTextCell:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± initTextCell:\ {{\NeXTHelpLink5861 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername free;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± free\ {{\NeXTHelpLink5871 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername copy;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± copyFromZone:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Drawing {{\NeXTHelpLink5898 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawInside:inView:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± drawInside:inView:\ {{\NeXTHelpLink5922 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawSelf:inView:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± drawSelf:inView:\ {{\NeXTHelpLink5944 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername isOpaque;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± isOpaque\ {{\NeXTHelpLink5958 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername bgColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± bgColor\ {{\NeXTHelpLink5971 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername fgColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± fgColor\ {{\NeXTHelpLink5984 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername ownerDraw;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± ownerDraw\ {{\NeXTHelpLink5999 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerDraw;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerDraw:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Tag manipulation {{\NeXTHelpLink6035 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTag:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setTag:\ {{\NeXTHelpLink6048 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tag;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tag\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Font manipulation {{\NeXTHelpLink6075 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername font;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± font\ {{\NeXTHelpLink6085 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setFont:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setFont:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Icon {{\NeXTHelpLink6104 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername image;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± image\ {{\NeXTHelpLink6115 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setImage:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setImage:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Setting and querying colors {{\NeXTHelpLink6158 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 + defaultBackgroundColor\ {{\NeXTHelpLink6186 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultFont;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 + defaultFont\ {{\NeXTHelpLink6203 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 + defaultHighlightBackgroundColor\ {{\NeXTHelpLink6240 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 + defaultHighlightTextColor\ {{\NeXTHelpLink6271 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 + defaultTextColor\ {{\NeXTHelpLink6293 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± backgroundColor\ {{\NeXTHelpLink6314 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundGray;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± backgroundGray\ {{\NeXTHelpLink6334 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± highlightBackgroundColor\ {{\NeXTHelpLink6364 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundGray;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± highlightBackgroundGray\ {{\NeXTHelpLink6393 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± highlightTextColor\ {{\NeXTHelpLink6417 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextGray;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± highlightTextGray\ {{\NeXTHelpLink6440 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setBackgroundColor:\ {{\NeXTHelpLink6465 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundGray:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setBackgroundGray:\ {{\NeXTHelpLink6489 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setHighlightBackgroundColor:\ {{\NeXTHelpLink6523 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundGray:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setHighlightBackgroundGray:\ {{\NeXTHelpLink6556 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setHighlightTextColor:\ {{\NeXTHelpLink6584 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightTextGray:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setHighlightTextGray:\ {{\NeXTHelpLink6611 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setTextColor:\ {{\NeXTHelpLink6630 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTextGray:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setTextGray:\ {{\NeXTHelpLink6648 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± textColor\ {{\NeXTHelpLink6663 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textGray;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± textGray\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Selected {{\NeXTHelpLink6686 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername isSelected;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± isSelected\ {{\NeXTHelpLink6702 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setSelected;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setSelected:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Setting and querying owner {{\NeXTHelpLink6747 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername owner;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± owner\ {{\NeXTHelpLink6758 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwner:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwner:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Colors and owner inheritence {{\NeXTHelpLink6802 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerBackgroundColor:\ {{\NeXTHelpLink6832 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerFont:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerFont:\ {{\NeXTHelpLink6851 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerHighlightBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerHighlightBackgroundColor:\ {{\NeXTHelpLink6890 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerHighlightTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerHighlightTextColor:\ {{\NeXTHelpLink6923 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setOwnerTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setOwnerTextColor:\ {{\NeXTHelpLink6947 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setUseOwnerBackgroundColor:\ {{\NeXTHelpLink6980 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerFont:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setUseOwnerFont:\ {{\NeXTHelpLink7002 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setUseOwnerHighlightBackgroundColor:\ {{\NeXTHelpLink7044 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setUseOwnerHighlightTextColor:\ {{\NeXTHelpLink7080 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerTextColor:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± setUseOwnerTextColor:\ {{\NeXTHelpLink7107 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername useOwnerBackgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± useOwnerBackgroundColor\ {{\NeXTHelpLink7136 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername useOwnerFont;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± useOwnerFont\ {{\NeXTHelpLink7154 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername useOwnerHighlightBackgroundColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± useOwnerHighlightBackgroundColor\ {{\NeXTHelpLink7192 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername useOwnerHighlightTextColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± useOwnerHighlightTextColor\ {{\NeXTHelpLink7224 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername useOwnerTextColor;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± useOwnerTextColor\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Archiving {{\NeXTHelpLink7257 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername read:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± read:\ {{\NeXTHelpLink7268 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername write:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± write:\ \f2\b\fs16\fi0\li1360\fc0\cf0 \ \f0\b0\fs28\fi-4040\li6140\fc1\cf1 Extensible conditional allocations {{\NeXTHelpLink7315 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1BackgroundColorLen;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1BackgroundColorLen\ {{\NeXTHelpLink7342 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1BackgroundColorPos;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1BackgroundColorPos\ {{\NeXTHelpLink7369 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1BackgroundColorPtr;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1BackgroundColorPtr\ {{\NeXTHelpLink7396 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1DataSize;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1DataSize\ {{\NeXTHelpLink7413 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1DeleteDataPos:len:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1DeleteDataPos:len:\ {{\NeXTHelpLink7440 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1DestroyData;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1DestroyData\ {{\NeXTHelpLink7460 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1Flags;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1Flags\ {{\NeXTHelpLink7474 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightBackgroundColorLen;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightBackgroundColorLen\ {{\NeXTHelpLink7510 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightBackgroundColorPos;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightBackgroundColorPos\ {{\NeXTHelpLink7546 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightBackgroundColorPtr;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightBackgroundColorPtr\ {{\NeXTHelpLink7582 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightTextColorLen;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightTextColorLen\ {{\NeXTHelpLink7612 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightTextColorPos;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightTextColorPos\ {{\NeXTHelpLink7642 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1HighlightTextColorPtr;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1HighlightTextColorPtr\ {{\NeXTHelpLink7672 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1InsertData:pos:len:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1InsertData:pos:len:\ {{\NeXTHelpLink7700 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1TextColorLen;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1TextColorLen\ {{\NeXTHelpLink7721 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1TextColorPos;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1TextColorPos\ {{\NeXTHelpLink7742 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername tc1TextColorPtr;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± tc1TextColorPtr\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \ \ \fs36 Class Methods\ \fs16 \ {\fs28\fi-380\li2480{\NeXTHelpMarker7782 \markername defaultBackgroundColor;} ¬}\f2\b\i0\ulnone\ql\fs28\fi-380\li2480\gray0\fc0\cf0\up0\dn0 defaultBackgroundColor\ \f0\b0\fi-760\li3240 + (NXColor) \b defaultBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORLTGRAY \f0\fs28\fc0\cf0 as the default background color. This is the color which is returned by {\b{\NeXTHelpLink7937 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a {\b{\NeXTHelpLink8140 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -setUseOwnerBackgroundColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink8265 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink8286 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultHighlightBackgroundColor \b0 , {\b{\NeXTHelpLink8323 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightTextColor \b0 , {\b{\NeXTHelpLink8354 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultTextColor \b0 , {\b{\NeXTHelpLink8376 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setBackgroundColor: \b0 , {\b{\NeXTHelpLink8401 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± \fc1\cf1 €setUseOwnerBackgroundColor \f0\fc0\cf0 : \b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker8437 \markername defaultFont;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 defaultFont\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + \b defaultFont \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the user-font at point-size 12.0 as the default font. This is the font which is used when initializing the cell as a text cell with {\b{\NeXTHelpLink8606 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initTextCell:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 ± \f3\b0\fs24\fc1\cf1 initTextCell: \f0\fs28\fc0\cf0 . Subclasses should override this method if this value is inappropriate.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink8707 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername font;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± font \b0 , {\b{\NeXTHelpLink8717 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initTextCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initTextCell: \b0 , {\b{\NeXTHelpLink8736 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setFont:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setFont: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker8753 \markername defaultHighlightBackgroundColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 defaultHighlightBackgroundColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultHighlightBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORWHITE \f0\fs28\fc0\cf0 as the default highlighted background color. This is the color which is returned by {\b{\NeXTHelpLink8937 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightBackgroundColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -highlightBackgroundColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a {\b{\NeXTHelpLink9158 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -setUseOwnerHighlightBackgroundColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink9292 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultBackgroundColor \b0 , {\b{\NeXTHelpLink9320 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightTextColor \b0 , {\b{\NeXTHelpLink9351 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultTextColor \b0 , {\b{\NeXTHelpLink9373 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightBackgroundColor \b0 , {\b{\NeXTHelpLink9403 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setHighlightBackgroundColor: \b0 , {\b{\NeXTHelpLink9437 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± \fc1\cf1 €setUseOwnerHighlightBackgroundColor \f0\fc0\cf0 : \b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker9482 \markername defaultHighlightTextColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 defaultHighlightTextColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultHighlightTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORBLACK \f0\fs28\fc0\cf0 as the default highlighted text color. This is the color which is returned by {\b{\NeXTHelpLink9648 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightTextColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -highlightTextColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a {\b{\NeXTHelpLink9857 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -setUseOwnerHighlightTextColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink9985 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultBackgroundColor \b0 , {\b{\NeXTHelpLink10013 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightBackgroundColor \b0 , {\b{\NeXTHelpLink10050 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultTextColor \b0 , {{\NeXTHelpLink10072 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b0\i0\ulnone\fs28\li2100\fc0\cf0 €±€ \b highlightTextColor \b0 , {\b{\NeXTHelpLink10096 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setHighlightBackgroundColor: \b0 , {\b{\NeXTHelpLink10130 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± \fc1\cf1 €setUseOwnerHighlightBackgroundColor \f0\fc0\cf0 : \b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker10175 \markername defaultTextColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 defaultTextColor\ \pard\f0\b0\fi-760\li3240\fc0\cf0 + (NXColor) \b defaultTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \f3\fs24\fc1\cf1 NX_COLORBLACK \f0\fs28\fc0\cf0 as the default text color. This is the color which is returned by {\b{\NeXTHelpLink10311 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -textColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -textColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a {\b{\NeXTHelpLink10502 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -setUseOwnerTextColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink10621 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultBackgroundColor \b0 , {\b{\NeXTHelpLink10649 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightBackgroundColor \b0 , {\b{\NeXTHelpLink10686 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightTextColor \b0 , {\b{\NeXTHelpLink10717 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setHighlightBackgroundColor: \b0 , {\b{\NeXTHelpLink10751 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± \fc1\cf1 €setUseOwnerHighlightBackgroundColor \f0\fc0\cf0 : \b0 , {\b{\NeXTHelpLink10793 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textColor \b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs36\li1360\fc0\cf0 Instance Methods\ \fs16 \ {\fs28\fi-380\li2480{\NeXTHelpMarker10829 \markername backgroundColor;} ¬}\f2\b\i0\ulnone\ql\fs28\fi-380\li2480\gray0\fc0\cf0\up0\dn0 backgroundColor\ \f1\b0\fi-760\li3240 - \f0 (NXColor) \b backgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the color that is used to draw the background of the cell in its normal (unhighlighted) state. This is the color which has been set with {\b{\NeXTHelpLink11021 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 ± \f3\b0\fs24\fc1\cf1 setBackgroundColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b ± \f3\b0\fs24\fc1\cf1 backgroundColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from {\b{\NeXTHelpLink11229 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 is returned.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink11279 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundGray \b0 , {\b{\NeXTHelpLink11299 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultBackgroundColor \b0 , {\b{\NeXTHelpLink11327 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundColor \b0 , {\b{\NeXTHelpLink11357 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightTextColor \b0 , {\b{\NeXTHelpLink11381 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setBackgroundColor: \b0 , {\b{\NeXTHelpLink11406 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker11424 \markername backgroundGray;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 backgroundGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b backgroundGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the gray value from by \f3\fs24\fc1\cf1 NXConvertColorToGray() \f0\fs28\fc0\cf0 given the color returned by {\b{\NeXTHelpLink11548 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink11579 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink11600 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundGray \b0 , {\b{\NeXTHelpLink11629 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightTextGray \b0 , {\b{\NeXTHelpLink11652 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setBackgroundGray:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€setBackgroundGray: \b0 , {\b{\NeXTHelpLink11676 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textGray \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker11693 \markername bgColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 bgColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b bgColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is used by cells that draw themselves rather than letting the owner draw them. It returns the color that is used to fill the background of the cell during drawing. If the cell {\b{\NeXTHelpLink11913 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername isSelected;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -isSelected \f0\fs28\fc0\cf0 , then this method returns the value from {\b{\NeXTHelpLink11967 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightBackgroundColor \f0\fs28\fc0\cf0 , otherwise it returns the value from {\b{\NeXTHelpLink12032 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 . Subclasses should override this method if they have different criteria for determining the cell's background color during drawing.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink12195 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink12216 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername fgColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± fgColor \b0 , {\b{\NeXTHelpLink12229 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker12262 \markername copy;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 copyFromZone:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b copyFromZone: \b0 (NXZone*) \i zone \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Allocates, initializes, and returns a copy of the receiving cell. The copy is allocated from \i zone \i0 and is assigned the same contents as the receiver.\ \fs16 \ \f2\b\fs28 See also: ± copyFromZone: \f0\b0\fc1\cf1 (Cell) \f2\fc0\cf0 , {\b{\NeXTHelpLink12498 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername free;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± free \b0 , {\b{\NeXTHelpLink12508 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initIconCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initIconCell: \b0 , {\b{\NeXTHelpLink12527 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initTextCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initTextCell: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker12549 \markername drawInside:inView:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 drawInside:inView:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawInside: \b0 (NXRect const*) \i cellFrame \i0 \ \b\fi0 inView: \b0\i controlView \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Draws the inside of the cell, but not the border, in \i cellFrame \i0 within \i controlView \i0 . \i cellFrame \i0 should be the same rectangle passed to {{\NeXTHelpLink12766 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawSelf:inView:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -drawSelf:inView: \f0\fs28\fc0\cf0 . The PostScript focus must be locked on \i controlView \i0 when this message is sent. Returnse \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: \f1\b0 - \f0 \b drawInside:inView: \b0 (Cell), {\f1{\NeXTHelpLink12922 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawSelf:inView:;} ¬}\pard\tx2480\tx2860\tx3240\f1\b0\i0\ulnone\fs28\li2100\fc0\cf0 - \f0 \b drawSelf:inView: \b0 , \f1 - \f0 \b lockFocus \b0 (View) \fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker12967 \markername drawSelf:inView:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 drawSelf:inView:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b drawSelf: \b0 (NXRect const*) \i cellFrame \i0 \ \b\fi0 inView: \b0\i controlView \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Displays the cell in \i cellFrame \i0 within \i controlView \i0 . The PostScript focus must be locked on \i controlView \i0 when this message is sent. Draws the border of the cell, then invokes {{\NeXTHelpLink13221 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawInside:inView:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i0\ulnone\fs28\li2100\fc0\cf0 ± \f3\fs24\fc1\cf1 drawInside:inView: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \fs14 \ \f2\b\fs28 See also: {\f1\b0{\NeXTHelpLink13270 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername drawInside:inView:;} ¬}\pard\tx2480\tx2860\tx3240\f1\b0\i0\ulnone\fs28\li2100\fc0\cf0 - \f0 \b drawInside:inView: \b0 , ± \b drawSelf:inView: \b0 \fc1\cf1 (Cell) \fc0\cf0 , \f1 - \f0 \b lockFocus \b0 (View)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker13344 \markername fgColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 fgColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b fgColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is used by cells that draw themselves rather than letting the owner draw them. It returns the color that is used for the text in the cell during drawing. If the cell {\b{\NeXTHelpLink13554 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername isSelected;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -isSelected \f0\fs28\fc0\cf0 , then this method returns the value from {\b{\NeXTHelpLink13608 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightTextColor \f0\fs28\fc0\cf0 , otherwise it returns the value from {\b{\NeXTHelpLink13666 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -textColor \f0\fs28\fc0\cf0 . Subclasses should override this method if they have different criteria for determining the cell's text color during drawing.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink13817 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername bgColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± bgColor \b0 , {\b{\NeXTHelpLink13830 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightTextColor \b0 , {\b{\NeXTHelpLink13854 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker13872 \markername font;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 font\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b font \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the Font used to display text in the cell. Returns \b nil \b0 if the receiver isn't a text cell.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink14002 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultFont;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultFont \b0 , {\b{\NeXTHelpLink14019 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setFont:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setFont: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker14036 \markername free;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 free\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b free \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Frees the memory used by the cell and returns \b nil \b0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink14118 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername copyFromZone:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± copyFromZone: \b0 , {\b{\NeXTHelpLink14137 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initIconCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initIconCell: \b0 , {\b{\NeXTHelpLink14156 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initTextCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initTextCell: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker14178 \markername highlightBackgroundColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 highlightBackgroundColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b highlightBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the color that is used to draw the background of the cell in its highlighted state. This is the color which has been set with {\b{\NeXTHelpLink14377 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 ± \f3\b0\fs24\fc1\cf1 setHighlightBackgroundColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b ± \f3\b0\fs24\fc1\cf1 highlightBackgroundColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from {\b{\NeXTHelpLink14603 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 +defaultHighlightBackgroundColor \f0\fs28\fc0\cf0 is returned.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink14662 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink14683 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightBackgroundColor \b0 , {\b{\NeXTHelpLink14720 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightTextColor \b0 , {\b{\NeXTHelpLink14744 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightBackgroundGray \b0 , {\b{\NeXTHelpLink14773 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setHighlightBackgroundColor: \b0 , {\b{\NeXTHelpLink14807 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± textColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker14825 \markername highlightBackgroundGray;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 highlightBackgroundGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b highlightBackgroundGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the gray value from by \f3\fs24\fc1\cf1 NXConvertColorToGray() \f0\fs28\fc0\cf0 given the color returned by {\b{\NeXTHelpLink14967 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightBackgroundColor \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink15007 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundGray \b0 , {\b{\NeXTHelpLink15027 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundColor \b0 , {\b{\NeXTHelpLink15057 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightTextGray \b0 , {\b{\NeXTHelpLink15080 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightBackgroundGray:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€setHighlightBackgroundGray: \b0 , {\b{\NeXTHelpLink15113 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textGray \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker15130 \markername highlightTextColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 highlightTextColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b highlightTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the color that is used to draw the text in the cell in its highlighted state. This is the color which has been set with {\b{\NeXTHelpLink15311 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 ±setHighlightTextColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b ± \f3\b0\fs24\fc1\cf1 highlightTextColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from {\b{\NeXTHelpLink15525 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 +defaultHighlightTextColor \f0\fs28\fc0\cf0 is returned.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink15578 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink15599 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultHighlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 € \b0 + \b €defaultHighlightTextColor \b0 , {\b{\NeXTHelpLink15630 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightBackgroundColor \b0 , {\b{\NeXTHelpLink15660 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightTextGray \b0 , {\b{\NeXTHelpLink15683 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setHighlightTextColor: \b0 , {\b{\NeXTHelpLink15711 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €± textColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker15729 \markername highlightTextGray;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 highlightTextGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b highlightTextGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the gray value from by \f3\fs24\fc1\cf1 NXConvertColorToGray() \f0\fs28\fc0\cf0 given the color returned by {\b{\NeXTHelpLink15859 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -highlightTextColor \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink15893 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundGray \b0 , {\b{\NeXTHelpLink15913 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundGray \b0 , {\b{\NeXTHelpLink15942 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightTextColor \b0 , {\b{\NeXTHelpLink15966 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setHighlightTextGray:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€setHighlightTextGray: \b0 , {\b{\NeXTHelpLink15993 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textGray \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16010 \markername image;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 image\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b image \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to an NXImage object if the cell is an icon cell, otherwise returns 0.\ \fs16 \ \f2\b\fs28 See also: ± icon \f0\b0\fc1\cf1 (Cell) \f2\fc0\cf0 , {\b{\NeXTHelpLink16147 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initIconCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initIconCell: \b0 , \b ± setIcon: \f0\b0\fc1\cf1 (Cell) \f2\fc0\cf0 , {\b{\NeXTHelpLink16185 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setImage:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setImage: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16203 \markername initIconCell:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 initIconCell:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b initIconCell: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Prepare a newly allocated cell that will display an icon. \i S \i0 is the name of the image. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16360 \markername initTextCell:;} ¬}{\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0{\NeXTHelpMarker16361 \markername initTextCell:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 initTextCell:\ \f1\b0 - \f0 (id) \b initTextCell: \b0 (char const*) \i s \i0 \ \fs16 \ \pard\tx2480\tx2860\tx3240\fs28\li2100\fc0\cf0 Prepare a newly allocated cell that will display text. The font and colors will use inherited or default values until explicitly set. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 isOpaque\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isOpaque \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns NO if the cell uses the {{\NeXTHelpLink16626 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername Owner_discussion;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i0\ulnone\fs28\li2100\fc0\cf0 owner's background color, or YES if it does not.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16680 \markername isSelected;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 isSelected\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b isSelected \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell is selected, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16768 \markername owner;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 owner\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b owner \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the \i owner \i0 of the cell, or 0 if there is none.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16847 \markername ownerDraw;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 ownerDraw\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b ownerDraw \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the owner should perform the actual drawing for this cell, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker16970 \markername read:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 read:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b read: \b0 (NXTypedStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Unarchives a cell from \i stream \i0 , that was archived with \f3\fs24\fc1\cf1 -write: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: -write: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker17115 \markername setBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setBackgroundColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the color that the cell will use to fill its background. This color will override any inherited value. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker17302 \markername setBackgroundGray:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setBackgroundGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setBackgroundGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The gray value is converted to a color value which is passed to \f3\fs24\fc1\cf1 -setBackgroundColor: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker17466 \markername setFont:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setFont:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setFont: \b0 (id) \i font \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the font of a text cell to \i font \i0 . This will override any inherited value. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker17599 \markername setHighlightBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setHighlightBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightBackgroundColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the color that will be used to fill the background of a text cell when the cell is highlighted. This will override any inherited value. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker17837 \markername setHighlightBackgroundGray:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setHighlightBackgroundGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightBackgroundGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The gray value is converted to a color value which is passed to \f3\fs24\fc1\cf1 -setHighlightBackgroundColor: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18028 \markername setHighlightTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setHighlightTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightTextColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the color that will be used to draw the text of a text cell. This will override any inherited value. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18219 \markername setHighlightTextGray:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setHighlightTextGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setHighlightTextGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 The gray value is converted to a color value which is passed to \f3\fs24\fc1\cf1 -setHighlightTextColor: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18392 \markername setImage:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setImage:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setImage: \b0 (id) \i image \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the image that will be displayed in an icon cell. Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: ± icon \f0\b0\fc1\cf1 (Cell) \f2\fc0\cf0 , {\b{\NeXTHelpLink18527 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername image;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± image \b0 , {\b{\NeXTHelpLink18538 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername initIconCell:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initIconCell: \b0 , \b ± setIcon: \f0\b0\fc1\cf1 (Cell) \fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18579 \markername setOwner:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwner:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwner: \b0 (id) \i obj \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the \i owner \i0 of the cell to \i obj \i0 . The cell will inherit font and color values from \i obj \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18724 \markername setOwnerDraw;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerDraw:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerDraw: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets a flag indicating whether or not the owner should perform the drawing for this object. The default value for MiscTableCell objects is YES. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker18935 \markername setOwnerBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerBackgroundColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the cell that the owner's \i backgroundColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setBackgroundColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker19465 \markername setOwnerFont:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerFont:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerFont: \b0 (id) \i font \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the cell that the owner's font value has changed to \i font \i0 . If the cell is using the font value inherited from its \i owner \i0 , it will change its font in response to this message. Otherwise, it will ignore the message. The MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 message when the table distributes fonts to the cells, so that cells can distinguish between cell-specific font assignments and global font assignments. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker19996 \markername setOwnerHighlightBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerHighlightBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerHighlightBackgroundColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the cell that the owner's \i highlightBackgroundColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setHighlightBackgroundColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker20562 \markername setOwnerHighlightTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerHighlightTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerHighlightTextColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the cell that the owner's \i highlightTextColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setHighlightTextColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker21104 \markername setOwnerTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setOwnerTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setOwnerTextColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Informs the cell that the owner's \i textColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\pard\tx7140\fs28\fi-380\li2480\fc0\cf0{\NeXTHelpMarker21610 \markername setSelected;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setSelected:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setSelected: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell's selected status to \i flag \i0 . Selected cells draw with the highlighted colors. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker21764 \markername setTag:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setTag:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTag: \b0 (int) \i x \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sets the cell's \b tag \b0 value to x. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker21846 \markername setTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTextColor: \b0 (NXColor) \i c \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Causes the cell to render its text with the color, \i c \i0 . This overrides any \i textColor \i0 value inherited from the \i owner \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker22028 \markername setTextGray:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setTextGray:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setTextGray: \b0 (float) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \i\fs28 Value \i0 is converted to a color value which is passed to \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker22165 \markername setUseOwnerBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setUseOwnerBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setUseOwnerBackgroundColor: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i flag \i0 is YES, the cell will discard any \i backgroundColor \i0 value that it is currently storing, and begin using the backgroundColor value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i backgroundColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 method. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker22731 \markername setUseOwnerFont:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setUseOwnerFont:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setUseOwnerFont: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i flag \i0 is YES, the cell will use the \i font \i0 value inherited from its \i owner \i0 . If \i flag \i0 is NO, the cell will continue using its current font, or fonts set via the \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 message rather than the font inherited from the owner. This method also updates the \f3\fs24\fc1\cf1 MISC_TC1_SELF_FONT \f0\fs28\fc0\cf0 bit of the \i tc1_flags \i0 bit mask. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker23107 \markername setUseOwnerHighlightBackgroundColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setUseOwnerHighlightBackgroundColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setUseOwnerHighlightBackgroundColor: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i flag \i0 is YES, the cell will discard any \i highlightBackgroundColor \i0 value that it is currently storing, and begin using the highlightBackgroundColor value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -highlightBackgroundColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultHighlightBackgroundColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i highlightBackgroundColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultHighlightBackgroundColor \f0\fs28\fc0\cf0 method. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker23745 \markername setUseOwnerHighlightTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setUseOwnerHighlightTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setUseOwnerHighlightTextColor: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i flag \i0 is YES, the cell will discard any \i highlightTextColor \i0 value that it is currently storing, and begin using the highlightColor value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -highlightTextColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultHighlightTextColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i highlightTextColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultHighlightTextColor \f0\fs28\fc0\cf0 method. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker24331 \markername setUseOwnerTextColor:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 setUseOwnerTextColor:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b setUseOwnerTextColor: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 If \i flag \i0 is YES, the cell will discard any \i textColor \i0 value that it is currently storing, and begin using the \b\i textColor \b0\i0 value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -textColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i textColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 method. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker24849 \markername tag;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc1\cf1 tableScroll:retireAt:: \fc0\cf0 \ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 retireAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 MiscTableCell's implementation of the MiscTableScroll call-back method. This method is called whenever the cell is removed from active use by the MiscTableScroll as the result of any of the methods that reduce the number of active rows (ex: \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -empty \f0\fs28\fc0\cf0 , etc.). The current implementation clears the string value of text cells. Unfortunately, since the overhead of performing these reset operations is quite high, the behavior of this method might change in the future. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker25445 \markername tag;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc1\cf1 tableScroll:reviveAt: \fc0\cf0 \ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 reviveAt: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 : \b0\fc1\cf1 (int) \i col \i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 MiscTableCell's implementation of the MiscTableScroll call-back method. This method is called whenever the cell is brought into active use by the MiscTableScroll as the result of any of the methods that expand the number of active rows (ex: \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -addRow \f0\fs28\fc0\cf0 , etc.). This method sets \i scroll \i0 as the \i owner \i0 of the cell, then ensures that all attributes are set to the \i use-owner \i0 values. Unfortunately, since the overhead of performing these initializations is quite high, the behavior of this method might change in the future. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26090 \markername tag;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tag\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b tag \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the cell's \b tag \b0 value.\ \fs16 \ \f2\b\fs28 See also: \b0 {\b{\NeXTHelpLink26150 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTag:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setTag: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26166 \markername tc1BackgroundColorLen;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1BackgroundColorLen\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1BackgroundColorLen \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the length of the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NXColor).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26356 \markername tc1BackgroundColorPos;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1BackgroundColorPos\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1BackgroundColorPos \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current offset of the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26587 \markername tc1BackgroundColorPtr;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1BackgroundColorPtr\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor*) \b tc1BackgroundColorPtr \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerBackgroundColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26810 \markername tc1DataSize;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1DataSize\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1DataSize \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current total size of the variable-length \i tc1_data \i0 field. This value changes as optional values are added and removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker26989 \markername tc1DeleteDataPos:len:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1DeleteDataPos:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tc1DeleteDataPos: \b0 (unsigned int) \i pos \i0 \ \b\fi0 len: \b0 (unsigned int) \i len \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Deletes \i len \i0 bytes at offset \i pos \i0 from the variable-length \i tc1_data \i0 field. All following data is shifted down by \i len \i0 bytes. This method is called internally whenever an optional value no longer needs to be stored because the inherited value from the owner is going to be used.\ \fs16 \ \f2\b\fs28 See also: -tc1InsertData:pos:len: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker27396 \markername tc1DestroyData;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1DestroyData\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tc1DestroyData \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 This method is provided as a hook for subclasses that need to perform special actions (destructors) before the variable-length \i tc1_data \i0 field is freed. The MiscTableCell implementation of this class clears the \i tc1_flags \i0 bit mask to zero.\ \fs16 \ \f2\b\fs28 See also: -tc1FreeData \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker27705 \markername tc1Flags;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1Flags\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1Flags \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current value of the \i tc1_flags \i0 field. This is a bit-mask indicating which optional values are currently stored in the variable-length \i tc1_data \i0 field. The flags also indicate whether or not the corresponding values inherited from the owner are used, since any value that has been set (and stored) in the cell overrides the inherited value. The values of the individual bits are declared in \f3\fs24\fc1\cf1 MiscTableCell.h \f0\fs28\fc0\cf0 as follows:\ \ {\pard\tx8760\f3\fs24\li2880\fc1\cf1{\NeXTHelpMarker28175 \markername tc1_flags;} ¬}\pard\tx8760\f3\b0\i0\ulnone\fs24\li2880\fc1\cf1 #define MISC_TC1_HAS_TAG (1 << 0) /* obsolete */\ #define MISC_TC1_SELF_FONT (1 << 1)\ #define MISC_TC1_SELF_TEXT_COLOR (1 << 2)\ #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3)\ #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4)\ #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5)\ #define MISC_TC1_IS_SELECTED (1 << 6)\ #define MISC_TC1_SELF_DRAW (1 << 7) /* !ownerDraw */\ #define MISC_TC1_LAST_BIT (1 << 7)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker28577 \markername tc1DestroyData;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1FreeData\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b tc1FreeData \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Frees the variable-length \i tc1_data \i0 variable. This method is invoked from within the \f3\fs24\fc1\cf1 -free \f0\fs28\fc0\cf0 method, and also within the \f3\fs24\fc1\cf1 -read: \f0\fs28\fc0\cf0 method.\ \fs16 \ \f2\b\fs28 See also: -tc1DestroyData \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker28778 \markername tc1HighlightBackgroundColorLen;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightBackgroundColorLen\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1HighlightBackgroundColorLen \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the length of the \i highlightBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NXColor).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker28995 \markername tc1HighlightBackgroundColorPos;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightBackgroundColorPos\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1HighlightBackgroundColorPos \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current offset of the \i highlightBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker29253 \markername tc1HighlightBackgroundColorPtr;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightBackgroundColorPtr\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor*) \b tc1HighlightBackgroundColorPtr \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the \i highlightBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerHighlightBackgroundColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker29512 \markername tc1HighlightTextColorLen;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightTextColorLen\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1HighlightTextColorLen \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the length of the \i highlightTextColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NXColor).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker29711 \markername tc1HighlightTextColorPos;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightTextColorPos\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1HighlightTextColorPos \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current offset of the \i highlightTextColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker29951 \markername tc1HighlightTextColorPtr;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1HighlightTextColorPtr\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor*) \b tc1HighlightTextColorPtr \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the \i highlightTextColor \i0 value in the variable-length \i tc1_data \i0 field. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerHighlightTextColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker30186 \markername tc1InsertData:pos:len:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1InsertData:pos:len:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void*) \b tc1InsertData: \b0 (void const*) \i data \i0 \ \b\fi0 pos: \b0 (unsigned int) \i pos \i0 \ \b len: \b0 (unsigned int) \i len \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inserts \i data \i0 at offset \i pos \i0 in the variable-length \i tc1_data \i0 field, shifting all following data by \i len \i0 bytes. This method is used internally to allocate the storage for optional values that do not already have storage allocated.\ \fs16 \ \f2\b\fs28 See also: -tc1DeleteDataPos:len: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker30564 \markername tc1TextColorLen;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1TextColorLen\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1TextColorLen \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the length of the \i textColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NXColor).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker30736 \markername tc1TextColorPos;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1TextColorPos\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b tc1TextColorPos \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the current offset of the \i textColor \i0 value in the variable-length \i tc1_data \i0 field. This offset changes as other values are set or cleared.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker30937 \markername tc1TextColorPtr;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 tc1TextColorPtr\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor*) \b tc1TextColorPtr \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the location of the \i textColor \i0 value stored in the variable-length \i tc1_data \i0 field. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerTextColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker31159 \markername textColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 textColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (NXColor) \b textColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the color that is used to draw the text in the cell in its normal (unhighlighted) state. This is the color which has been set with {\b{\NeXTHelpLink31333 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 ± \f3\b0\fs24\fc1\cf1 setTextColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \f3\fs24\fc1\cf1 ±textColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from {\b{\NeXTHelpLink31529 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 is returned.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink31573 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundColor \b0 , {\b{\NeXTHelpLink31593 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername defaultTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 \b0 + \b defaultTextColor \b0 , {\b{\NeXTHelpLink31615 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundColor \b0 , {\b{\NeXTHelpLink31645 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€highlightTextColor \b0 , {\b{\NeXTHelpLink31669 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTextColor:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± setTextColor: \b0 , {\b{\NeXTHelpLink31688 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textGray \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker31705 \markername textGray;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 textGray\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (float) \b textGray \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the gray value from by \f3\fs24\fc1\cf1 NXConvertColorToGray() \f0\fs28\fc0\cf0 given the color returned by {\b{\NeXTHelpLink31817 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -textColor \f0\fs28\fc0\cf0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink31842 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername backgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± backgroundGray \b0 , {\b{\NeXTHelpLink31862 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightBackgroundGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightBackgroundGray \b0 , {\b{\NeXTHelpLink31891 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername highlightTextGray;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± highlightTextGray \b0 , {\b{\NeXTHelpLink31914 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername setTextGray:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 €±€setTextGray: \b0 , {\b{\NeXTHelpLink31932 \markername ;\linkFilename MiscTableCell.rtf;\linkMarkername textColor;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± textColor \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker31950 \markername useOwnerBackgroundColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 useOwnerBackgroundColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b useOwnerBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell uses the \i backgroundColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -setBackgroundColor:, -setUseOwnerBackgroundColor: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker32165 \markername useOwnerFont;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 useOwnerFont\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b useOwnerFont \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell uses the \i font \i0 inherited from its \i owner \i0 , otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -setFont:, -setUseOwnerFont: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker32325 \markername useOwnerHighlightBackgroundColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 useOwnerHighlightBackgroundColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b useOwnerHighlightBackgroundColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell uses the \i highlightBackgroundColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -setHighlightBackgroundColor:, -setUseOwnerHighlightBackgroundColor: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker32585 \markername useOwnerHighlightTextColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 useOwnerHighlightTextColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b useOwnerHighlightTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell uses the \i highlightTextColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -setHighlightTextColor:, -setUseOwnerHighlightTextColor: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker32815 \markername useOwnerTextColor;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 useOwnerTextColor\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (BOOL) \b useOwnerTextColor \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns YES if the cell uses the \i textColor \i0 value inherited from its \i owner \i0 , otherwise NO.\ \fs16 \ \f2\b\fs28 See also: -setTextColor:, -setUseOwnerTextColor: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker33006 \markername write:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 write:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b write: \b0 (NXTypedStream*) \i stream \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Archives the cell on \i stream \i0 so that it can be unarchived with \f3\fs24\fc1\cf1 -read: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: -read: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs36\li1360\fc0\cf0 Constants and Defined Types\ \fs16 \ {\pard\tx7920\f3\b0\fs24\li2100\fc1\cf1{\NeXTHelpMarker33188 \markername tc1_flags;} ¬}\pard\tx7920\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 #define MISC_TC1_HAS_TAG (1 << 0) /* obsolete */\ #define MISC_TC1_SELF_FONT (1 << 1)\ #define MISC_TC1_SELF_TEXT_COLOR (1 << 2)\ #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3)\ #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4)\ #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5)\ #define MISC_TC1_IS_SELECTED (1 << 6)\ #define MISC_TC1_SELF_DRAW (1 << 7) /* !ownerDraw */\ #define MISC_TC1_LAST_BIT (1 << 7)\ } MiscKit/Documentation/Classes/MiscIntList.rtf100444 1750 1750 67141 6757716171 21611 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh10540 \margl120 \margr0 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 Version 1.0, Copyright \f1 ã \f0 1995,1996,1997 by Paul S. McCarthy and Eric Sunshine. All Rights Reserved.\ Paul S. McCarthy and Eric Sunshine -- July 1, 1997\ \pard\tx2480\tx2860\tx3240\fs28\li2100\fc0\cf0 \ \fs16 \ \pard\f2\b\fs56\li2100\fc0\cf0 MiscIntList\ \pard\tx4880\f0\b0\fs16\fi-2780\li4880\fc0\cf0 \ \ \ \ \f2\b\fs28 Inherits From: \f0\b0 Object\ \fs16 \ \f2\b\fs28 Declared In: \f0\b0 MiscIntList.h\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Class Description\ \fs16 \ \pard\tx2480\tx2860\tx3240\f0\b0\fs28\li2100\fc0\cf0 The MiscIntList class provides a simple interface to an array of integers. The class provides methods for searching and sorting the array as well as general list maintenance. Methods are provided for conversion to and from a string representation of the numbers contained in the list.\ \fs14 \ \fs28 This class is used by {{\NeXTHelpLink555 \markername ;\linkFilename MiscTableScroll.rtf;\linkMarkername ;} ¬}\pard\tx2480\tx2860\tx3240\f0\b0\i0\ulnone\fs28\li2100\fc0\cf0 MiscTableScroll as a means to communicate lists of integers with the client. The string conversion methods provide a simple interface for generating data suitable for storage by the NeXT defaults system. For instance, to store the user's column ordering preference in NeXT defaults, the client could ask MiscTableScroll to fill an \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 instance of \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 MiscIntList with the current ordering, convert that to a string representation, and then save it to NeXT defaults.\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Instance Variables\ \fs16 \ \pard\tx2860\f0\b0\fs28\li2100\fc0\cf0 Storage* \b array \b0 ;\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \ \ \fs28 array The storage for the list of integers.\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \ \fs36 Method Types\ \fs16 \ \pard\tx6140\tx9660\tx10180\f0\b0\fs28\fi-4040\li6140\fc1\cf1 Initializing and freeing {{\NeXTHelpLink1149 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername init;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± init\ {{\NeXTHelpLink1159 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername initFromString:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± initFromString:\ {{\NeXTHelpLink1180 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername free;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± free\ {{\NeXTHelpLink1190 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername copyFromZone:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± copyFromZone:\ \fs10\fc0\cf0 \ \fs28\fc1\cf1 Querying and emptying {{\NeXTHelpLink1231 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername count;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± count\ {{\NeXTHelpLink1242 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername empty;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± empty\ \fc0\cf0 \ \fc1\cf1 Manipulating by index {{\NeXTHelpLink1275 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername intAt:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± intAt:\ {{\NeXTHelpLink1287 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± addInt:\ {{\NeXTHelpLink1300 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addIntList:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± addIntList:\ {{\NeXTHelpLink1317 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername insertInt:at:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± insertInt:at:\ {{\NeXTHelpLink1336 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername removeIntAt:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± removeIntAt:\ {{\NeXTHelpLink1354 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername replaceIntAt:with:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± replaceIntAt:with:\ \fs10\fc0\cf0 \ \fs28\fc1\cf1 Searching {{\NeXTHelpLink1388 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername bsearch:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± bsearch:\ {{\NeXTHelpLink1402 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername bsearch:using:data:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± bsearch:using:data:\ {{\NeXTHelpLink1427 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername lsearch:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± lsearch:\ {{\NeXTHelpLink1441 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername lsearch:using:data:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± lsearch:using:data:\ \fs10\fc0\cf0 \ \fs28\fc1\cf1 Sorting {{\NeXTHelpLink1474 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername sort;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± sort\ {{\NeXTHelpLink1484 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername sortUsing:data:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± sortUsing:data:\ \fs10\fc0\cf0 \ \fs28\fc1\cf1 String conversions {{\NeXTHelpLink1524 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± readFromString:\ {{\NeXTHelpLink1545 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± writeToString\ {{\NeXTHelpLink1564 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± writeToString:size:\ {{\NeXTHelpLink1589 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:canExpand:;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± writeToString:size:canExpand:\ \fs10\fc0\cf0 \ \fs28\fc1\cf1 Low±level access {{\NeXTHelpLink1641 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername rawData;} ¬}\pard\tx6140\tx9660\tx10180\f0\b0\i0\ulnone\fs28\fi-4040\li6140\fc1\cf1 ± rawData\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \ \ \fs36 Instance Methods\ \fs16 \ {\fs28\fi-380\li2480{\NeXTHelpMarker1676 \markername addInt:;} ¬}\f2\b\i0\ulnone\ql\fs28\fi-380\li2480\gray0\fc0\cf0\up0\dn0 addInt:\ \f1\b0\fi-760\li3240 - \f0 (void) \b addInt: \b0 (int) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Appends \i value \i0 to the list. Equivalent to: \f3\fs24\fc1\cf1 -insertInt: \i value \i0 at:[self count] \f0\fs28 . \fc0\cf0 \ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink1802 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addIntList:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± addIntList: \b0 , {\b{\NeXTHelpLink1819 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername insertInt:at:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± insertIntAt: \b0 , \b {{\NeXTHelpLink1837 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername removeIntAt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ±removeIntAt: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\pard\fs28\fi-380\li2480\fc0\cf0{\NeXTHelpMarker1857 \markername addIntList:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 addIntList:\ \f1\b0\fi-760\li3240 - \f0 (void) \b addIntList: \b0 (MiscIntList*) \i list \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Appends the contents of \i list \i0 to the end of the receiver.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink1979 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± addInt: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker1995 \markername bsearch:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 bsearch:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b bsearch: \b0\fc1\cf1 (int) \i x \b\i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\b0\fs16\li2100\fc0\cf0 \ \fs28 Performs a binary search for \i x \i0 in the list. Returns the index of \i x \i0 in the list, or the one's complement (~ \i index \i0 ) of the position where \i x \i0 should be inserted if \i x \i0 is not found in the list. The caller is responsible for ensuring that the list is sorted. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker2285 \markername bsearch:using:data:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 bsearch:using:data:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b bsearch: \b0\fc1\cf1 (int) \i x \b\i0\fc0\cf0 \ \fi0 using: \b0 (MiscIntListCompareFunc) \i cmp_func \i0 \ \b data: \b0 (void*) \i data \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Performs a binary search for \i x \i0 in the list. Returns the index of \i x \i0 in the list, or the one's complement (~ \i index \i0 ) of the position where \i x \i0 should be inserted if \i x \i0 is not found in the list. The caller is responsible for ensuring that the list is sorted. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\pard\fs28\fi-380\li2480\fc0\cf0{\NeXTHelpMarker2642 \markername copyFromZone:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 copyFromZone:\ \fs6 \ \f1\b0\fs28\fi-760\li3240 - \f0 (id) \b copyFromZone: \b0 (NXZone*) \i zone\ \pard\tx2480\tx2860\tx3240\i0\fs14\li2100\fc0\cf0 \ \fs28 Allocates, initializes, and returns a copy of the receiver.\ \fs14 \ \f2\b\fs28 See also: \f1\b0 - \f0 \b copy \b0 (Object)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker2784 \markername count;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 count\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (unsigned int) \b count \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the number of integers in the list.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker2863 \markername empty;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 empty\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b empty \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Empties the list. Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink2929 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername free;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± free \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker2942 \markername free;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 free\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b free \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Frees the storage used by the list.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink3009 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername init;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± init \b0 , {\b{\NeXTHelpLink3019 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername empty;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± empty \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3033 \markername init;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 init\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b init \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Initializes the storage used by the list. This method is the designated initializer. Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink3165 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername initFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initFromString: \b0 , {\b{\NeXTHelpLink3186 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername free;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± free \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3199 \markername initFromString:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 initFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b initFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Initializes the list by calling {\b{\NeXTHelpLink3286 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername init;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -init \f0\fs28\fc0\cf0 and then fills it from the string \i s \i0 using {\b{\NeXTHelpLink3335 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -readFromString: \f0\fs28\fc0\cf0 . Returns \b self \b0 .\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink3381 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername init;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± init \b0 , {\b{\NeXTHelpLink3391 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername free;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± free \b0 , {\f0\b{\NeXTHelpLink3401 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f0\b\i0\ulnone\fs28\li2100\fc0\cf0 \f2 ± readFromString: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3425 \markername insertInt:at:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 insertInt:at:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b insertInt: \b0 (int) \i value \i0 \ \b\fi0 at: \b0 (unsigned int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Inserts \i value \i0 at position \i pos \i0 in the list. The list is expanded if needed. Intervening slots are initialized to zero.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink3624 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± addInt: \b0 , {\b{\NeXTHelpLink3637 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername removeIntAt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± removeIntAt: \b0 , {\b{\NeXTHelpLink3655 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername replaceIntAt:with:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± replaceIntAt:with: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3682 \markername intAt:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 intAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b intAt: \b0 (unsigned int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the integer at position \i pos \i0 or 0 if \i pos \i0 is out-of-range..\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3793 \markername lsearch:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 lsearch:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b lsearch: \b0\fc1\cf1 (int) \i x \b\i0\fc0\cf0 \ \pard\tx2480\tx2860\tx3240\b0\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the first occurrence of \i x \i0 in the list, or -1 if \i x \i0 is not found. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker3915 \markername lsearch:using:data:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 lsearch:using:data:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b lsearch: \b0\fc1\cf1 (int) \i x \b\i0\fc0\cf0 \ \fi0 using: \b0 (MiscIntListCompareFunc) \i cmp_func \i0 \ \b data: \b0 (void*) \i data \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns the index of the first occurrence of \i x \i0 in the list, or -1 if \i x \i0 is not found. Calls the user-provided \i cmp_func \i0 function to perform the comparison. \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker4174 \markername rawData;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 rawData\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int const*) \b rawData \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to the actual array of integers. This allows low-level, fast access to the data when one needs to avoid the overhead of Objective-C messages. The array should not be modified.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker4407 \markername readFromString:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 readFromString:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b readFromString: \b0 (char const*) \i s \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Fills the list with numbers from the string \i s \i0 . This method first empties the list with {\b{\NeXTHelpLink4551 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername empty;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -empty \f0\fs28\fc0\cf0 , then parses numbers from the string \i s \i0 and adds them to the list with {\b{\NeXTHelpLink4629 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 -addInt: \f0\fs28\fc0\cf0 . The string should be a list of white-space delimited numbers. Returns the number of integers read from the string.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink4769 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername initFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± initFromString: \b0 , {\b{\NeXTHelpLink4790 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString \b0 , {\b{\NeXTHelpLink4809 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size: \b0 , {\b{\NeXTHelpLink4834 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:canExpand:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size:canExpand: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker4872 \markername removeIntAt:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 removeIntAt:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b removeIntAt: \b0 (unsigned int) \i pos \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Removes the integer at position \i pos \i0 from the list. Nothing happens if \i pos \i0 is beyond the end of the list.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink5044 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± addInt: \b0 , {\b{\NeXTHelpLink5057 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername insertInt:at:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± insertInt:at: \b0 , {\b{\NeXTHelpLink5076 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername replaceIntAt:with:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± replaceIntAt:with: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker5103 \markername replaceIntAt:with:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 replaceIntAt:with:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b replaceIntAt: \b0 (unsigned int) \i pos \i0 \ \b\fi0 with: \b0 (int) \i value \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Replaces the integer at position \i pos \i0 with \i value \i0 . If \i pos \i0 is out-of-range then nothing is replaced.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink5291 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername addInt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± addInt: \b0 , {\b{\NeXTHelpLink5304 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername insertInt:at:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± insertInt:at: \b0 , {\b{\NeXTHelpLink5323 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername removeIntAt:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± removeIntAt: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker5344 \markername sort;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 sort\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sort \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sorts the list in ascending numeric order.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink5420 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername sortUsing:data:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± sortUsing:data: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker5444 \markername sortUsing:data:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 sortUsing:data:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b sortUsing: \b0 (MiscIntListCompareFunc) \i cmp_func \i0 \ \b\fi0 data: \b0 (void*) \i data \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Sort the list of integers using the comparison function \i cmp_func \i0 . If \i cmp_func \i0 is NULL then the list is sorted in standard ascending numeric order. The meaning of the \i data \i0 argument is unspecified and is determined by the comparision function \i cmp_func \i0 to which it is passed unmolested.\ \fs14 \ {\f3\fs24\fc1\cf1{\NeXTHelpLink5818 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername MiscIntListCompareFunc;} ¬}\pard\tx2480\tx2860\tx3240\f3\b0\i0\ulnone\fs24\li2100\fc1\cf1 MiscIntListCompareFunc \f0\fs28\fc0\cf0 is a typedef which takes as arguments the \i data \i0 variable plus two integers for comparision. It should return a negative value if the first integer is less than the second, a positive value if the first integer is greater than the second, or zero if the integers are equal.\ \fs14 \ \pard\tx6480\f3\fs24\li2100\fc0\cf0 typedef int (*MiscIntListCompareFunc)( void* userData, int x, int y );\ \pard\tx2480\tx2860\tx3240\f0\fs14\li2100\fc0\cf0 \ \f2\b\fs28 See also: {{\NeXTHelpLink6199 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername sort;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± sort \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker6212 \markername writeToString;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 writeToString\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b writeToString \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Allocates a string using \f3\fs24\fc1\cf1 malloc() \f0\fs28\fc0\cf0 and writes a string representation of the contents of the list to it. It is the client's responsibility to \f3\fs24\fc1\cf1 free() \f0\fs28\fc0\cf0 the returned string. Equivalent to: \f3\fs24\fc1\cf1 -writeToString:0 size:0 canExpand:YES \f0\fs28 . Returns the newly allocated buffer. \fc0\cf0 \ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink6526 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± readFromString: \b0 , {\b{\NeXTHelpLink6547 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size: \b0 , {\b{\NeXTHelpLink6572 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:canExpand:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size:canExpand: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker6610 \markername writeToString:size:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 writeToString:size:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b writeToString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Writes a string representation of the contents of the list to the buffer \i buff \i0 of size \i buff_size \i0 . Equivalent to: \f3\fs24\fc1\cf1 -writeToString: \i buff \i0 size: \i buff_size \i0 canExpand:NO \f0\fs28 . Returns \i buff \i0 or 0 if \i buff_size \i0 wasn't large enough to hold the string. \fc0\cf0 \ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink6934 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± readFromString: \b0 , {\b{\NeXTHelpLink6955 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString \b0 , {\b{\NeXTHelpLink6974 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:canExpand:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size:canExpand: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ {\fs28{\NeXTHelpMarker7012 \markername writeToString:size:canExpand:;} ¬}\pard\tx7140\f2\b\i0\ulnone\fs28\fi-380\li2480\fc0\cf0 writeToString:size:canExpand:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (char*) \b writeToString: \b0 (char*) \i buff \i0 \ \b\fi0 size: \b0 (int) \i buff_size \i0 \ \b canExpand: \b0 (BOOL) \i flag \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Writes a white-space delimited, NULL terminated, printable, string representation of the contents of the list to \i buff \i0 . \i buff_size \i0 is the maximum number of bytes available in \i buff \i0 . If the \i canExpand \i0 flag is YES then \i buff \i0 is expanded using \f3\fs24\fc1\cf1 realloc() \f0\fs28\fc0\cf0 if it is otherwise too small. If \i canExpand \i0 is NO then the string is truncated to \i buff_size \i0 and is not NULL terminated. If \i buff \i0 is NULL and \i canExpand \i0 is YES then a buffer is allocated with \f3\fs24\fc1\cf1 malloc() \f0\fs28\fc0\cf0 and returned. Returns 0 if \i canExpand \i0 is NO and the string was truncated, \i buff \i0 if the string was less than \i buff_size \i0 characters, or a buffer allocated with realloc() if the buffer was expanded. It is the caller's responsibility to \f3\fs24\fc1\cf1 free() \f0\fs28\fc0\cf0 the returned buffer if \i canExpand \i0 was YES.\ \fs16 \ \f2\b\fs28 See also: {{\NeXTHelpLink7861 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername readFromString:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± readFromString: \b0 , {\b{\NeXTHelpLink7882 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString \b0 , {\b{\NeXTHelpLink7901 \markername ;\linkFilename MiscIntList.rtf;\linkMarkername writeToString:size:;} ¬}\pard\tx2480\tx2860\tx3240\f2\b\i0\ulnone\fs28\li2100\fc0\cf0 ± writeToString:size: \f0\b0\fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs36\li1360\fc0\cf0 Constants and Defined Types\ \fs16 \ {\pard\tx6480\f3\b0\fs24\li2100\fc0\cf0{\NeXTHelpMarker7958 \markername MiscIntListCompareFunc;} ¬}\pard\tx6480\f3\b0\i0\ulnone\fs24\li2100\fc0\cf0 typedef int (*MiscIntListCompareFunc)( void* userData, int x, int y );\ } MiscKit/Documentation/Classes/MiscExporter.rtf100444 1750 1750 22443 6757716171 22027 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh10480 \margl120 \margr0 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc1\cf1\up0\dn0 Version 1.0, Copyright \f1 ã \f0 1996,1997 by Paul S. McCarthy and Eric Sunshine. All Rights Reserved.\ \fc0\cf0 Paul S. McCarthy and Eric Sunshine -- July 1, 1997\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 \ \fs16 \ \fs28 \ \fs16 \ \pard\f2\b\fs56\li2100\fc0\cf0 MiscExporter\ \pard\tx4880\f0\b0\fs16\fi-2780\li4880\fc0\cf0 \ \ \ \ \ \ \f2\b\fs28 Inherits From: \f0\b0 Object\ \fs16 \ \f2\b\fs28 Declared In: \f0\b0 MiscExporter.h\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Class Description\ \fs16 \ \pard\tx2480\tx2860\tx3240\f0\b0\fs28\li2100\fc0\cf0 This class provides an easy means to export the contents of an instance of MiscTableScroll in the following output formats:\ \ \pard\li2880\fc0\cf0 ASCII fixed field widths\ ASCII tab separated fields\ ASCII delimited (quoted fields, comma-separated)\ dBASEIII (.dbf)\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \fs36 Instance Variables\ \fs16 \ \pard\tx2860\f0\b0\fs28\li2100\fc0\cf0 MiscTableScroll \b *tableScroll \b0 ;\ MiscExportFormat \b exportFormat \b0 ;\ MiscExportTitleMode \b rowTitleMode \b0 ;\ MiscExportTitleMode \b colTitleMode \b0 ;\ MiscExportGridMode \b rowGrid \b0 ;\ MiscExportGridMode \b colGrid \b0 ;\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \ \ \fs28 tableScroll The table scroll object to export.\ \fs16 \ \fs28 exportFormat Output format.\ \fs16 \ \fs28 rowTitleMode Row title option setting.\ \fs16 \ \fs28 colTitleMode Col title option setting.\ \fs16 \ \fs28 rowGrid Row grid option setting.\ \fs16 \ \fs28 colGrid Col grid option setting.\ \fs16 \ \pard\f2\b\li1360\fc0\cf0 \ \ \ \ \ \fs36 Method Types\ \fs16 \ \pard\tx6140\tx9660\tx10180\f0\b0\fs28\fi-4040\li6140\fc1\cf1 + commonInstance\ ± exportTableScroll:\ ± exportTableScroll:toFilename:\ ± getColExportGridMode\ ± getColExportTitleMode\ ± getExportFormat\ ± getRowExportGridMode\ ± getRowExportTitleMode\ ± init\ ± setColExportGridMode:\ ± setColExportTitleMode:\ ± setExportFormat:\ ± setRowExportGridMode:\ ± setRowExportTitleMode:\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \ \ \fs36 Class Methods\ \fs16 \ \fs28\fi-380\li2480 commonInstance\ \f0\b0\fi-760\li3240 + (MiscExporter*) \b commonInstance \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns a pointer to a single shared instance, which can be used from anywhere.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\fs36\li1360\fc0\cf0 Instance Methods\ \fs16 \ \fs28\fi-380\li2480 exportTableScroll:\ \f1\b0\fi-760\li3240 - \f0 (int) \b exportTableScroll: \b0 (MiscTableScroll*) \i ts \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Runs the SavePanel with an accessory view for the user to choose the output filename and other options for exporting the MiscTableScroll, \i ts \i0 . You can pre-initialize the MiscExporter object with any settings that you choose, but the user will be able to override your pre-set values via the accessory view on the SavePanel. Returns zero (0) on success, minus one (-1) if the user pressed "Cancel" at the save panel, or the MiscTableScroll has no columns, or \i errno \i0 if there was an error opening or closing the file.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 exportTableScroll:toFilename:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (int) \b exportTableScroll: \b0 (MiscTableScroll*) \i ts \i0 \ \b\fi0 toFilename: \b0 (char const*) \i\fc1\cf1 filenam \fc0\cf0 e \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Uses the current option settings and exports the MiscTableScroll, \i ts \i0 , to \i filename \i0 , over-writing the file if it is present. This method does not run the SavePanel. Returns zero (0) on success, minus one (-1) if \i ts \i0 is NULL or has no columns, or \i errno \i0 if there was an error opening or closing the file.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getColExportGridMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscExportGridMode) \b getColExportGridMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \i colGrid \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getColExportTitleMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscExportTitleMode) \b getColExportTitleMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \i colTitleMode \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getExportFormat\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscExportFormat) \b getExportFormat \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \i exportFormat \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getRowExportGridMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscExportGridMode) \b getRowExportGridMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \i rowGrid \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 getRowExportTitleMode\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (MiscExportTitleMode) \b getRowExportTitleMode \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Returns \i rowTitle \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 init\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (id) \b init \b0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Initializes a newly allocated MiscExporter object. The default settings are:\ \ \pard\tx5040\f3\fs24\fi20\li2860\fc0\cf0 exportFormat MISC_EXPORT_ASCII_FIXED\ rowTitleMode MISC_EXPORT_TITLES_OFF\ colTitleMode MISC_EXPORT_TITLES_ON\ rowGrid MISC_EXPORT_GRID_OFF\ colGrid MISC_EXPORT_GRID_LINE\ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColExportGridMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setColExportGridMode: \b0 (MiscExportGridMode) \i gridMode \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Assigns \i gridMode \i0 to \i colGrid \i0 . Col grid mode controls the lines/spaces between columns in fixed-width ASCII output format. The available values are:\ \ \pard\tx3600\tx7200\f3\fs24\li2880\fc1\cf1 typedef enum\ \{\ MISC_EXPORT_GRID_OFF, // No grid\ MISC_EXPORT_GRID_LINE, // Lines, col-grid='|', row-grid='-'\ MISC_EXPORT_GRID_SPACE, // Spaces col-grid=' ', row-grid=' '\ \} MiscExportGridMode;\ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ Grid mode only affects \f3\fs24\fc1\cf1 MISC_EXPORT_ASCII_FIXED \f0\fs28\fc0\cf0 export format. The other output formats do not produce a grid of any kind under any circumstances.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setColExportTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setColExportTitleMode: \b0 (MiscExportTitleMode) \i titleMode \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Assigns \i titleMode \i0 to \i colTitle \i0 . Col title mode controls whether or not titles are included in the output for all ASCII formats, and controls the formatting of the titles for fixed-width ASCII output format. Col title mode has no impact on dBASEIII (.dbf) output format. The available values are:\ \ \pard\tx3600\tx8220\f3\fs24\li2880\fc1\cf1 typedef enum\ \{\ MISC_EXPORT_TITLES_OFF, // No titles.\ MISC_EXPORT_TITLES_ON, // Full width, expand column if needed.\ MISC_EXPORT_TITLES_WRAP, // Wrap titles within data width.\ MISC_EXPORT_TITLES_TRUNCATE, // Truncate titles to data width.\ \} MiscExportTitleMode;\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setExportFormat:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setExportFormat: \b0 (MiscExportFormat) \i format \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Assigns \i format \i0 to \i exportFormat \i0 . The available values are:\ \ \pard\tx3600\tx8220\f3\fs24\li2880\fc1\cf1 typedef enum\ \{\ MISC_EXPORT_ASCII_FIXED,\ MISC_EXPORT_ASCII_TAB,\ MISC_EXPORT_ASCII_DELIMITED,\ MISC_EXPORT_DBF\ \} MiscExportFormat;\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowExportGridMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRowExportGridMode: \b0 (MiscExportGridMode) \i gridMode \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Assigns \i gridMode \i0 to \i rowGrid \i0 . See \f3\fs24\fc1\cf1 -setColExportGridMode: \f0\fs28\fc0\cf0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \fs28 setRowExportTitleMode:\ \pard\f1\b0\fi-760\li3240\fc0\cf0 - \f0 (void) \b setRowExportTitleMode: \b0 (MiscExportTitleMode) \i titleMode \i0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \fs28 Assigns \i titleMode \i0 to \i rowTitleMode \i0 . Turning on titles will include physical row numbers if no explicit row titles have been set for the MiscTableScroll object. Row titles are either on or off. \f3\fs24\fc1\cf1 MISC_EXPORT_TITLES_OFF \f0\fs28 turns the titles off. Any other value turns them on. The other formatting values do not affect row titles. See \f3\fs24 -setColExportTitleMode: \f0\fs28 . \fc0\cf0 \ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ } MiscKit/Examples/ 40755 1750 1750 0 6757716246 14121 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/ 40755 1750 1750 0 6757720176 16013 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/ 40755 1750 1750 0 6757716231 20526 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/DirWindow.nib/ 40755 1750 1750 0 6757716236 23210 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/DirWindow.nib/data.classes100444 1750 1750 1500 6734703135 25554 0ustar sunshinesunshineFirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; DirWindow = { ACTIONS = { "autoSortClick:" = "autoSortClick:"; "cdPressed:" = "cdPressed:"; "dragUnscaledClick:" = "dragUnscaledClick:"; "hiddenFilesClick:" = "hiddenFilesClick:"; "highlightClick:" = "highlightClick:"; "refreshPressed:" = "refreshPressed:"; "rowNumbersClick:" = "rowNumbersClick:"; "scrollClick:" = "scrollClick:"; "scrollDoubleClick:" = "scrollDoubleClick:"; }; OUTLETS = { autoSortSwitch = autoSortSwitch; cdButton = cdButton; countField = countField; dragUnscaledSwitch = dragUnscaledSwitch; hiddenFilesSwitch = hiddenFilesSwitch; highlightSwitch = highlightSwitch; refreshButton = refreshButton; rowNumbersSwitch = rowNumbersSwitch; scroll = scroll; window = window; }; SUPERCLASS = Object; }; MiscKit/Examples/ScrollDir/English.lproj/DirWindow.nib/data.nib100444 1750 1750 5024 6757716235 24706 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ DirWindow…† „@@„„„Button„„Control„„View„„ Responder”’„›’…„f„ffff «蟫è’…’…„@ss@„„„List”„i „[9@]„™’žŸ šŸš’’… …ˆ„…„i@s„„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„Highlight Directories„„„Font”„%fss„ Helvetica €†’…„i:…„ssȨ……8È™„„„NXImage”„s*p„„NXswitch†„©°p„„ NXswitchH††Ð†„™’žŸ šŸš’’… …ˆ„…¤„¢¨„„Show Hidden Files¦’…­…®È¨……8È™¨«†Ð†„„„MiscTableScroll„„ ScrollView›’žŸAž¡Ÿž¡’’… „Ÿ¢„[3@]„„„ClipView›’°žŸ‡xŸ‡x’°’… „Ÿ¢†P…„@fs„„„ MiscTableView›’…žŸˆŸˆ’…’… …@™@…†ƒUª*?€„c’…†„„„Scrollerš’°žŸ‡Ÿ‡’°’… …™…¤…Ð’°„ff:sƒx?„ _doScroller:°†„º’°žŸŸ’°’… …™…¤…P’°¼½††‰J…„@@@ffs»¹´ Ô¢ººº¢’„§«¬ †ºÁ„sºÁ¿©ªºÁ¿ºÁ¿þ’…’…’…’…’…’…„*„„À½À…¢ºº„I¬’°¢P¢ ¢‚ÿ¢¢¢¢¢ ¢‚ÿ¢¢‡¢¢ ¢¢ ¢‚ÿ¢¢x¢ ¢‚ÿ¢¢¢ ¢‚ÿ¢¢<¢ ¢‚ÿ¢¢d¢ ¢‚ÿ¢¢P¢ ¢‚ÿ¢¢<¢ ¢‚ÿ¢¢<¢ ¢‚ÿ¢¢(¢ ¢‚ÿ¢¢P¢ ¢‚ÿ¢„[10i] Ä[10*]…„„Name…„„Size„„Modified„„Perms„„Owner„„Group„„Links„„ Soft Link’…’„„„ MiscTableCell¤¨…¼’…¢Â†’…’„Ǩ…¼’…¢Â†’…’…’…’…’…’…¢ººÂ’°¢¢ ¢‚ÿ¢¢¢¢¢ ¢‚ÿ¢¢x¢¢¢ ¢†„™’žŸ"BŸB’’… …‰…¤„¢¨„„Traverse¦’…­…®È¨……†„@f¦†À†„™’žŸBŸB’’… …‰…¤„¢¨„„Refresh¦’…­…®È¨……†Ï¦†À†„„„ TextFieldš’žŸñ,µŸµ’’… … „…¤„„„ TextFieldCell£¨„„9999 files 9999999 bytes¦€’…­…„ffÿºº†À’…’…’…„:…†„™’žŸ†)~Ÿ~’’… …ˆ„…¤„¢¨„„ Auto-Sort¦†’…­…®È¨……<È™¨«†Ð†„™’žŸ†~Ÿ~’’… …ˆ„…¤„¢¨„„Drag Big Images¦†’…­…®È¨……<È™¨«†Ð†˜†@…†žŸ†~Ÿ~’’… …ˆ„…¤„¢¨„„ Row Numbers¦’…­…®È¨……8È™¨«†Ð†™ ™Ì™Ô™­™×™„„„WindowTemplate”ŸuQ«è„ iiii***@s@‚ï„„Window„œ„Ûx`…ºŸ¼ºÔ|´†™°™Ü•™Ï™É¢„@*Ü„ÛÜ•„„ File's Owner¢’„Ÿ¢„[21@]„„„IBOutletConnector„„ IBConnector”„@@*•Ü„„window†„åá•°„„scroll†„åáÜ•„„delegate†„åᰕ놄„„IBControlConnectoræá°•„„ scrollClick:†„åá•É„„cdButton†„îáÉ•„„ cdPressed:†„åá•Ì„„ refreshButton†„îáÌ•„„refreshPressed:†„åá•Ï„„ countField†„åá•­„„hiddenFilesSwitch†„îá­•„„hiddenFilesClick:†„åá•Ô„„autoSortSwitch†„îáÔ•„„autoSortClick:†„åá• „„highlightSwitch†„îá •„„highlightClick:†„åá•ׄ„dragUnscaledSwitch†„îáו„„dragUnscaledClick:†„„„MiscTableConnectorîá°•„„scrollDoubleClick:À„„ doubleTargetÀ„„ doubleActionÀ„õ†„åᕘ„„rowNumbersSwitch†„îᘕ„„rowNumbersClick:††’…†MiscKit/Examples/ScrollDir/English.lproj/Info.nib/ 40755 1750 1750 0 6734677431 22173 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/Info.nib/data.classes100444 1750 1750 246 6734677431 24540 0ustar sunshinesunshineDirController = { OUTLETS = {infoPanel = infoPanel; infoText = infoText; }; SUPERCLASS = Object; }; FirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscKit/Examples/ScrollDir/English.lproj/Info.nib/data.nib100444 1750 1750 3201 6757716235 23666 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ DirController…† „@@„„„ TextField„„Control„„View„„ Responder”’„›’…„f„ffff§Ÿ§’…’…„@ss@„„„List”„i„[6@]„„„Buttonš’žŸt00Ÿ00’’… …ˆ0…„i@s„„„ ButtonCell„„ ActionCell„„Cell”„*@ss…„„„Font”„%fss„ Helvetica €†+’…„i:…„ssÈ©……@‡™„„„NXImage”„s*b„„„app†…†Ð†˜„„„Box›’žŸŸ’’… „Ÿ¢„[1@]„›’«žŸŸ’«’… ……††ˆ…„ff„@@s„¥©„²¦†®À†„„„ ScrollView›’žŸ RŸ R’’… „Ÿ¢„[2@]„„„ClipView›’±žŸòNŸòN’±’… „Ÿ¢³„„„Text›’´žŸòNŸòN’´’… …¹` …’…ŸîN„ ciifffcfffsƒ«ªª>QS´ƒÊòIqƒÊòIq´òN¢¢¢¨„[168c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} \margl40 \margr40 \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 } ††J…„@fs·€„c’„„„NXCursor”´ø„s@„©°p„„NXibeam†††„„„Scrollerš’±žŸNŸN’±’… …™…¥…P’±„ff:s„ _doScroller:††‰J…„@@@ffs½…´ „†„¬’žŸnŸ’’… „Ÿ¢³„›’¿žŸŸ’¿’… ……††(…´µ„¥©„²¦†ÁÀ†„™’žŸ;€úŸú’’… … 0…¥„„„ TextFieldCell¤©„„MiscTableScroll Example„§«¬†’…­…´ÿ½½†À’…’…’…„:…††…†žŸƒ‹ Ÿ‹ ’’… …„…¥„Æ©„„LCopyright (C) 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine„§«¬ †€’…­…´ƒ«ª*?½½†À’…’…’…Ç…†™„„„WindowTemplate”Ÿo¡§„ iiii***@s@‚ï„„Info„œ„„Panelx`…½Ÿ¼½´´†™±™¿™«™Á¿™®«™·±™Ä™Ì•™ ¢„@*•„„ File's OwnerÍ̄ˢ’„Ÿ¢·„„„IBOutletConnector„„ IBConnector”„@@*•Ì„„ infoPanel†„ÕÑ•·„„infoText††’…†MiscKit/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/ 40755 1750 1750 0 6734676201 23732 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/data.classes100444 1750 1750 625 6734676201 26300 0ustar sunshinesunshineSD_PageLayout = { ACTIONS = {}; OUTLETS = { accessoryWindow = accessoryWindow; bottomMarginField = bottomMarginField; centerMatrix = centerMatrix; leftMarginField = leftMarginField; paginationMatrix = paginationMatrix; rightMarginField = rightMarginField; topMarginField = topMarginField; }; SUPERCLASS = Object; }; FirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscKit/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/data.nib100444 1750 1750 5241 6734676201 25432 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ SD_PageLayout…†„@@„„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„„„„Font”„%fss„ Helvetica €† ’…„i:…„ssÈ……À7™„„„NXImage”„s*b@„„Align.HLeft.VCentered†…†„„„Matrix„„Control„„View„„ Responder”’„¥’„„„Box¥’„¥’…„f„ffff Ü·­Ü·’…’…„@ss@„„„List”„i„[3@]„©’ª¬­rÚE­ÚE’ª’…®„¬°„[1@]„¥’­¬­Ö3­Ö3’­’…®„¬°„[8@]„„„ TextField¤’¯¬­-8­8’¯’…®… …„i@s„„„ TextFieldCellš„ž8–’…¢…„ff„c¸†À’…’…’…„:…†„²’¯¬­!*­*’¯’…®… …µ„´„„Left:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­-8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­*­*’¯’…®… …µ„´„„Right:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­™8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­m!,­,’¯’…®… …µ„´„„Top:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­™8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­i0­0’¯’…®… …µ„´„„Bottom:€†’…¢…·ÿ¸¸†À’…’…’…¹…††…††…·„@@s„›„„Margins†¯Ð†¨„©’ª¬­rhq­hq’ª’…®„¬°²„¥’ͬ­d_­d_’Í’…®„¬°²„£’Ϭ­ZZ­ZZ’Ï’…®……µ…À’…’…’…’…„@:@iiii„¬° „[9@]„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HFit.VFit†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VFit†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HClip.VFit†…†„™„ž‹’…¢…£È……Ä7™„ ¥b@„„Pagination.HFit.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HClip.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HFit.VClip†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VClip†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HClip.VClip†…††…ß··„ff@@#::sÿÿ…„™„ž ’…¢…£È……À7™Õ…†š……B¸¸††…††…·¾„›„„ Pagination†ÏІ†@…†¬­JS­JS’ª’…®„¬°²§†…·¾„›„„Center†§Ð†¬­FA­FA’¨’…®„¬°²¢†…†¬­<<­<<’§’…®……µ…À’…’…’…’…À„¬°„[4@]„™„ž‹’…¢…£È……Ä7™„ ¥b@„„Align.HLeft.VTop†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Align.HCentered.VTop†…†˜„™„ž ’…¢…£È……À7™„ ¥b@„„Align.HCentered.VCentered†…††…··Ëÿÿ…„™„ž ’…¢…£È……À7™…†š……B¸¸†™¢™§¨™­ª™È¯™¯­™Å¯™ãÑ™¼¯™±¯™ßÑ™¢§™Â¯™ª„„„WindowTemplate”­Ü·„ iiii***@s@‚ï„„Window„©„Ôªx`…¸­¼¸·Z †™ÛÑ™¨ª™×Ñ™¿¯™ëÑ™•™¹¯™¶¯™ïÑ™ÏÍ™óÑ™çљͪ™ÓÑ™¢™ÑÏ™¢°„@*•„„ File's OwnerÕ„Ô°’„¬°„[14@]„„„IBOutletConnector„„ IBConnector”„@@*•±„„leftMarginField†„Ú•„„accessoryWindow†„Ú•Å„„bottomMarginField†„Ú•¹„„rightMarginField†„Ú•¿„„topMarginField†„Ú±¿„„nextText†„Ú±•„„ textDelegate†„Ú¿¹#†„Ú¿•%†„Ú¹Å#†„Ú¹•%†„ÚÅ•%†„Ú•¢„„ centerMatrix†„Ú•Ñ„„paginationMatrix††’…†MiscKit/Examples/ScrollDir/English.lproj/ScrollDir.nib/ 40755 1750 1750 0 6734677060 23173 5ustar sunshinesunshineMiscKit/Examples/ScrollDir/English.lproj/ScrollDir.nib/data.classes100444 1750 1750 540 6734677060 25535 0ustar sunshinesunshineDirController = { ACTIONS = {"info:" = "info:"; "openDirectory:" = "openDirectory:"; }; SUPERCLASS = Object; }; FirstResponder = { ACTIONS = { "destroy:" = "destroy:"; "export:" = "export:"; "inspect:" = "inspect:"; "new:" = "new:"; "openSelected:" = "openSelected:"; "print:" = "print:"; }; SUPERCLASS = Object; }; MiscKit/Examples/ScrollDir/English.lproj/ScrollDir.nib/data.nib100444 1750 1750 6033 6734677060 24673 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ Application…†-„@@„„„MenuCell„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„Copy„„„Font”„%fss„ Helvetica †’…„i:…„ssÈž……©c„@fž’…„:…†„„„Matrix„„Control„„View„„ Responder”’…„f„ffffRP¬RP’…’…„@ss@……„i@s…Ø’…’…’…’…„@:@iiii„„„List”„i„[4@]„™ž„„Cutž’…£…¤Èž……©x¥ž’…¦…†˜„™ž„„Pastež’…£…¤Èž……©v¥ž’…¦…†„™ž„„ Select Allž’…£…¤Èž……©a¥ž’…¦…††……ÿÿ„ffR¶„ff@@#::sÿÿ……™……„c¸†™§ ™„„„ MenuTemplate”’…¶ _„*@*@ccc„„ ScrollDir„¡’…«¬QȬQÈ’…’…­……®…Ø’…’…’…’…¯„¦± „[10@]„™ž„„Info...ž’…£…¤Èž……©¥ž’…¦…†„™ž„„ Directoryž’„®’­¶\ÿº„¾„¡’…«¬U(¬U(’…’…­……®…Ø’…’…’…’…¯„¦±„[2@]„™ž„„Open...ž’…£…¤Èž……©o¥ž’…¦…†„™ž„„ Export...ž’…£…¤Èž……©s¥ž’…¦…††……ÿÿ¶U¶·ÿÿ……™……¸¸†„„Menu…†£„submenuAction:¤Èž……¨™„„„NXImage”„s*p„„ NXmenuArrow†…’¶¦…†„™ž„„Filež’„®’­¶\ÿº„Ç„¡’…«¬A(¬A(’…’…­……®…Ø’…’…’…’…¯„¦±¿„™ž„„Openž’…£…¤Èž……©O¥ž’…¦…†„™ž„„Deletež’…£…¤Èž……©r¥ž’…¦…††……ÿÿ¶A¶·ÿÿ……™……¸¸†„Â…†£Ã¤Èž……¨™¿…’Ħ…†„™ž„„Editž’„®’­¶\׺„Ê „Â…†£Ã¤Èž……¨™¿…’Ϧ…†„™ž„„Formatž’„®’­¶\뺄˄¡’…«¬m<¬m<’…’…­……®…Ø’…’…’…’…¯„¦±„[3@]„™ž„ ž’„®’Ô¶Ê뺄 „¡’…«¬c<¬c<’…’…­……®…È’…’…’…’…¯„¦±Ì„™ž„„ Font Panel...ž’…£…¤Èž……©t¥ž’…¦…†„™ž„„Boldž’…£…¤Èž……©b¥ž’…¦…†„™ž„„Italicž’…£…¤Èž……©i¥ž’…¦…††……ÿÿ¶c¶·ÿÿ……™……¸¸†„Â…†£Ã¤Èž……¨™¿…’Ú¦…†„™ž„„ Colors...ž’…£…¤Èž……©C¥ž’…¦…†„™ž„„Page Layout...ž’…£…¤Èž……©P¥ž’…¦…††……ÿÿ¶m¶·ÿÿ……™……¸¸†„Â…†£Ã¤Èž……¨™¿…’Ô¦…†„™ž„„Windowsž’„®’­¶\뺄҄¡’…«¬‰<¬‰<’…’…­……®…Ø’…’…’…’…¯„¦±Ì„™ž„„Arrange in Frontž’…£…¤Èž……©¥ž’…¦…†„™ž„„Miniaturize Windowž’…£…¤Èž……©m¥ž’…¦…†„™ž„„ Close Windowž’…£…¤Èž……©w¥ž’…¦…††……ÿÿ¶‰¶·ÿÿ……™……¸¸†„Â…†£Ã¤Èž……¨™¿…’즅†„™ž„„Print...ž’…£…¤Èž……©p¥ž’…¦…†„™ž„„Servicesž’„®’­¶\'º„ׄ¡’…«¬R¬R’…’…­……®…Ø’…’…’…’…¯„¦±†……ÿÿ¶R¶·ÿÿ……™……¸¸†„Â…†£Ã¤Èž……¨™¿…’û¦…†„™ž„„Hidež’…£…¤Èž……©h¥ž’…¦…†„™ž„„Quitž’…£…¤Èž……©q¥ž’…¦…††……ÿÿ ¶Q¶·ÿÿ……™……¸¸†„Â…†•™© ™ÆÄ™ýû™´°™ÜڙͰ™º¸™¼¸™ÏÍ™ôî™ØÖ™Â°™ÚØ™÷°™¸¶™âÜ™åÖ™ Ï™ûù™îì™Ò°™« ™ÖÔ™¶´™°­™°™ÊÆ™ðî™ê°™°™²°™ÞÜ™ÔÒ™òî™Ä™àÜ™ÈÆ™„–—„„ DirController…†•™ù°™ìê™çÖ™„–—„„ FontManager…†•± „@*•„„ File's OwnerÜ„ØÜ„„ Font ManagerÜ«„µÜ©„´Ü˜„ŸÜÍ„ÊÜ„Úܧ„³Ü­„„MainMenu܄ٱ’„¦±„[21@]„„„IBControlConnector„„ IBConnector”„@@*•„„hide:†„ã•„„ terminate:†„ã§…„„cut:†„㘅„„copy:†„ã©…„„paste:†„ã«…„„ selectAll:†„„„IBOutletConnectorã•„„delegate†„ãò…„„performMiniaturize:†„ãô…„„ performClose:†„ãð…„„arrangeInFront:†„㺄„openDirectory:†„㲄„info:†„ã¼…„„export:†„ã÷…„„print:†„ãç…„„runPageLayout:†„ãÞ„„orderFrontFontPanel:†„ãà„„ addFontTrait:†„ãâ9†„ãå…„„orderFrontColorPanel:†„ãÈ…„„ openSelected:†„ãÊ…„„destroy:††’†MiscKit/Examples/ScrollDir/Align.HLeft.VCentered.tiff100444 1750 1750 430 6757716223 22644 0ustar sunshinesunshineMM*J€* J¤©TªVO¿ßï(L-¼‘ïøŠ0‰Åbñ(£Ê-‡Äa°ÈSÉ  j¨€?àP8$ „BaP˜ø (R;3 ü€' ü€'MiscKit/Examples/ScrollDir/Align.HLeft.VTop.tiff100444 1750 1750 426 6757716224 21663 0ustar sunshinesunshineMM*H€* J¤*VG¿Çï$` …Ãað¨d9å…§ßï÷”j9ŽÆä1Ä€ª  €?àP8$ „BaP˜ö þ(R91 ü€' ü€'MiscKit/Examples/ScrollDir/Lock.insecure.tiff100444 1750 1750 2762 6757716224 21472 0ustar sunshinesunshineII*?ÕÀ@@ý@ê•@Àê•EÀê•EÀê•EÐUU????ÿÀ?ÿÀ?À0?À<?À<?À<?À<?ÿÿð?ÿÿð?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿ?? ¦®¶¾(R8†~~€ü '€ü 'ÿÿÿÿÿÿÿÿU?UOU?ÿÿÿÿU?U?ÿÿU?U?U?U?U?U?U?U?U?ÿÿþÿÿÿ™¯D_þÿªÏªÏª¿ªÏD_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_þÿªÏªÏª¿ªÏD_D_D_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_D_D_D_D_D_D_D_D_D_D_ ÚÆrâê(R€ü '€ü 'MiscKit/Examples/ScrollDir/Lock.secure.tiff100444 1750 1750 2762 6757716224 21143 0ustar sunshinesunshineII*ð \40ý@ê•@Àê•EÀê•EÀê•EÐUU???ð?ü??ü?<?<À?<À?<À?ÿÿð?ÿÿð?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿ?? ¦®¶¾(R8†~~€ü '€ü 'ÿÿÿÿÿÿÿÿU?U?U?ÿÿÿÿU?U?ÿÿU?U?U?U?U?U?U?ÿÿþÿÿÿ™¯D_þÿªÏªÏª¿ªÏD_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_þÿªÏªÏª¿ªÏD_D_D_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_D_D_D_D_D_D_D_D_D_D_ ÚÆrâê(R€ü '€ü 'MiscKit/Examples/ScrollDir/Defaults.h100444 1750 1750 4572 6757716214 20034 0ustar sunshinesunshine#ifndef __Defaults_h #define __Defaults_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.h // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.h,v 1.1 97/01/12 15:20:26 sunshine Exp $ // $Log: Defaults.h,v $ // Revision 1.1 97/01/12 15:20:26 sunshine // v28: Defaults manager. // //----------------------------------------------------------------------------- #import #import @class Font; @interface Defaults : Object + (void)set:(char const*)def str:(char const*)s; + (void)set:(char const*)def int:(int)i; + (void)set:(char const*)def float:(float)f; + (void)set:(char const*)def color:(NXColor)c; + (void)set:(char const*)def bool:(BOOL)b; + (void)set:(char const*)def font:(Font*)f; + (void)set:(char const*)def size:(NXSize)s; + (void)set:(char const*)def point:(NXPoint)p; + (void)set:(char const*)def rect:(NXRect)r; + (char const*) getStr: (char const*)def fallback:(char const*)s; + (int) getInt: (char const*)def fallback:(int)i; + (int) getInt: (char const*)def fallback:(int)i min:(int)n; + (int) getInt: (char const*)def fallback:(int)i min:(int)n max:(int)x; + (float) getFloat:(char const*)def fallback:(float)f; + (NXColor) getColor:(char const*)def fallback:(NXColor)c; + (BOOL) getBool: (char const*)def fallback:(BOOL)b; + (Font*) getFont: (char const*)def fallback:(Font*)f; + (NXSize) getSize: (char const*)def fallback:(NXSize)s; + (NXPoint) getPoint:(char const*)def fallback:(NXPoint)p; + (NXRect) getRect: (char const*)def fallback:(NXRect)r; @end #endif // __Defaults_h MiscKit/Examples/ScrollDir/Defaults.m100444 1750 1750 27472 6757716214 20065 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit disibution. Please refer to that file // for a list of all applicable permissions and resictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.m // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.m,v 1.2 97/02/05 08:13:09 sunshine Exp $ // $Log: Defaults.m,v $ // Revision 1.2 97/02/05 08:13:09 sunshine // v29: Reordered headers to be in syn with LazyScrollDir. Fixed whitespace. // // Revision 1.1 97/01/12 15:20:24 sunshine // v28: Defaults manager. //----------------------------------------------------------------------------- #import "Defaults.h" #import #import #import #import #import #import #import //----------------------------------------------------------------------------- // moduleName //----------------------------------------------------------------------------- static inline char const* moduleName( void ) { static char const* name = 0; if (name == 0) name = [NXApp appName]; return name; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation Defaults //----------------------------------------------------------------------------- // set:str: //----------------------------------------------------------------------------- + (void)set:(char const*)def str:(char const*)s { assert( def != 0 ); NXWriteDefault( moduleName(), def, s ); } //----------------------------------------------------------------------------- // getStr:fallback: //----------------------------------------------------------------------------- + (char const*)getStr:(char const*)def fallback:(char const*)fallback { char const* s; assert( def != 0 ); s = NXGetDefaultValue( moduleName(), def ); if (s == 0) s = fallback; return s; } //----------------------------------------------------------------------------- // set:int: //----------------------------------------------------------------------------- + (void)set:(char const*)def int:(int)i { char buf[ 32 ]; sprintf( buf, "%d", i ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getInt:fallback: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)fallback { int value = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { int x; if (sscanf( s, "%d", &x ) == 1) value = x; else fprintf( stderr, "%s/%s has a bad integer default value (%s)\n", moduleName(), def, s ); } return value; } //----------------------------------------------------------------------------- // getInt:fallback:min:max: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)f min:(int)imin max:(int)imax { int ret; assert( imin <= imax ); ret = [self getInt:def fallback:f]; if (ret < imin) ret = imin; else if (ret > imax) ret = imax; return ret; } //----------------------------------------------------------------------------- // getInt:fallback:min: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)fallback min:(int)imin { return [self getInt:def fallback:fallback min:imin max:INT_MAX]; } //----------------------------------------------------------------------------- // set:float: //----------------------------------------------------------------------------- + (void)set:(char const*)def float:(float)f { char buf[ 32 ]; sprintf( buf, "%g", f ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getFloat:fallback: //----------------------------------------------------------------------------- + (float)getFloat:(char const*)def fallback:(float)fallback { float value = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { float x; if (sscanf( s, "%f", &x ) == 1) value = x; else fprintf( stderr, "%s/%s has a bad float default value (%s)\n", moduleName(), def, s ); } return value; } //----------------------------------------------------------------------------- // set:color: //----------------------------------------------------------------------------- + (void)set:(char const*)def color:(NXColor)c { char buf[ 64 ]; sprintf( buf, "%g %g %g", NXRedComponent(c), NXGreenComponent(c), NXBlueComponent(c) ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getColor:fallback: //----------------------------------------------------------------------------- + (NXColor)getColor:(char const*)def fallback:(NXColor)fallback { NXColor color = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { float r,g,b; if (sscanf( s, "%f %f %f", &r, &g, &b ) == 3) color = NXConvertRGBToColor( r, g, b ); else fprintf( stderr, "%s/%s has a bad RGB default value (%s)\n", moduleName(), def, s ); } return color; } //----------------------------------------------------------------------------- // set:bool: //----------------------------------------------------------------------------- + (void)set:(char const*)def bool:(BOOL)b { assert( def != 0 ); NXWriteDefault( moduleName(), def, (b ? "Yes" : "No") ); } //----------------------------------------------------------------------------- // getBool:fallback: //----------------------------------------------------------------------------- + (BOOL)getBool:(char const*)def fallback:(BOOL)fallback { BOOL flag = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { char c = toupper( *s ); if ((c == 'Y') || (c == 'N')) flag = (c == 'Y'); else fprintf( stderr, "%s/%s has a bad boolean default value (%s)\n", moduleName(), def, s ); } return flag; } //----------------------------------------------------------------------------- // sizeParam -- caller must free returned value //----------------------------------------------------------------------------- static char* sizeParam( char const* def ) { static char const SIZE_STR[] = "Size"; char* p; assert( def != 0 ); p = (char*)malloc( strlen(def) + sizeof(SIZE_STR) ); // include null strcat( strcpy( p, def ), SIZE_STR ); return p; } //----------------------------------------------------------------------------- // set:font: //----------------------------------------------------------------------------- + (void)set:(char const*)def font:(Font*)f { char* p; assert( f != 0 ); assert( def != 0 ); NXWriteDefault( moduleName(), def, [f name] ); p = sizeParam( def ); [self set:p float:[f pointSize]]; free( p ); } //----------------------------------------------------------------------------- // getFont:fallback: //----------------------------------------------------------------------------- + (Font*)getFont:(char const*)def fallback:(Font*)fallback { Font* font = fallback; char const* name; assert( def != 0 ); assert( fallback != 0 ); if ((name = NXGetDefaultValue( moduleName(), def )) != 0) { Font* new_font; char* p = sizeParam( def ); float const size = [self getFloat:p fallback:[fallback pointSize]]; new_font = [Font newFont:name size:size]; if (new_font != 0) font = new_font; else fprintf( stderr, "%s/%s has a bad font default value (%s)\n", moduleName(), def, p ); free( p ); } assert( font != 0 ); return font; } //----------------------------------------------------------------------------- // set:size: //----------------------------------------------------------------------------- + (void)set:(char const*)def size:(NXSize)s { char buf[ 64 ]; sprintf( buf, "%g %g", s.width, s.height ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getSize:fallback: //----------------------------------------------------------------------------- + (NXSize)getSize:(char const*)def fallback:(NXSize)fallback { NXSize size = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord w,h; if (sscanf( s, "%f %f", &w, &h ) == 2) { size.width = w; size.height = h; } else fprintf( stderr, "%s/%s has a bad size default value (%s)\n", moduleName(), def, s ); } return size; } //----------------------------------------------------------------------------- // set:point: //----------------------------------------------------------------------------- + (void)set:(char const*)def point:(NXPoint)p { char buf[ 64 ]; sprintf( buf, "%g %g", p.x, p.y ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getPoint:fallback: //----------------------------------------------------------------------------- + (NXPoint)getPoint:(char const*)def fallback:(NXPoint)fallback { NXPoint point = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord x,y; if (sscanf( s, "%f %f", &x, &y ) == 2) { point.x = x; point.y = y; } else fprintf( stderr, "%s/%s has a bad point default value (%s)\n", moduleName(), def, s ); } return point; } //----------------------------------------------------------------------------- // set:rect: //----------------------------------------------------------------------------- + (void)set:(char const*)def rect:(NXRect)r { char buf[ 128 ]; sprintf( buf, "%g %g %g %g", r.origin.x, r.origin.y, r.size.width, r.size.height ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getRect:fallback: //----------------------------------------------------------------------------- + (NXRect)getRect:(char const*)def fallback:(NXRect)fallback { NXRect rect = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord x,y,w,h; if (sscanf( s, "%f %f %f %f", &x, &y, &w, &h ) == 4) { rect.origin.x = x; rect.origin.y = y; rect.size.width = w; rect.size.height = h; } else fprintf( stderr, "%s/%s has a bad rect default value (%s)\n", moduleName(), def, s ); } return rect; } @end MiscKit/Examples/ScrollDir/DirController.h100444 1750 1750 3145 6757716214 21042 0ustar sunshinesunshine#ifndef __DirController_h #define __DirController_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.h // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.h,v 1.2 99/06/29 08:12:20 sunshine Exp $ // $Log: DirController.h,v $ // Revision 1.2 99/06/29 08:12:20 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. // For clarity renamed -new: to -openDirectory:. // //----------------------------------------------------------------------------- #import @class Panel, Text; @interface DirController : Object { Panel* infoPanel; Text* infoText; } - (id)init; - (id)free; - (id)appDidInit:(id)sender; - (id)openDirectory:(id)sender; - (id)info:(id)sender; @end #endif // __DirController_h MiscKit/Examples/ScrollDir/DirController.m100444 1750 1750 10113 6757716215 21061 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.m // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.m,v 1.2 99/06/29 08:12:38 sunshine Exp $ // $Log: DirController.m,v $ // Revision 1.2 99/06/29 08:12:38 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. // For clarity renamed -new: to -openDirectory:. // //----------------------------------------------------------------------------- #import "DirController.h" #import "DirWindow.h" #import "SD_PageLayout.h" #import #import #import #import #import @implementation DirController //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; infoPanel = 0; return self; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { if (infoPanel) [infoPanel free]; return [super free]; } //----------------------------------------------------------------------------- // - appWillInit: //----------------------------------------------------------------------------- - (id)appWillInit:(id)sender { [SD_PageLayout new]; return self; } //----------------------------------------------------------------------------- // - appDidInit: //----------------------------------------------------------------------------- - (id)appDidInit:(id)sender { [DirWindow launchDir:0]; return self; } //----------------------------------------------------------------------------- // - openDirectory: //----------------------------------------------------------------------------- - (id)openDirectory:(id)sender { int rc; OpenPanel* panel = [OpenPanel new]; [panel setTitle:"Open Directory"]; [panel setPrompt:"Directory:"]; [panel chooseDirectories:YES]; [panel allowMultipleFiles:NO]; // OpenPanel screws up multiple dirs. [panel setTreatsFilePackagesAsDirectories:YES]; rc = [panel runModal]; [panel close]; if (rc == NX_OKTAG) { char const* const* filename; char const* dir = [panel directory]; if (dir == 0) dir = ""; for (filename = [panel filenames]; *filename != 0; filename++) { char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, dir ), "/" ), *filename ); [DirWindow launchDir:buff]; } } return self; } //----------------------------------------------------------------------------- // - info: //----------------------------------------------------------------------------- - (id)info:(id)sender { if (infoPanel == 0) { char buff[ FILENAME_MAX + 1 ]; id const bundle = [NXBundle bundleForClass:[self class]]; [bundle getPath:buff forResource:"Info" ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:[self zone]]; if (![bundle getPath:buff forResource:"README" ofType:"rtf"]) [bundle getPath:buff forResource:"README" ofType:"rtfd"]; [infoText openRTFDFrom:buff]; } [infoPanel makeKeyAndOrderFront:self]; return self; } @end MiscKit/Examples/ScrollDir/DirWindow.h100444 1750 1750 4053 6757716233 20166 0ustar sunshinesunshine#ifndef __DirWindow_h #define __DirWindow_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.h // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.h,v 1.4 99/06/29 08:13:10 sunshine Exp $ // $Log: DirWindow.h,v $ // Revision 1.4 99/06/29 08:13:10 sunshine // v35: +launchDir: now returns (void) rather than (id). // // Revision 1.3 97/11/14 11:54:00 zarnuk // v32 -- added row-numbers switch. // // Revision 1.2 97/02/05 08:13:41 sunshine // v29: Added 'writable' flag to prevent cmd-r from working in readonly dirs. //----------------------------------------------------------------------------- #import @class Button, MiscTableScroll, TextField, Window; @interface DirWindow : Object { MiscTableScroll* scroll; Window* window; Button* autoSortSwitch; Button* cdButton; Button* dragUnscaledSwitch; Button* hiddenFilesSwitch; Button* highlightSwitch; Button* refreshButton; Button* rowNumbersSwitch; TextField* countField; char* path; BOOL writable; BOOL autoSort; BOOL dragUnscaled; BOOL highlightDirs; BOOL showHidden; } + (void)launchDir:(char const*)dirname; @end #endif // __DirWindow_h MiscKit/Examples/ScrollDir/DirWindow.m100444 1750 1750 126400 6757716233 20234 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.m // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.m,v 1.8 99/06/29 08:15:01 sunshine Exp $ // $Log: DirWindow.m,v $ // Revision 1.8 99/06/29 08:15:01 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. // For clarity, renamed: -open: to -openSelected: & -save: to -export:. // Now prompts user for confirmation before deleting files in -destroy:. // Fixed bug: Was responding to -tableScroll:fontChanged:to: rather than // -tableScroll:changeFont:to:. The latter is sent in response to user- // initiated font changes, which is what we are interested in. // For naming consistency, renamed: -didClick: to -scrollClick: & // -didDoubleClick: to -scrollDoubleClick:. This is more consistent with // other methods such as -lockClick:. // +launchDir: now returns (void) rather than (id). // // Revision 1.7 98/03/23 23:29:57 sunshine // v34: Added -tableScrollIgnoreModifierKeysWhileDragging: returning NO. // Had to implement -tableScroll:draggingSourceOperationMaskForLocal: since // in MiscTableScroll v126 the default changed from "copy" to "generic". // // Revision 1.6 97/11/24 17:04:11 sunshine // Unified naming. //----------------------------------------------------------------------------- #import "DirWindow.h" #import "Defaults.h" #import "NameCache.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import // getwd() #import #import // getcwd() #import // vm_page_size #import #ifdef _POSIX_SOURCE # define GET_CURR_DIR(_BF_,_SZ_) getcwd( _BF_, _SZ_ ) # define GRP_TYPE gid_t # define MAX_GRPS NGROUPS_MAX #else # define GET_CURR_DIR(_BF_,_SZ_) getwd( _BF_ ) # define GRP_TYPE int # define MAX_GRPS NGROUPS #endif enum { ICON_SLOT, NAME_SLOT, LOCK_SLOT, SIZE_SLOT, MODIFIED_SLOT, PERMS_SLOT, OWNER_SLOT, GROUP_SLOT, HARDLINKS_SLOT, SOFTLINK_SLOT, MAX_SLOT }; static int const CASCADE_MAX = 10; static int CASCADE_COUNTER = 0; static NXCoord CASCADE_ORIGIN_X; static NXCoord CASCADE_ORIGIN_Y; static NXCoord CASCADE_DELTA_X; static NXCoord CASCADE_DELTA_Y; static BOOL DEFAULT_AUTO_SORT; static BOOL DEFAULT_ROW_NUMBERS; static BOOL DEFAULT_SHOW_HIDDEN; static BOOL DEFAULT_HIGHLIGHT_DIRS; static BOOL DEFAULT_DRAG_UNSCALED; static NXColor DEFAULT_COLOR; static NXSize DEFAULT_WIN_SIZE; static Font* DEFAULT_FONT; static List* OPEN_DIRS = 0; static NXImage* LOCKED_ICON = 0; static NXImage* UNLOCKED_ICON = 0; static OwnerCache* OWNERS = 0; static GroupCache* GROUPS = 0; static char const COLOR_DEF[] = "DirColor"; static char const SIZE_DEF[] = "DirSize"; static char const FONT_DEF[] = "DirFont"; static char const SORT_DEF[] = "AutoSort"; static char const HIDDEN_DEF[] = "ShowHidden"; static char const HLIGHT_DEF[] = "HighlightDirs"; static char const UNSCALED_DEF[] = "DragUnscaled"; static char const COL_SIZES_DEF[] = "ColSizes"; static char const COL_ORDER_DEF[] = "ColOrder"; static char const ROW_NUMBERS_DEF[] = "RowNumbers"; static char const LOCKED_ICON_S[] = "Lock.secure"; static char const UNLOCKED_ICON_S[] = "Lock.insecure"; typedef struct { char const* shortName; char const* longName; char softLink[ FILENAME_MAX + 1 ]; struct stat status; BOOL isDirectory; BOOL parentWritable; BOOL parentSticky; uid_t effectiveUid; } DirEntry; //----------------------------------------------------------------------------- // NOTE: USE_PRIVATE_ZONE // When set to '1', this program will place each window in a separate // NXZone and destroy the zone when the window is closed. However, // the NEXTSTEP 3.3 Cell class caches ClipViews which it uses for editing // scrollable cells. Unfortunately the caching code is buggy. It // blindly allocates ClipViews from transient zones such as ours then // caches and tries to re-use the ClipViews even after the originating // zones are defunct. Hence the program crashes. Verification of this // bug was obtained via disassembly of relevant portions of the AppKit. // The OPENSTEP AppKit does not have this problem. Disassembly of the // relevant OPENSTEP AppKit code reveals that the NSClipViews are // allocated from a zone which is guranteed to stay around for the life // of the application, NSDefaultMallocZone(). //----------------------------------------------------------------------------- #define USE_PRIVATE_ZONE 0 #if USE_PRIVATE_ZONE # define EMPLOY_ZONE() NXCreateZone( vm_page_size, vm_page_size, YES ) # define RETIRE_ZONE(Z) NXDestroyZone(Z) #else # define EMPLOY_ZONE() NXDefaultMallocZone() # define RETIRE_ZONE(Z) (void)(Z) #endif //----------------------------------------------------------------------------- // normalize_path //----------------------------------------------------------------------------- static void normalize_path( char* buff, size_t sz ) { char save_dir[ FILENAME_MAX + 1 ]; char tmp[ FILENAME_MAX + 1 ]; if (buff != 0 && sz > 0) { if (GET_CURR_DIR( save_dir, sizeof(save_dir) ) != 0) { if (chdir( buff ) == 0) { if (GET_CURR_DIR( tmp, sizeof(tmp) ) != 0) { int const tmp_len = strlen( tmp ); if (tmp_len < sz) strcpy( buff, tmp ); else { strncpy( buff, tmp, sz ); buff[ sz - 1 ] = '\0'; } } chdir( save_dir ); } } } } //----------------------------------------------------------------------------- // dir_writable //----------------------------------------------------------------------------- static BOOL dir_writable( char const* path ) { BOOL rc = NO; struct stat st; if (stat( path, &st ) == 0) { unsigned int mode = st.st_mode; if ((mode & 0002) != 0 || // "other" ((mode & 0200) != 0 && st.st_uid == geteuid())) // "owner" rc = YES; else if ((mode & 0020) != 0) // "group" { gid_t const gid = getegid(); if (st.st_gid == gid) rc = YES; else { GRP_TYPE groups[ MAX_GRPS ]; int n = getgroups( MAX_GRPS, groups ); while (n-- > 0) if (gid == groups[n]) { rc = YES; break; } } } } return rc; } //----------------------------------------------------------------------------- // dir_sticky //----------------------------------------------------------------------------- static BOOL dir_sticky( char const* path ) { struct stat st; if (stat( path, &st ) == 0) return ((st.st_mode & 01000) != 0); return NO; } //----------------------------------------------------------------------------- // str_date //----------------------------------------------------------------------------- static char const* str_date( time_t t ) { #define BUFF_SIZE 64 static char buff[ BUFF_SIZE ]; strftime( buff, BUFF_SIZE, "%m/%d/%y %H:%M", localtime(&t) ); return buff; } //----------------------------------------------------------------------------- // str_perms //----------------------------------------------------------------------------- static char const* str_perms( unsigned int mode ) { static char buff[ 16 ]; int ftype; int c; char* s = buff; ftype = (mode & S_IFMT); switch (ftype) { case S_IFDIR: c = 'd'; break; case S_IFCHR: c = 'c'; break; case S_IFBLK: c = 'b'; break; case S_IFREG: c = '-'; break; case S_IFLNK: c = 'l'; break; case S_IFSOCK: c = 's'; break; default: c = '-'; break; } *s++ = c; *s++ = (mode & 0400) ? 'r' : '-'; *s++ = (mode & 0200) ? 'w' : '-'; *s++ = (mode & S_ISUID) ? 's' : (mode & 0100) ? 'x' : '-'; *s++ = (mode & 0040) ? 'r' : '-'; *s++ = (mode & 0020) ? 'w' : '-'; *s++ = (mode & S_ISGID) ? 's' : (mode & 0010) ? 'x' : '-'; *s++ = (mode & 0004) ? 'r' : '-'; *s++ = (mode & 0002) ? 'w' : '-'; *s++ = (mode & S_ISVTX) ? 't' : (mode & 0001) ? 'x' : '-'; *s = '\0'; return buff; } //----------------------------------------------------------------------------- // fmt_icon //----------------------------------------------------------------------------- static void fmt_icon( MiscTableScroll* ts, DirEntry const* de, id cell ) { NXCoord h,w,s; NXSize sz; NXImage* i = [[Application workspace] getIconForFile:de->longName]; w = [ts colSize:ICON_SLOT]; if (w == 0) w = 18; h = [ts uniformSizeRows]; if (h == 0) h = 18; s = (w < h ? w : h) - 1.0; sz.width = s; sz.height = s; [cell setTag:(int)i]; // Unscaled image. i = [i copy]; [i setScalable:YES]; [i setSize:&sz]; [cell setImage:i]; // Scaled image. } //----------------------------------------------------------------------------- // fmt_lock //----------------------------------------------------------------------------- static void fmt_lock( MiscTableScroll* ts, DirEntry const* de, id cell ) { BOOL const unlocked = (de->parentWritable && (!de->parentSticky || de->status.st_uid == de->effectiveUid)); BOOL const flag = (unlocked && strcmp( de->shortName, ".." ) != 0); [cell setState:flag]; [cell setEnabled:flag]; } //----------------------------------------------------------------------------- // fmt_name //----------------------------------------------------------------------------- static void fmt_name( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:de->shortName]; } //----------------------------------------------------------------------------- // fmt_size //----------------------------------------------------------------------------- static void fmt_size( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setIntValue:de->status.st_size]; } //----------------------------------------------------------------------------- // fmt_modified //----------------------------------------------------------------------------- static void fmt_modified( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:str_date( de->status.st_mtime )]; [cell setTag:de->status.st_mtime]; } //----------------------------------------------------------------------------- // fmt_perms //----------------------------------------------------------------------------- static void fmt_perms( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:str_perms( de->status.st_mode )]; [cell setTag:de->isDirectory]; } //----------------------------------------------------------------------------- // fmt_owner //----------------------------------------------------------------------------- static void fmt_owner( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValueNoCopy:[OWNERS lookup:de->status.st_uid]]; } //----------------------------------------------------------------------------- // fmt_group //----------------------------------------------------------------------------- static void fmt_group( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValueNoCopy:[GROUPS lookup:de->status.st_gid]]; } //----------------------------------------------------------------------------- // fmt_hardlinks //----------------------------------------------------------------------------- static void fmt_hardlinks( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setIntValue:de->status.st_nlink]; } //----------------------------------------------------------------------------- // fmt_softlink //----------------------------------------------------------------------------- static void fmt_softlink( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:de->softLink]; } //----------------------------------------------------------------------------- // FORMAT_FUNC //----------------------------------------------------------------------------- typedef void (*FormatFunc)( MiscTableScroll*, DirEntry const*, id ); static FormatFunc FORMAT_FUNC[ MAX_SLOT ] = { fmt_icon, // ICON_SLOT, fmt_name, // NAME_SLOT, fmt_lock, // LOCK_SLOT, fmt_size, // SIZE_SLOT, fmt_modified, // MODIFIED_SLOT, fmt_perms, // PERMS_SLOT, fmt_owner, // OWNER_SLOT, fmt_group, // GROUP_SLOT, fmt_hardlinks, // HARDLINKS_SLOT, fmt_softlink, // SOFTLINK_SLOT, }; //----------------------------------------------------------------------------- // format_cell //----------------------------------------------------------------------------- static inline void format_cell( MiscTableScroll* ts, DirEntry const* de, id cell, unsigned int col ) { FORMAT_FUNC[ col ]( ts, de, cell ); } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation DirWindow //----------------------------------------------------------------------------- // + initCascader //----------------------------------------------------------------------------- + (void)initCascader { NXSize s; [NXApp getScreenSize:&s]; CASCADE_ORIGIN_X = s.width / 4; CASCADE_ORIGIN_Y = s.height - 40; CASCADE_DELTA_X = 20; CASCADE_DELTA_Y = 20; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (self == [DirWindow class]) { [self initCascader]; OPEN_DIRS = [[List alloc] init]; LOCKED_ICON = [NXImage findImageNamed:LOCKED_ICON_S]; UNLOCKED_ICON = [NXImage findImageNamed:UNLOCKED_ICON_S]; OWNERS = [OwnerCache commonInstance]; GROUPS = [GroupCache commonInstance]; DEFAULT_COLOR = [Defaults getColor:COLOR_DEF fallback:NX_COLORLTGRAY]; DEFAULT_AUTO_SORT = [Defaults getBool:SORT_DEF fallback:YES]; DEFAULT_SHOW_HIDDEN = [Defaults getBool:HIDDEN_DEF fallback:NO]; DEFAULT_ROW_NUMBERS = [Defaults getBool:ROW_NUMBERS_DEF fallback:NO]; DEFAULT_HIGHLIGHT_DIRS = [Defaults getBool:HLIGHT_DEF fallback:NO]; DEFAULT_DRAG_UNSCALED = [Defaults getBool:UNSCALED_DEF fallback:YES]; } return self; } //----------------------------------------------------------------------------- // - cascade //----------------------------------------------------------------------------- - (void)cascade { NXCoord top,left; left = CASCADE_ORIGIN_X + (CASCADE_DELTA_X * CASCADE_COUNTER); top = CASCADE_ORIGIN_Y - (CASCADE_DELTA_Y * CASCADE_COUNTER); [window moveTopLeftTo:left:top]; if (++CASCADE_COUNTER >= CASCADE_MAX) CASCADE_COUNTER = 0; } //----------------------------------------------------------------------------- // - isDir: //----------------------------------------------------------------------------- - (BOOL)isDir:(int)r { return [scroll tagAt:r:PERMS_SLOT]; } //----------------------------------------------------------------------------- // - updateButtons //----------------------------------------------------------------------------- - (void)updateButtons { BOOL const enable = [scroll numSelectedRows] == 1 && [self isDir:[scroll selectedRow]]; if (enable != [cdButton isEnabled]) [cdButton setEnabled:enable]; } //----------------------------------------------------------------------------- // - setRow:useOwner:color: //----------------------------------------------------------------------------- - (void)setRow:(int)r useOwner:(BOOL)useOwner color:(NXColor)color { int i; for (i = MAX_SLOT; i-- >= 0; ) { id cell = [scroll cellAt:r:i]; if (useOwner && [cell respondsTo:@selector(setUseOwnerBackgroundColor:)]) { [cell setUseOwnerBackgroundColor:YES]; if ([cell respondsTo:@selector(setOwnerBackgroundColor:)]) [cell setOwnerBackgroundColor:color]; } else if ([cell respondsTo:@selector(setBackgroundColor:)]) [cell setBackgroundColor:color]; } } //----------------------------------------------------------------------------- // - highlight:row: //----------------------------------------------------------------------------- - (void)highlight:(BOOL)flag row:(int)r { if (flag) [self setRow:r useOwner:NO color:NX_COLORCYAN]; else [self setRow:r useOwner:YES color:DEFAULT_COLOR]; } //----------------------------------------------------------------------------- // - highlightDirs: //----------------------------------------------------------------------------- - (void)highlightDirs:(BOOL)flag { int i; for (i = [scroll numRows]; i-- > 0; ) if ([self isDir:i]) [self highlight:flag row:i]; } //----------------------------------------------------------------------------- // - freeImages //----------------------------------------------------------------------------- - (void)freeImages { int i; for (i = [scroll numRows]; i-- > 0; ) { id cell = [scroll cellAt:i:ICON_SLOT]; id image = [cell image]; // Scaled image. [cell setImage:0]; [image free]; [(id)[cell tag] free]; // Unscaled image. } } //----------------------------------------------------------------------------- // - tableScroll:changeFont:to: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts changeFont:(Font*)oldFont to:(Font*)newFont { DEFAULT_FONT = newFont; [Defaults set:FONT_DEF font:DEFAULT_FONT]; return self; } //----------------------------------------------------------------------------- // - tableScroll:border:slotResized: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotResized:(int)n { char* s; assert( b == MISC_COL_BORDER ); s = [ts colSizesAsString:0 size:0 canExpand:YES]; [Defaults set:COL_SIZES_DEF str:s]; free(s); return self; } //----------------------------------------------------------------------------- // saveSlotOrder:border: //----------------------------------------------------------------------------- - (void)saveSlotOrder:(MiscTableScroll*)ts border:(MiscBorderType)b { if (b == MISC_COL_BORDER) { char* s = [ts colOrderAsString:0 size:0 canExpand:YES]; [Defaults set:COL_ORDER_DEF str:s]; free(s); } } //----------------------------------------------------------------------------- // - tableScroll:border:slotDraggedFrom:to: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotDraggedFrom:(int)fromPos to:(int)toPos { [self saveSlotOrder:ts border:b]; return self; } //----------------------------------------------------------------------------- // - tableScroll:border:slotSortReversed: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotSortReversed:(int)n { [self saveSlotOrder:ts border:b]; return self; } //----------------------------------------------------------------------------- // - tableScroll:canEdit:at:: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts canEdit:(NXEvent const*)ev at:(int)row :(int)col { return ((ev == 0 || ev->data.mouse.click == 2) && col == NAME_SLOT && [[ts cellAt:row:LOCK_SLOT] state] != 0); } //----------------------------------------------------------------------------- // -tableScroll:draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (NXDragOperation)tableScroll:(MiscTableScroll*)s draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NX_DragOperationAll; } //----------------------------------------------------------------------------- // tableScrollIgnoreModifierKeysWhileDragging: //----------------------------------------------------------------------------- - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)s { return NO; } //----------------------------------------------------------------------------- // - tableScroll:preparePasteboard:forDragOperationAt:: //----------------------------------------------------------------------------- - (void)tableScroll:(MiscTableScroll*)s preparePasteboard:(Pasteboard*)pb forDragOperationAt:(int)r :(int)c { char const* const name = [[s cellAt:r:NAME_SLOT] stringValue]; char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, path ), "/" ), name ); [pb declareTypes:&NXFilenamePboardType num:1 owner:0]; [pb writeType:NXFilenamePboardType data:buff length:strlen(buff)]; } //----------------------------------------------------------------------------- // - tableScroll:allowDragOperationAt:: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)s allowDragOperationAt:(int)r :(int)c { return (c == ICON_SLOT); } //----------------------------------------------------------------------------- // - tableScroll:imageForDragOperationAt:: //----------------------------------------------------------------------------- - (NXImage*)tableScroll:(MiscTableScroll*)s imageForDragOperationAt:(int)r :(int)c { return (dragUnscaled ? (NXImage*)[[s cellAt:r:c] tag] : 0); } //----------------------------------------------------------------------------- // - addFile: //----------------------------------------------------------------------------- - (void)addFile:(DirEntry const*)de { int r,c; [scroll addRow]; r = [scroll numRows] - 1; for (c = 0; c < MAX_SLOT; c++) format_cell( scroll, de, [scroll cellAt:r:c], c ); if (highlightDirs && de->isDirectory) [self highlight:YES row:r]; } //----------------------------------------------------------------------------- // setupDirFlag: //----------------------------------------------------------------------------- - (void)setupDirFlag:(DirEntry*)de { unsigned int mode = de->status.st_mode; if ((mode & S_IFMT) == S_IFLNK) // soft-link? { int len = readlink( de->longName, de->softLink, FILENAME_MAX ); if (len >= 0) { struct stat st; de->softLink[ len ] = '\0'; if (stat( de->longName, &st ) == 0) mode = st.st_mode; // mode of file linked to } } de->isDirectory = ((mode & S_IFMT) == S_IFDIR); } //----------------------------------------------------------------------------- // - includeFile:length: -- exclude ".", include ".." //----------------------------------------------------------------------------- - (BOOL)includeFile:(char const*)name length:(int)len { BOOL const dotName = (name[0] == '.'); return ((len > 1 || !dotName) && // exclude "." (showHidden || !dotName || (len == 2 && name[1] == '.'))); } //----------------------------------------------------------------------------- // - fillScroll //----------------------------------------------------------------------------- - (void)fillScroll { size_t totalBytes = 0; int dirlen; DIR* dirp; char namebuff[ FILENAME_MAX + 1 ]; dirlen = strlen( path ); strcpy( namebuff, path ); if (dirlen == 0 || namebuff[ dirlen - 1 ] != '/') { namebuff[ dirlen++ ] = '/'; namebuff[ dirlen ] = '\0'; } [window disableDisplay]; [self freeImages]; [scroll empty]; if ((dirp = opendir( path )) == 0) { NXRunAlertPanel( "Can't Read", "Cannot read directory, %s\n%d:%s", "OK", 0, 0, path, errno, strerror(errno) ); } else { struct direct const* dp; uid_t const euid = geteuid(); BOOL const sticky = dir_sticky( path ); writable = dir_writable( path ); while ((dp = readdir( dirp )) != 0) { if ([self includeFile:dp->d_name length:dp->d_namlen]) { DirEntry de; memcpy( namebuff + dirlen, dp->d_name, dp->d_namlen + 1 ); de.shortName = dp->d_name; de.longName = namebuff; de.softLink[0] = '\0'; de.parentWritable = writable; de.parentSticky = sticky; de.effectiveUid = euid; if (lstat( namebuff, &de.status ) == 0) { totalBytes += de.status.st_size; [self setupDirFlag:&de]; [self addFile:&de]; } } } closedir( dirp ); } if ([scroll autoSortRows]) [scroll sortRows]; [scroll sizeToCells]; sprintf( namebuff, "%d files %lu bytes", [scroll numRows], totalBytes ); [countField setStringValue:namebuff]; [self updateButtons]; [[window reenableDisplay] display]; } //----------------------------------------------------------------------------- // - setPath: //----------------------------------------------------------------------------- - (void)setPath:(char const*)dirname { NXZone* const z = [self zone]; int dirlen; if (path != 0) NXZoneFree( z, path ); if (dirname == 0) dirname = NXHomeDirectory(); if (dirname == 0) dirname = "/"; dirlen = strlen( dirname ) + 1; path = (char*) NXZoneMalloc( z, dirlen ); memcpy( path, dirname, dirlen ); [window setTitleAsFilename:path]; } //----------------------------------------------------------------------------- // - load: //----------------------------------------------------------------------------- - (void)load:(char const*)dirname { [self setPath:dirname]; [self fillScroll]; } //----------------------------------------------------------------------------- // - export: //----------------------------------------------------------------------------- - (id)export:(id)sender { [[MiscExporter commonInstance] exportTableScroll:scroll]; return self; } //----------------------------------------------------------------------------- // - print: //----------------------------------------------------------------------------- - (id)print:(id)sender { [scroll printPSCode:self]; return self; } //----------------------------------------------------------------------------- // - openSelected: //----------------------------------------------------------------------------- - (id)openSelected:(id)sender { if ([scroll hasRowSelection]) { int i; int len; char buff[ FILENAME_MAX + 1 ]; MiscIntList* list = [[MiscIntList allocFromZone:[self zone]] init]; strcpy( buff, path ); len = strlen( buff ); if (len == 0 || buff[len - 1] != '/') { buff[ len++ ] = '/'; buff[ len ] = '\0'; } [scroll selectedRows:list]; for (i = [list count]; i-- > 0; ) { int row = [list intAt:i]; strcpy( buff + len, [[scroll cellAt:row:NAME_SLOT] stringValue] ); if ([self isDir:row]) [[self class] launchDir:buff]; else [[Application workspace] openFile:buff]; } [list free]; } return self; } //----------------------------------------------------------------------------- // - destroy: //----------------------------------------------------------------------------- - (id)destroy:(id)sender { if (writable && [scroll hasRowSelection]) { if (NXRunAlertPanel( "Delete Files", "Delete selected files?", "Yes", "No", 0 ) == NX_ALERTDEFAULT) { size_t totalLen = 0; char* fileList; int i; NXZone* const z = [self zone]; MiscIntList* list = [[MiscIntList allocFromZone:z] init]; [scroll selectedRows:list]; for (i = [list count]; i-- > 0; ) { int const row = [list intAt:i]; char const* s = [[scroll cellAt:row:NAME_SLOT] stringValue]; if (s != 0) totalLen += strlen(s) + 1; } fileList = (char*) NXZoneMalloc( z, totalLen + 1 ); totalLen = 0; for (i = [list count]; i-- > 0; ) { int row = [list intAt:i]; char const* s = [[scroll cellAt:row:NAME_SLOT] stringValue]; if (s != 0) { int const len = strlen(s); strcpy( fileList + totalLen, s ); totalLen += len; fileList[ totalLen++ ] = '\t'; } } fileList[ totalLen ] = '\0'; [[Application workspace] performFileOperation:WSM_DESTROY_OPERATION source:path destination:"" files:fileList options:""]; NXZoneFree( z, fileList ); [list free]; [self fillScroll]; } } return self; } //----------------------------------------------------------------------------- // - rename:to:msg:sys: //----------------------------------------------------------------------------- - (BOOL)rename:(char const*)oldName to:(char const*)newName msg:(char const**)msg sys:(char const**)sys { BOOL ok = NO; char oldPath[ MAXPATHLEN ]; char newPath[ MAXPATHLEN ]; struct stat st; int pathLen; int rc; pathLen = strlen( path ); assert( pathLen > 0 ); memcpy( oldPath, path, pathLen ); memcpy( newPath, path, pathLen ); if (oldPath[ pathLen - 1 ] != '/') { oldPath[ pathLen ] = '/'; newPath[ pathLen ] = '/'; pathLen++; } strcpy( oldPath + pathLen, oldName ); strcpy( newPath + pathLen, newName ); rc = stat( newPath, &st ); if (rc == 0) *msg = "Filename in use."; else if (errno != ENOENT) { *msg = "stat(): "; *sys = strerror( errno ); } else // (rc != 0 && errno == ENOENT) { rc = rename( oldPath, newPath ); if (rc == 0) ok = YES; else { *msg = "rename(): "; *sys = strerror( errno ); } } return ok; } //----------------------------------------------------------------------------- // - textWillEnd: //----------------------------------------------------------------------------- - (BOOL)textWillEnd:(id)sender { BOOL reject = YES; int r,c,len; char const* errMsg; char const* sysErr; char const* oldName; char* newName; r = [scroll clickedRow]; c = [scroll clickedCol]; assert( c == NAME_SLOT ); oldName = [[scroll cellAt:r:c] stringValue]; if (oldName == 0) oldName = ""; len = [sender textLength]; if (len == 0) errMsg = "Filename cannot be the empty string."; else if (len + 1 + strlen(path) >= MAXPATHLEN) errMsg = "Filename too long."; else { newName = (char*) malloc( len + 1 ); assert( newName != 0 ); [sender getSubstring:newName start:0 length:len + 1]; if (strcmp( newName, oldName ) == 0) reject = NO; // Unchanged, silently ignore. else if (strcmp( newName, ".." ) == 0 || strcmp( newName, "." ) == 0 || strchr( newName, '/' ) != 0) errMsg = "Illegal filename."; else reject = ![self rename:oldName to:newName msg:&errMsg sys:&sysErr]; free( newName ); } if (reject) { if (sysErr == 0) sysErr = ""; NXRunAlertPanel( "Error", "%s%s", "OK", 0, 0, errMsg, sysErr ); [sender setText:oldName]; } return reject; } //----------------------------------------------------------------------------- // - refreshPressed: //----------------------------------------------------------------------------- - (id)refreshPressed:(id)sender { [scroll abortEditing]; [self fillScroll]; return self; } //----------------------------------------------------------------------------- // - cdPressed: //----------------------------------------------------------------------------- - (id)cdPressed:(id)sender { [scroll abortEditing]; if ([scroll numSelectedRows] == 1) { MiscCoord_P const row = [scroll selectedRow]; if ([self isDir:row]) { char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, path ), "/" ), [[scroll cellAt:row:NAME_SLOT] stringValue] ); normalize_path( buff, sizeof(buff) ); [self load:buff]; } } return self; } //----------------------------------------------------------------------------- // - rowNumbersClick: //----------------------------------------------------------------------------- - (id)rowNumbersClick:(id)sender { BOOL const newVal = ([rowNumbersSwitch state] != 0); BOOL const oldVal = [scroll rowTitlesOn]; if (newVal != oldVal) { DEFAULT_ROW_NUMBERS = newVal; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [Defaults set:ROW_NUMBERS_DEF bool:DEFAULT_ROW_NUMBERS]; } return self; } //----------------------------------------------------------------------------- // - autoSortClick: //----------------------------------------------------------------------------- - (id)autoSortClick:(id)sender { BOOL const switchState = [autoSortSwitch state]; [scroll abortEditing]; if (autoSort != switchState) { DEFAULT_AUTO_SORT = autoSort = switchState; [Defaults set:SORT_DEF bool:DEFAULT_AUTO_SORT]; [scroll setAutoSortRows:switchState]; if (switchState) [scroll sortRows]; } return self; } //----------------------------------------------------------------------------- // - hiddenFilesClick: //----------------------------------------------------------------------------- - (id)hiddenFilesClick:(id)sender { BOOL const switchState = [hiddenFilesSwitch state]; [scroll abortEditing]; if (showHidden != switchState) { DEFAULT_SHOW_HIDDEN = showHidden = switchState; [Defaults set:HIDDEN_DEF bool:DEFAULT_SHOW_HIDDEN]; [self fillScroll]; } return self; } //----------------------------------------------------------------------------- // - highlightClick: //----------------------------------------------------------------------------- - (id)highlightClick:(id)sender { BOOL const switchState = [highlightSwitch state]; [scroll abortEditing]; if (highlightDirs != switchState) { DEFAULT_HIGHLIGHT_DIRS = highlightDirs = switchState; [Defaults set:HLIGHT_DEF bool:DEFAULT_HIGHLIGHT_DIRS]; [self highlightDirs:highlightDirs]; [scroll display]; } return self; } //----------------------------------------------------------------------------- // - dragUnscaledClick: //----------------------------------------------------------------------------- - (id)dragUnscaledClick:(id)sender { BOOL const switchState = [dragUnscaledSwitch state]; if (dragUnscaled != switchState) { DEFAULT_DRAG_UNSCALED = dragUnscaled = switchState; [Defaults set:UNSCALED_DEF bool:DEFAULT_DRAG_UNSCALED]; } return self; } //----------------------------------------------------------------------------- // - lockClick: //----------------------------------------------------------------------------- - (id)lockClick:(id)sender { if ([sender autoSortRows]) [sender sortRow:[sender clickedRow]]; return self; } //----------------------------------------------------------------------------- // - scrollClick: //----------------------------------------------------------------------------- - (id)scrollClick:(id)sender { [self updateButtons]; return self; } //----------------------------------------------------------------------------- // - scrollDoubleClick: //----------------------------------------------------------------------------- - (id)scrollDoubleClick:(id)sender { [self openSelected:sender]; return self; } //----------------------------------------------------------------------------- // - activateWindow //----------------------------------------------------------------------------- - (void)activateWindow { [window makeKeyAndOrderFront:0]; } //----------------------------------------------------------------------------- // - windowWillClose: //----------------------------------------------------------------------------- - (id)windowWillClose:(id)sender { [scroll abortEditing]; [OPEN_DIRS removeObject:self]; [NXApp delayedFree:self]; return self; } //----------------------------------------------------------------------------- // - windowDidResize: //----------------------------------------------------------------------------- - (id)windowDidResize:(id)sender { NXRect r; [sender getFrame:&r]; if (r.size.width != DEFAULT_WIN_SIZE.width || r.size.height != DEFAULT_WIN_SIZE.height) { DEFAULT_WIN_SIZE = r.size; [Defaults set:SIZE_DEF size:DEFAULT_WIN_SIZE]; } return self; } //----------------------------------------------------------------------------- // - setDefaultColor: //----------------------------------------------------------------------------- - (void)setDefaultColor:(NXColor)c { DEFAULT_COLOR = c; [Defaults set:COLOR_DEF color:c]; } //----------------------------------------------------------------------------- // - setColors: //----------------------------------------------------------------------------- - (void)setColors:(NXColor)c { [window disableDisplay]; [window setBackgroundColor:c]; [scroll setColor:c]; [window reenableDisplay]; } //----------------------------------------------------------------------------- // - draggingEntered: //----------------------------------------------------------------------------- - (NXDragOperation)draggingEntered:(id)sender { return ([sender draggingSourceOperationMask] & NX_DragOperationGeneric); } //----------------------------------------------------------------------------- // - performDragOperation: //----------------------------------------------------------------------------- - (BOOL)performDragOperation:(id)sender { [self setDefaultColor: NXReadColorFromPasteboard( [sender draggingPasteboard] )]; [self setColors:DEFAULT_COLOR]; [window display]; return YES; } //----------------------------------------------------------------------------- // - initDefaults //----------------------------------------------------------------------------- - (void)initDefaults { static BOOL initialized = NO; if (!initialized) { NXRect r; [window getFrame:&r]; DEFAULT_WIN_SIZE = r.size; DEFAULT_FONT = [Defaults getFont:FONT_DEF fallback:[scroll font]]; initialized = YES; } } //----------------------------------------------------------------------------- // - loadDefaults //----------------------------------------------------------------------------- - (void)loadDefaults { NXRect r; char const* s; [window getFrame:&r]; r.size = [Defaults getSize:SIZE_DEF fallback:DEFAULT_WIN_SIZE]; [window placeWindow:&r]; autoSort = DEFAULT_AUTO_SORT; showHidden = DEFAULT_SHOW_HIDDEN; highlightDirs = DEFAULT_HIGHLIGHT_DIRS; dragUnscaled = DEFAULT_DRAG_UNSCALED; [autoSortSwitch setState:autoSort]; [hiddenFilesSwitch setState:showHidden]; [highlightSwitch setState:highlightDirs]; [dragUnscaledSwitch setState:dragUnscaled]; [rowNumbersSwitch setState:DEFAULT_ROW_NUMBERS]; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [scroll setAutoSortRows:autoSort]; [scroll setFont:DEFAULT_FONT]; [self setColors:DEFAULT_COLOR]; s = [Defaults getStr:COL_SIZES_DEF fallback:0]; if (s) [scroll setColSizesFromString:s]; s = [Defaults getStr:COL_ORDER_DEF fallback:0]; if (s) [scroll setColOrderFromString:s]; } //----------------------------------------------------------------------------- // - initLockSlot //----------------------------------------------------------------------------- - (void)initLockSlot { id proto = [scroll colCellPrototype:LOCK_SLOT]; [proto setType:NX_SWITCH]; [proto setIconPosition:NX_ICONONLY]; [proto setTarget:self]; [proto setAction:@selector(lockClick:)]; [proto setImage:LOCKED_ICON]; [proto setAltImage:UNLOCKED_ICON]; } //----------------------------------------------------------------------------- // - initNameSlot //----------------------------------------------------------------------------- - (void)initNameSlot { id proto = [scroll colCellPrototype:NAME_SLOT]; [proto setEditable:YES]; [proto setScrollable:YES]; } //----------------------------------------------------------------------------- // - initSlots //----------------------------------------------------------------------------- - (void)initSlots { [self initLockSlot]; [self initNameSlot]; [[scroll colCellPrototype:SIZE_SLOT] setAlignment:NX_RIGHTALIGNED]; [[scroll colCellPrototype:HARDLINKS_SLOT] setAlignment:NX_RIGHTALIGNED]; } //----------------------------------------------------------------------------- // - initWithDir: //----------------------------------------------------------------------------- - (id)initWithDir:(char const*)dirname { char buff[ FILENAME_MAX + 1 ]; NXZone* const z = [self zone]; [super init]; path = 0; [[NXBundle bundleForClass:[self class]] getPath:buff forResource:[[self class] name] ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:z]; [window registerForDraggedTypes:&NXColorPboardType count:1]; [self initSlots]; [self initDefaults]; [self loadDefaults]; [self load:dirname]; [OPEN_DIRS addObject:self]; [self cascade]; return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { return [self initWithDir:NXHomeDirectory()]; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { NXZone* const z = [self zone]; [window setDelegate:0]; [window close]; [window disableDisplay]; [self freeImages]; [window free]; if (path != 0) free( path ); [super free]; RETIRE_ZONE(z); return 0; } //----------------------------------------------------------------------------- // - path //----------------------------------------------------------------------------- - (char const*)path { return path; } //----------------------------------------------------------------------------- // + findDir: //----------------------------------------------------------------------------- + (DirWindow*)findDir:(char const*)normalizedPath { if (normalizedPath != 0) { unsigned int i; unsigned int const lim = [OPEN_DIRS count]; for (i = 0; i < lim; i++) { DirWindow* p = (DirWindow*) [OPEN_DIRS objectAt:i]; char const* s = [p path]; if (s != 0 && strcmp( s, normalizedPath ) == 0) return p; } } return 0; } //----------------------------------------------------------------------------- // + launchDir: //----------------------------------------------------------------------------- + (void)launchDir:(char const*)dirname { DirWindow* p = 0; char buff[ FILENAME_MAX + 1 ]; if (dirname == 0) dirname = NXHomeDirectory(); if (dirname == 0) dirname = "/"; strncpy( buff, dirname, sizeof(buff) ); buff[ sizeof(buff) - 1 ] = '\0'; normalize_path( buff, sizeof(buff) ); if ((p = [self findDir:buff]) == 0) p = [[self allocFromZone:EMPLOY_ZONE()] initWithDir:buff]; [p activateWindow]; } @end MiscKit/Examples/ScrollDir/HISTORY.txt100444 1750 1750 23777 6757716233 20047 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir HISTORY // $Id: HISTORY.txt,v 1.9 99/06/29 08:15:22 sunshine Exp $ //----------------------------------------------------------------------------- v35 1999/06/25 08:13 EDT sunshine@sunshineco.com Synchronized with ScrollDir v35.1 for OpenStep. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Reorganized DirWindow.nib layout to match OpenStep counterpart. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Updated copyrignt on Info panel. Updated copyright and contact information in README. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Added copyright notice to ScrollDir_main.m. PB.project no longer generates main() file upon save. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Now correctly uses -tableScroll:changeFont:to: rather than -tableScroll:fontChangedFrom:to: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Superscript, Subscript, and Unscript from Font menu since they made no sense in this context. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Ported back to NextStep 3.2. Had to add -I & -L directives to OTHER_CFLAGS & OTHER_LDFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize these directives when specified via NextStep 3.3's Project Builder. Changed Files: * DirController.{h|m} * DirWindows.{h|m|nib} * Info.nib * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf * ScrollDir.nib * ScrollDir_main.m * SD_PageLayout.{h|m|nib} + unpack.sh v34 1998/03/23 22:59 EST sunshine@sunshineco.com Implemented -tableScroll:draggingSourceOperationMaskForLocal: since the default value changed from Copy to Generic in MiscTableScroll v126. Added -tableScrollIgnoreModifierKeysWhileDragging:, which returns NO. Updated copyright notices on user interface items. Added a "Printing" section to the README. Added license and contact information to the README. Changed Files: * DirWindow.m * Info.nib * Makefile * PB.project * README.rtf v33 1997/11/24 17:05 EST sunshine@sunshineco.com Synchronized with LazyScrollDir v17 for NEXTSTEP. Fixed miminum window size of DirWindow. Unified formatting. Changed Files: * DirWindow.{m|nib} v32 1997/11/14 12:05 EST zarnuk@zarnuk.com Added row-numbers switch. Changed Files: * DirWindow.{h|m|nib} v31 1997/07/08 12:00 EDT sunshine@sunshineco.com Moved include and libarary paths from Makefile.preamble into PB.project. Added /LocalDeveloper/Headers to include paths. Added /LocalDeveloper/Libraries to library paths. Moved -Wwrite-strings from Makefile.preamble into PB.project. Removed hard-coded names from 'relink' target in Makefile.postamble. Worked around AppKit but where the Cell class blindly allocates ClipViews from transient zones and caches them for later re-use. Changed Files: * DirWindow.m * Makefile * Makefile.{preamble|postamble} * PB.project v30 1997/06/10 05:09 EDT sunshine@sunshineco.com Synchronized with ScrollDir v29.4 for OPENSTEP. Restructured DirWindow.m to parallel LazyScrollDir counterpart. Now sets window title with -setTitleAsFilename:. Fixed bug: Wasn't taking "sticky bit" on directories into account when computing whether file could be renamed. No longer misleadingly stat()'s the file which a soft-link points at. Ditched the Message slot. Changed Files: * DirWindow.{m|nib} * pack.sh * pack_binaries.sh * unpack_binaries.sh v29 1997/02/05 04:04 EST sunshine@sunshineco.com Synchronized with LazyScrollDir v13 for NEXTSTEP. Fixed order of headers in ScrollDir.m. Fixed order of headers in DirWindow.m. If directory is readonly then no longer responds to Delete (cmd-r). Removed deviant semi-colon from NameCache.h. Removed deviant semi-colon from -tableScroll:border:slotDraggedFrom:to: in DirWindow.m. Reorganized main menu to be consistent with other NEXTSTEP applications. Recreated missing PB.gdbinit. Changed Files: * Defaults.m * DirWindow.{h|m} * NameCache.h + PB.gdbinit * ScrollDir.nib v28 1997/01/12 07:58 EST sunshine@sunshineco.com Added new delegate methods for support of dragging images out of cells. Added capability to drag scaled or unscaled image from icon cell. Added new column which demonstrates how to use ButtonCell in TableScroll. Fixed wording on Info panel. Updated all the copyrights to include 1997 (including Info.nib). Unified formatting. Updated documentation to reflect the new features. Renamed: "Update" -> "Refresh" Checked all of the files into RCS. Added pack and unpack scripts. Changed Files: * Everything v27 1996/12/30 17:02 EST zarnuk@zarnuk.com Now works with MiscTableScroll v113. Added text-cell editing to rename files. Also added preliminary printing. v26 1996/10/07 09:39 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v109. Added Save command for exporting contents of TableScroll. v25 1996/10/07 09:38 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v105. Responds to new user slot-sort-reversed message. v24 1996/02/17 09:00 EST zarnuk@zarnuk.com Fixed includes since MiscTableScroll.h no longer includes MiscIntList.h v23 1996/02/09 01:00 EST sunshine@sunshineco.com Replaced NameCache's custom hash table with NeXT's HashTable. Info panel will now load README.rtf or README.rtfd. Updated README. v22 1996/02/01 04:15 EST sunshine@sunshineco.com Added Defaults.[mh] as simple front-end to NeXT defaults. The following are now saved and restored via NeXT defaults: Auto-sort Column order Column widths Font Highlight directories Show hidden Window color Window size Added a README.rtf file which explains what this example demonstrates. Added an Info panel that displays the README.rtf file. v21 1996/01/17 05:30 EST sunshine@sunshineco.com Fixed warning that showed up when compiling for debug. Had to replace (int const) with #define for array size. v20 1996/01/17 04:30 EST zarnuk@zarnuk.com Added NameCache code from LazyScrollDir. Small performance improvement. Asking the Workspace for the icons is the real time killer. v19 1996/01/17 02:00 EST sunshine@sunshineco.com Removed mcgh2misc conversions scripts since the one in the palette directory now handles the example directories automatically. v18 1996/01/16 01:00 EST zarnuk@zarnuk.com Fixed bug: Now calls -setImage:0 before freeing the image that was in the cell before. This was the crasher that was generating the message: "objc: FREE(id): message getSize: sent to freed object" The bug was reproducible: (1) Create a non-empty selection. (2) Click on the close box. At step #2, -[DirWindow free] called -freeImages, which freed all the images, but left pointers to the freed images in the icon cells, then it called -[Window free] which ultimately called -[MiscTableScroll free] while it was freeing the views on the window... This invoked -emptyAndFreeCells, which called -empty, which called -renewRows:0, which called -clearSelection, which called -selectionChanged, which called -reflectSelection, which called -[MiscTableView reflectSelection] which tried to draw the cells in their unhighlighted state. (All this, despite the fact that the window had been closed, and was, in fact, about to be freed.) v17 1996/01/08 21:00 EST zarnuk@zarnuk.com Fixed bug: Was not closing directory after scanning it. Fixed bug: Was not freeing images. v16 1995/10/20 13:30 EDT sunshine@sunshineco.com Added missing implementation for -new:. Now it uses the OpenPanel to select the directory you want to view. v15 1995/10/20 04:30 EDT sunshine@sunshineco.com Prepared for inclusion in MiscKit. Added mcgh2misc conversion scripts. Fixed Makefile.preamble's -I and -L flags to work with MiscKit also. Added libMiscTableScroll.a directly to the Project so that Project Builder handles it instead of manually adding it to the Makefile.preamble. Added an application icon. Localized nibs. v14 1995/10/19 02:30 EDT sunshine@sunshineco.com Converted nib's TableScroll class version number from 3 to 0. I changed the version number in TableScroll itself some time ago and converted this nib, but apparently I forgot to cut a new version of ScrollDir. (So essentially this nib could not be loaded in IB, or elsewhere.) Updated DirWindow.m to reflect fact that -cellAt:: methods in TableScroll now return (id) instead of (Cell*). v13 1995/10/01 17:15 EDT zarnuk@zarnuk.com Directory highlight now extends to include the "message" column. Now suppresses display while re-loading the directory. v12 1995/10/01 15:30 EDT sunshine@sunshineco.com Can now drag color swatches into window. Added "highlight dirs" switch which sets the color on cells which show directories. This was done to test individual cell colors to make sure that they don't get changed when a swatch is dropped on the window. v11 1995/09/26 04:00 EDT sunshine@sunshineco.com Now imports newly public header . Old MiscTableCell protocol went away. v10 1995/09/26 04:00 EDT sunshine@sunshineco.com "Change Dir" button is now enabled only when a single directory is selected. MiscKit/Examples/ScrollDir/Pagination.HAuto.VAuto.tiff100444 1750 1750 406 6757716224 23104 0ustar sunshinesunshineMM*8€? J¨ùÝUBa0ˆ, ‚@á°ˆ‚ê-UE—Qˆ€?àP8$ „BaP˜æ îöþ(R)! ü€' ü€'MiscKit/Examples/ScrollDir/ScrollDir.tiff100444 1750 1750 14004 6757716226 20675 0ustar sunshinesunshineMM*ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿU_U_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯U_U_U_U_U_ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ª¯ 00ª²º(RB ü€' ü€'ªªªªªªªªªª¿ÿÿÿÿÿÿÿÿüµMMUMUMU5TµMMUMUMU5TµMMUMUMU5T° 0¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ô°îîîîîîîä¿ÿÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÕÿõÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿÕÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿUÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÕýUÿÿ¿ôµOïÿïÿïÿÿô° »»ªª«»»´¿ÿïÿꪯÿÿôµOÿÿéU¯ÿ¿ôµOïÿꪯÿÿô° »»ªª«»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµUUUUUUUUT€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00äìôü(RÂ@@ ü€' ü€'MiscKit/Examples/ScrollDir/Makefile100444 1750 1750 3234 6757716234 17550 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = ScrollDir PROJECTVERSION = 1.1 LANGUAGE = English APPICON = ScrollDir.tiff LOCAL_RESOURCES = DirWindow.nib Info.nib ScrollDir.nib\ SD_PageLayout.nib GLOBAL_RESOURCES = Align.HCentered.VCentered.tiff\ Align.HCentered.VTop.tiff Align.HLeft.VCentered.tiff\ Align.HLeft.VTop.tiff Lock.insecure.tiff\ Lock.secure.tiff Pagination.HAuto.VAuto.tiff\ Pagination.HAuto.VClip.tiff Pagination.HAuto.VFit.tiff\ Pagination.HClip.VAuto.tiff\ Pagination.HClip.VClip.tiff Pagination.HClip.VFit.tiff\ Pagination.HFit.VAuto.tiff Pagination.HFit.VClip.tiff\ Pagination.HFit.VFit.tiff PACKAGE_NUMBER README.rtf CLASSES = Defaults.m DirController.m DirWindow.m NameCache.m\ SD_PageLayout.m HFILES = Defaults.h DirController.h DirWindow.h NameCache.h\ SD_PageLayout.h MFILES = ScrollDir_main.m OTHERSRCS = Makefile Makefile.postamble Makefile.preamble MAKEFILEDIR = /NextDeveloper/Makefiles/app MAKEFILE = app.make INSTALLDIR = $(HOME)/Apps INSTALLFLAGS = -c -s -m 755 SOURCEMODE = 444 ICONSECTIONS = -sectcreate __ICON app ScrollDir.tiff LIBS = -lMedia_s -lMiscTableScroll -lNeXT_s DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit/Examples/ScrollDir/Makefile.postamble100444 1750 1750 1646 6757716216 21542 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.postamble # $Id: Makefile.postamble,v 1.3 99/06/29 08:05:57 sunshine Exp $ #------------------------------------------------------------------------------ relink: -rm $(PRODUCT_ROOT)/$(NAME) $(MAKE) MiscKit/Examples/ScrollDir/Makefile.preamble100444 1750 1750 3074 6757716234 21340 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.3 99/06/29 08:05:50 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # As of NextStep 3.3, -I & -L directives, and other CFLAGS settings can be # configured directly in Project Builder. However, in order to support # NextStep 3.2 which does not have such a facility, we still need to specify # these values here. #------------------------------------------------------------------------------ OTHER_CFLAGS = -Werror -Wwrite-strings \ -I../MiscTableScroll -I../../Headers -I../../../Headers \ -I../../Palettes/MiscTableScroll -I/LocalDeveloper/Headers OTHER_LDFLAGS = -L../MiscTableScroll -L../../../Libraries \ -L../../Palettes/MiscTableScroll -L/LocalDeveloper/Libraries \ -L/LocalLibrary/lib MiscKit/Examples/ScrollDir/NameCache.h100444 1750 1750 3233 6757716216 20064 0ustar sunshinesunshine#ifndef __NameCache_h #define __NameCache_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // NameCache.h // // Data structure and routines for caching user names and group names. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: NameCache.h,v 1.2 97/02/05 08:12:22 sunshine Exp $ // $Log: NameCache.h,v $ // Revision 1.2 97/02/05 08:12:22 sunshine // v29: Removed deviant semi-colon. // // Revision 1.1 97/01/12 15:19:47 sunshine // v28: Name cache. //----------------------------------------------------------------------------- #import @class HashTable; @interface NameCache : Object { HashTable* table; } - (char const*)lookup:(int)ident; @end @interface OwnerCache : NameCache // user name (owner) cache. + (id)commonInstance; @end @interface GroupCache : NameCache // group name cache. + (id)commonInstance; @end #endif // __NameCache_h MiscKit/Examples/ScrollDir/NameCache.m100444 1750 1750 13005 6757716216 20107 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // NameCache.m // // Data structure and routines for caching user names and group names. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: NameCache.m,v 1.1 97/01/12 15:19:44 sunshine Exp $ // $Log: NameCache.m,v $ // Revision 1.1 97/01/12 15:19:44 sunshine // v28: Name cache. // //----------------------------------------------------------------------------- #import "NameCache.h" #import #import #import #import // vm_page_size #import static NXZone* theZone = 0; //----------------------------------------------------------------------------- // store_string //----------------------------------------------------------------------------- static char const* store_string( char const* s ) { char* t = 0; if (s != 0) t = NXCopyStringBufferFromZone( s, theZone ); return t; } //----------------------------------------------------------------------------- // str_int //----------------------------------------------------------------------------- static char const* str_int( int x ) { static char buff[ 32 ]; sprintf( buff, "%d", x ); return buff; } //============================================================================= // NAME CACHE //============================================================================= @implementation NameCache //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (theZone == 0) theZone = NXCreateZone( vm_page_size, vm_page_size, NO ); return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; table = [[HashTable alloc] initKeyDesc:"i" valueDesc:"*"]; return self; } //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)x { [self subclassResponsibility:_cmd]; return 0; } //----------------------------------------------------------------------------- // - store: //----------------------------------------------------------------------------- - (char const*)store:(int)ident { char const* name = store_string( [self resolve:ident] ); [table insertKey:(void const*)ident value:(void*)name]; return name; } //----------------------------------------------------------------------------- // - lookup: //----------------------------------------------------------------------------- - (char const*)lookup:(int)ident { char const* name = 0; if ([table isKey:(void const*)ident]) name = [table valueForKey:(void const*)ident]; else name = [self store:ident]; return name; } @end //============================================================================= // OWNER CACHE //============================================================================= @implementation OwnerCache //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)uid { char const* s = 0; struct passwd const* const pw = getpwuid( uid ); if (pw != 0) s = pw->pw_name; else s = str_int( uid ); return s; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (id)commonInstance { static id obj = 0; if (obj == 0) obj = [[self allocFromZone:theZone] init]; return obj; } @end //============================================================================= // GROUP CACHE //============================================================================= @implementation GroupCache //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)gid { char const* s = 0; struct group const* const gr = getgrgid( gid ); if (gr != 0) s = gr->gr_name; else s = str_int( gid ); return s; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (id)commonInstance { static id obj = 0; if (obj == 0) obj = [[self allocFromZone:theZone] init]; return obj; } @end MiscKit/Examples/ScrollDir/PACKAGE_NUMBER100444 1750 1750 3 6757716216 20045 0ustar sunshinesunshine35 MiscKit/Examples/ScrollDir/PB.gdbinit100444 1750 1750 166 6757716217 17735 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # view MiscKit/Examples/ScrollDir/PB.project100444 1750 1750 2602 6757716234 17777 0ustar sunshinesunshineINSTALLDIR = "$(HOME)/Apps"; APPICON = ScrollDir.tiff; COMPILEROPTIONS = ""; GENERATEMAIN = NO; DOCICONFILES = (); FILESTABLE = { M_FILES = (ScrollDir_main.m); OTHER_LINKED = (); H_FILES = (Defaults.h, DirController.h, DirWindow.h, NameCache.h, SD_PageLayout.h); CLASSES = (Defaults.m, DirController.m, DirWindow.m, NameCache.m, SD_PageLayout.m); IMAGES = (Align.HCentered.VCentered.tiff, Align.HCentered.VTop.tiff, Align.HLeft.VCentered.tiff, Align.HLeft.VTop.tiff, Lock.insecure.tiff, Lock.secure.tiff, Pagination.HAuto.VAuto.tiff, Pagination.HAuto.VClip.tiff, Pagination.HAuto.VFit.tiff, Pagination.HClip.VAuto.tiff, Pagination.HClip.VClip.tiff, Pagination.HClip.VFit.tiff, Pagination.HFit.VAuto.tiff, Pagination.HFit.VClip.tiff, Pagination.HFit.VFit.tiff); HEADERSEARCH = (); OTHER_RESOURCES = (PACKAGE_NUMBER, README.rtf); OTHER_SOURCES = (Makefile, Makefile.postamble, Makefile.preamble); PUBLIC_FILES = (); LIBRARYSEARCH = (); OTHER_LIBS = (Media_s, MiscTableScroll, NeXT_s); INTERFACES = (DirWindow.nib, Info.nib, ScrollDir.nib, SD_PageLayout.nib); }; APPCLASS = Application; MAINNIB = ScrollDir; LINKEROPTIONS = ""; DOCEXTENSIONS = (); PROJECTTYPE = Application; PROJECTVERSION = 1.1; LOCALIZABLE_FILES = { DirWindow.nib; ScrollDir.nib; Info.nib; SD_PageLayout.nib; }; PROJECTNAME = ScrollDir; SYSTEMEXTENSIONS = (); LANGUAGE = English; MiscKit/Examples/ScrollDir/Pagination.HAuto.VClip.tiff100444 1750 1750 414 6757716224 23062 0ustar sunshinesunshineMM*>€? J¨ùÝUBa%hbªV3CáP¸l># ‰¦£Q5Ti5€€€?àP8$ „BaP˜ì ôü(R.& ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HAuto.VFit.tiff100444 1750 1750 374 6757716225 22723 0ustar sunshinesunshineMM*.€* P8$ BUP—óºˆD`°€?àP8$ „BaP˜Ü äìô(R ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HClip.VAuto.tiff100444 1750 1750 410 6757716225 23057 0ustar sunshinesunshineMM*:€?ŠÅeT¬fƒ*¡P¨L…Ã"èLEtšMDUQxÌF€?àP8$ „BaP˜è ðø(R+# ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HClip.VClip.tiff100444 1750 1750 412 6757716225 23040 0ustar sunshinesunshineMM*<€?ŠÅeT¬fƒ*¡P¨f†Âá5T>#MFbJ¨Êj7€?àP8$ „BaP˜ê òú(R,$ ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HClip.VFit.tiff100444 1750 1750 376 6757716225 22704 0ustar sunshinesunshineMM*0€* P8$ ŠÊ¨IXÍ ƒÄbPX€?àP8$ „BaP˜Þ æîö(R  ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HFit.VAuto.tiff100444 1750 1750 402 6757716225 22713 0ustar sunshinesunshineMM*4€*•î¥T ‚Âa¸* †AáJ¸t)€€€?àP8$ „BaP˜â êòú(R% ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HFit.VClip.tiff100444 1750 1750 406 6757716225 22676 0ustar sunshinesunshineMM*8€*•î¥T ‚ÂUJST†Â¡q|N$ªTÅãx€?àP8$ „BaP˜æ îöþ(R)! ü€' ü€'MiscKit/Examples/ScrollDir/Pagination.HFit.VFit.tiff100444 1750 1750 374 6757716226 22536 0ustar sunshinesunshineMM*.€* P8$ Wº P˜\*ˆA €?àP8$ „BaP˜Ü äìô(R ü€' ü€'MiscKit/Examples/ScrollDir/README.rtf100444 1750 1750 15414 6757716234 17605 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs;} \paperw10980 \paperh10140 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\b\i0\ulnone\fs36\fc1\cf1 ScrollDir\ \b0\fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 ã \f0 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine\ June 25, 1999\ \ \b\fs28 Overview \fs24 \ \ \b0 This program demonstrates the use of MiscTableScroll in \i eager \i0 mode. It is a simple directory browser which supports basic operations such as \i open, delete, rename, \i0 and \i change directory \i0 .\ \ \ \b\fs28 Notable Features \fs24 \ \ Eager Mode\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b0\fc1\cf1 This example uses an \i eager \i0 mode MiscTableScroll which creates and fills all cells immediately. This differs from a \i lazy \i0 mode MiscTableScroll where the data-delegate is responsible for managing the cells. \i Eager \i0 mode is useful for fairly small data sets and data sets for which data retrieval time is small. \i Eager \i0 mode is usually easier to program than \i lazy \i0 mode.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b\fc1\cf1 \ Color \b0 \ The example shows how cells can inherit color from the MiscTableScroll itself, as well as maintain their own colors independently. Color swatches can be dragged from the \i Color Panel \i0 and dropped onto the browser window. The background of the MiscTableScroll is set to the color of the dropped swatch. All cells which inherit their color from the MiscTableScroll \i implicitly \i0 take the same background color. All cells which have had their color set \i explicitly \i0 retain their own color.\ \ The \i highlight directories \i0 switch on the browser window demonstrates that cells can maintain their own colors instead of inheriting them. When toggled \i on \i0 the rows for directories are highlighted in a color independent of the MiscTableScroll. \b \ \ Font\ \b0 When the MiscTableScroll is first-responder, the \i Font Panel \i0 can be used to change its font. Cells which inherit their font from the MiscTableScroll display the newly selected font. \b \ \ Users Preferences\ \b0 This program demonstrates how to save and restore the user's column order and width preferences. Additionally, all other user preferences -- \i font, color, \i0 \i switch settings \i0 , and \i window size -- \i0 are also saved and restored.\ \ \b Sorting\ \b0 A switch on the browser window controls whether or not rows are automatically sorted as columns are rearranged. This demonstrates the very powerful built-in sorting capability of MiscTableScroll. Sorting can be fine-tuned right in the \i nib \i0 file by adjusting the criteria on a column-by-column basis. For instance, columns may contribute \i stringValue, title, intValue, tag, \i0 etc. to the row-wise comparisons.\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b\fc1\cf1 Icon Display\ \b0 One column in the browser displays the file's icon. This demonstrates how to use \i icon \i0 columns in addition to \i text \i0 columns.\ \ \b Image Dragging\ \b0 MiscTableScroll allows images to be dragged directly out cells. In this example, the file's icon can be dragged directly from the directory browser into any other application which accepts \i dragged filenames \i0 , such as File Viewer, Mail, Edit, etc. A button controls whether or not the scaled or full-size image is used during the dragging operation. This illustrates how the delegate can optionally substitute an image in place of the one already contained in the cell.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc1\cf1 Text Editing\ \b0 MiscTableScroll supports \i in-cell \i0 text editing. This example program uses the editing feature to allow the user to rename files. Double-clicking with the mouse on the file name in the \i Name \i0 column initiates editing.\ \ \b Buttons\ \b0 This example illustrates how to use \i ButtonCells \i0 with the MiscTableScroll. One column contains a \i ButtonCell \i0 configured as a toggle switch. It displays a padlock in either a locked or unlocked state and clicking on it toggles its state. The padlock indicates whether or not the file can be renamed. When \i unlocked, \i0 renaming is allowed, and double-clicking on the file name in the \i Name \i0 column initiates an edit session. When \i locked, \i0 renaming is not allowed. If you do not have permission to rename a file the browser displays a \i locked \i0 icon and disables the \i ButtonCell \i0 .\ \ \b Exporting \b0 \ MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the \i Export \i0 menu item on the \i Directory \i0 menu.\ \ \b Printing \b0 \ MiscTableScroll respects the various page layout options, such as shrink-to-fit, spill, crop, centering, etc.\ \ \b Name Caching \b0 \ NetInfo is notoriously slow. Translation of user and group numbers into their text equivalents is sped up by caching the results of calls to \i getpwuid \i0 and \i getgrgid \i0 (both of which ultimately consult NetInfo).\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc1\cf1 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs28\fc1\cf1 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b0\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 ScrollDir was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 ã \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc1\cf1 · Paul S. McCarthy \f2\fs20 \f0\fs24 \ · Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 MIME, and ASCII mail accepted. \fs12 \ } MiscKit/Examples/ScrollDir/SD_PageLayout.h100444 1750 1750 3315 6757716221 20715 0ustar sunshinesunshine#ifndef __SD_PageLayout_h #define __SD_PageLayout_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // "SD_PageLayout.h" // // Custom subclass of AppKit's PageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.h,v 1.2 99/06/29 08:02:16 sunshine Exp $ // $Log: SD_PageLayout.h,v $ // Revision 1.2 99/06/29 08:02:16 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. Cleaned up comments. // //----------------------------------------------------------------------------- #import @class TextField, Matrix; @interface SD_PageLayout : PageLayout { Window* accessoryWindow; TextField* leftMarginField; TextField* topMarginField; TextField* rightMarginField; TextField* bottomMarginField; Matrix* centerMatrix; Matrix* paginationMatrix; } @end #endif // __SD_PageLayout_h MiscKit/Examples/ScrollDir/SD_PageLayout.m100444 1750 1750 14204 6757716221 20741 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.m // // Custom subclass of AppKit's PageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.m,v 1.2 99/06/29 08:02:04 sunshine Exp $ // $Log: SD_PageLayout.m,v $ // Revision 1.2 99/06/29 08:02:04 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. // Removed unused +launch method. Cleaned up comments. // //----------------------------------------------------------------------------- #import "SD_PageLayout.h" #import #import #import #import #import #import @implementation SD_PageLayout //----------------------------------------------------------------------------- // loadAccessoryView //----------------------------------------------------------------------------- - (void)loadAccessoryView { View* v; char buff[ FILENAME_MAX + 1 ]; [[NXBundle bundleForClass:[self class]] getPath:buff forResource:[[self class] name] ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:[self zone]]; v = [accessoryWindow setContentView:0]; [accessoryWindow close]; [accessoryWindow free]; [self setAccessoryView:v]; [[leftMarginField setTarget:ok] setAction:@selector(performClick:)]; [[rightMarginField setTarget:ok] setAction:@selector(performClick:)]; [[topMarginField setTarget:ok] setAction:@selector(performClick:)]; [[bottomMarginField setTarget:ok] setAction:@selector(performClick:)]; [bottomMarginField setNextText:[scale nextText]]; [scale setNextText:leftMarginField]; } //----------------------------------------------------------------------------- // +new //----------------------------------------------------------------------------- + (id)new { static id p = 0; if (p == 0) { p = [super new]; [p loadAccessoryView]; } return p; } //----------------------------------------------------------------------------- // pickedUnits: //----------------------------------------------------------------------------- - (id)pickedUnits:(id)sender { float old_factor, new_factor, scaler; [self convertOldFactor:&old_factor newFactor:&new_factor]; scaler = new_factor / old_factor; [leftMarginField setFloatValue: [leftMarginField floatValue] * scaler]; [rightMarginField setFloatValue: [rightMarginField floatValue] * scaler]; [topMarginField setFloatValue: [topMarginField floatValue] * scaler]; [bottomMarginField setFloatValue:[bottomMarginField floatValue] * scaler]; return [super pickedUnits:sender]; } //----------------------------------------------------------------------------- // pagination_to_slot //----------------------------------------------------------------------------- static int pagination_to_slot( int pg ) { int slot = 1; if (pg == NX_FITPAGINATION) slot = 0; else if (pg == NX_CLIPPAGINATION) slot = 2; return slot; } //----------------------------------------------------------------------------- // slot_to_pagination //----------------------------------------------------------------------------- static int slot_to_pagination( int slot ) { int pg = NX_AUTOPAGINATION; if (slot == 0) pg = NX_FITPAGINATION; else if (slot == 2) pg = NX_CLIPPAGINATION; return pg; } //----------------------------------------------------------------------------- // readPrintInfo //----------------------------------------------------------------------------- - (id)readPrintInfo { int pg_row, pg_col; float left,right,top,bottom; float old_factor, new_factor; id rc = [super readPrintInfo]; PrintInfo* pinfo = [NXApp printInfo]; [pinfo getMarginLeft:&left right:&right top:&top bottom:&bottom]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [leftMarginField setFloatValue:new_factor*left]; [rightMarginField setFloatValue:new_factor*right]; [topMarginField setFloatValue:new_factor*top]; [bottomMarginField setFloatValue:new_factor*bottom]; [centerMatrix selectCellAt:(int)[pinfo isVertCentered] :(int)[pinfo isHorizCentered]]; pg_row = pagination_to_slot( [pinfo vertPagination] ); pg_col = pagination_to_slot( [pinfo horizPagination] ); [paginationMatrix selectCellAt:pg_row:pg_col]; return rc; } //----------------------------------------------------------------------------- // writePrintInfo //----------------------------------------------------------------------------- - (id)writePrintInfo { id rc = [super writePrintInfo]; PrintInfo* pinfo = [NXApp printInfo]; float old_factor, new_factor; [self convertOldFactor:&old_factor newFactor:&new_factor]; [pinfo setMarginLeft:[leftMarginField floatValue] / old_factor right:[rightMarginField floatValue] / old_factor top:[topMarginField floatValue] / old_factor bottom:[bottomMarginField floatValue] / old_factor]; [pinfo setVertCentered: [centerMatrix selectedRow]]; [pinfo setHorizCentered:[centerMatrix selectedCol]]; [pinfo setHorizPagination: slot_to_pagination([paginationMatrix selectedCol])]; [pinfo setVertPagination: slot_to_pagination([paginationMatrix selectedRow])]; return rc; } @end MiscKit/Examples/ScrollDir/ScrollDir.iconheader100444 1750 1750 70 6757716221 21757 0ustar sunshinesunshineF ScrollDir.app ScrollDir app F ScrollDir ScrollDir app MiscKit/Examples/ScrollDir/ScrollDir_main.m100444 1750 1750 2357 6757716221 21170 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: ScrollDir_main.m,v 1.2 99/06/29 08:02:50 sunshine Exp $ // $Log: ScrollDir_main.m,v $ // Revision 1.2 99/06/29 08:02:50 sunshine // v35: Synchronized with ScrollDir v35.1 for OpenStep. Added copyright. // //----------------------------------------------------------------------------- #import void main( int argc, char const* const argv[] ) { [Application new]; if ([NXApp loadNibSection:"ScrollDir.nib" owner:NXApp withNames:NO]) [NXApp run]; [NXApp free]; exit(0); } MiscKit/Examples/ScrollDir/Align.HCentered.VTop.tiff100444 1750 1750 422 6757716223 22515 0ustar sunshinesunshineMM*D€* J¤¨VOß$øÀ …C!Ñ\6ŸƒCïøÔq?ŽÈR` U€?àP8$ „BaP˜ò ú (R5- ü€' ü€'MiscKit/Examples/ScrollDir/Align.HCentered.VCentered.tiff100444 1750 1750 426 6757716223 23510 0ustar sunshinesunshineMM*H€* J¤©TªVO¿ßï(L->CïÈ`ÀŠ'âш¬^†Ã!O$„@U@@€?àP8$ „BaP˜ö þ(R80 ü€' ü€'MiscKit/Examples/LazyScrollDir/ 40755 1750 1750 0 6757720166 16652 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/ 40755 1750 1750 0 6757716257 21376 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/DirWindow.nib/ 40755 1750 1750 0 6757716265 24052 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/DirWindow.nib/data.classes100444 1750 1750 1500 6735012314 26405 0ustar sunshinesunshineFirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; DirWindow = { ACTIONS = { "autoSortClick:" = "autoSortClick:"; "cdPressed:" = "cdPressed:"; "dragUnscaledClick:" = "dragUnscaledClick:"; "hiddenFilesClick:" = "hiddenFilesClick:"; "highlightClick:" = "highlightClick:"; "refreshPressed:" = "refreshPressed:"; "rowNumbersClick:" = "rowNumbersClick:"; "scrollClick:" = "scrollClick:"; "scrollDoubleClick:" = "scrollDoubleClick:"; }; OUTLETS = { autoSortSwitch = autoSortSwitch; cdButton = cdButton; countField = countField; dragUnscaledSwitch = dragUnscaledSwitch; hiddenFilesSwitch = hiddenFilesSwitch; highlightSwitch = highlightSwitch; refreshButton = refreshButton; rowNumbersSwitch = rowNumbersSwitch; scroll = scroll; window = window; }; SUPERCLASS = Object; }; MiscKit/Examples/LazyScrollDir/English.lproj/DirWindow.nib/data.nib100444 1750 1750 4721 6757716264 25553 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ DirWindow…† „@@„„„WindowTemplate”„ffffY«ê„ iiii***@s@‚ï„„Window„„View„„„ž„„ Responder”’…„f› «ꛫê’…’…„@ss@„„„List”„i „[9@]„„„MiscTableScroll„„ ScrollViewž’ ›Cž¡›ž¡’’…¡„¡£„[3@]„„„ClipViewž’¢ ›‡x›‡x’¢’…¡„¡£†P…„@fs„„„ MiscTableViewž’… ›ˆ›ˆ’…’…¡…@™@…†ƒUª*?€„c’…†„„„Scroller„„Controlž’¢ ›‡›‡’¢’…¡…™…„i@s…Ð’¢„ff:sƒx?„ _doScroller:°†„¬’¢ ››’¢’…¡…™…®…P’¢¯°††‰J…„@@@ffs®«¦ Ô£«««£’„„„Font”„%fss„ Helvetica †«Á„s«Áµ©ª«Áµ«Áµþ’…’…’…’…’…’…„*„„¶±¶…£««„I¬’¢£P£ £‚ÿ£££££ £‚ÿ££‡££ ££ £‚ÿ££x£ £‚ÿ£££ £‚ÿ££<£ £‚ÿ££d£ £‚ÿ££P£ £‚ÿ££<£ £‚ÿ££<£ £‚ÿ££(£ £‚ÿ££P£ £‚ÿ£„[10i]¹„[10*]…„„Name…„„Size„„Modified„„Perms„„Owner„„Group„„Links„„ Soft Link£««¸’¢££ £‚ÿ£££££ £‚ÿ££x£££ £†„„„Button­’ ›"B›B’’…¡…‰…®„„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„Traverse„°³´ €†’…„i:…„ssÈÇ……†„@fÁ†À†„»’ ›B›B’’…¡…‰…®„½Ç„„RefreshÁ’…É…ÊÈÇ……†ËÁ†À†„„„ TextField­’ ›ñ,µ›µ’’…¡… „…®„„„ TextFieldCell¾Ç„„9999 files 9999999 bytesÁ€’…É…„ffÿ««†À’…’…’…„:…†„»’ › š›š’’…¡…ˆ„…®„½Ç„„Show Hidden FilesÁ’…É…ÊÈÇ……8È™„„„NXImage”„s*p„„NXswitch†„ÎÔp„„ NXswitchH††Ð†„»’ ›†)q›q’’…¡…ˆ„…®„½Ç„„ Auto-SortÁ†’…É…ÊÈÇ……<È™ÍІІ„»’ › š›š’’…¡…ˆ„…®„½Ç„„Highlight DirectoriesÁ’…É…ÊÈÇ……8È™ÍІІ„»’ ›†q›q’’…¡…ˆ„…®„½Ç„„Drag Big ImagesÁ†’…É…ÊÈÇ……<È™ÍІІ„»’ ›†q›q’’…¡…ˆ„…®„½Ç„„ Row NumbersÁ’…É…ÊÈÇ……8È™ÍІІ†@…†x`…«›¼«Ð|´†•™˜™Ò™Õ™Û™Ø™Ê™¢™Å™º™Â£„@*•„„ File's OwnerÛ˜„£’„¡£„[21@]„„„IBOutletConnector„„ IBConnector”„@@*•˜„„window†„âà•¢„„scroll†„âà˜•„„delegate†„â࢕膄„„IBControlConnectorã࢕„„ scrollClick:†„âà•º„„cdButton†„ëຕ„„ cdPressed:†„âà•„„ refreshButton†„ëà•„„refreshPressed:†„âà•Å„„ countField†„âà•Ê„„hiddenFilesSwitch†„ëàÊ•„„hiddenFilesClick:†„âà•Ò„„autoSortSwitch†„ëàÒ•„„autoSortClick:†„âà•Õ„„highlightSwitch†„ëàÕ•„„highlightClick:†„âà•Ø„„dragUnscaledSwitch†„ëàØ•„„dragUnscaledClick:†„„„MiscTableConnectorë࢕„„scrollDoubleClick:¶„„ doubleTarget¶„„ doubleAction¶„ô†„âà•Û„„rowNumbersSwitch†„ëàÛ•„„rowNumbersClick:††’…†MiscKit/Examples/LazyScrollDir/English.lproj/Info.nib/ 40755 1750 1750 0 6735011526 23017 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/Info.nib/data.classes100444 1750 1750 246 6735011526 25364 0ustar sunshinesunshineDirController = { OUTLETS = {infoPanel = infoPanel; infoText = infoText; }; SUPERCLASS = Object; }; FirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscKit/Examples/LazyScrollDir/English.lproj/Info.nib/data.nib100444 1750 1750 3116 6757716264 24535 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ DirController…† „@@„„„ TextField„„Control„„View„„ Responder”’„›’…„f„ffff§Ÿ§’…’…„@ss@„„„List”„i„[6@]„„„Buttonš’žŸt00Ÿ00’’… …ˆ0…„i@s„„„ ButtonCell„„ ActionCell„„Cell”„*@ss…„„„Font”„%fss„ Helvetica €†+’…„i:…„ssÈ©……@‡™„„„NXImage”„s*b„„„app†…†Ð†˜„„„Box›’žŸŸ’’… „Ÿ¢„[1@]„›’«žŸŸ’«’… ……††ˆ…„ff„@@s„¥©„²¦†®À†„„„ ScrollView›’žŸ RŸ R’’… „Ÿ¢„[2@]„„„ClipView›’±žŸòNŸòN’±’… „Ÿ¢³„„„Text›’´žŸòNŸòN’´’… …¹` …’…ŸîN„ ciifffcfffsƒ«ªª>QS´ƒÊòIqƒÊòIq´òN¢¢¢w„[119c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} \margl40 \margr40 \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 } ††J…„@fs·€„c’„„„NXCursor”´ø„s@„©°p„„NXibeam†††„„„Scrollerš’±žŸNŸN’±’… …™…¥…P’±„ff:s„ _doScroller:††‰J…„@@@ffs½…´ „†„¬’žŸnŸ’’… „Ÿ¢³„›’¿žŸŸ’¿’… ……††(…´µ„¥©„²¦†ÁÀ†„™’žŸ;€ûŸû’’… … 0…¥„„„ TextFieldCell¤©„„MiscTableScroll Example„§«¬†’…­…´ÿ½½†À’…’…’…„:…††…†žŸ‚‹ Ÿ‹ ’’… …„…¥„Æ©„„LCopyright (C) 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine„§«¬ †€’…­…´ƒ«ª*?½½†À’…’…’…Ç…†™·±™Á¿™„„„WindowTemplate”Ÿo¡§„ iiii***@s@‚ï„„Info„œ„„Panelx`…½Ÿ¼½´´†•™ ™Ì™«™¿™®«™Ä™±¢„@*•„„ File's OwnerÍ̄ˢ’„Ÿ¢·„„„IBOutletConnector„„ IBConnector”„@@*•Ì„„ infoPanel†„ÕÑ•·„„infoText††’…†MiscKit/Examples/LazyScrollDir/English.lproj/LazyScrollDir.nib/ 40755 1750 1750 0 6735011307 24656 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/LazyScrollDir.nib/data.classes100444 1750 1750 540 6735011307 27220 0ustar sunshinesunshineDirController = { ACTIONS = {"info:" = "info:"; "openDirectory:" = "openDirectory:"; }; SUPERCLASS = Object; }; FirstResponder = { ACTIONS = { "destroy:" = "destroy:"; "export:" = "export:"; "inspect:" = "inspect:"; "new:" = "new:"; "openSelected:" = "openSelected:"; "print:" = "print:"; }; SUPERCLASS = Object; }; MiscKit/Examples/LazyScrollDir/English.lproj/LazyScrollDir.nib/data.nib100444 1750 1750 6053 6735011307 26360 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ Application…†-„@@„„„MenuCell„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„Miniaturize Window„„„Font”„%fss„ Helvetica †’…„i:…„ssÈž……©m„@fž’…„:…†„„„Matrix„„Control„„View„„ Responder”’…„f„ffff‰<¬‰<’…’…„@ss@……„i@s…Ø’…’…’…’…„@:@iiii„„„List”„i„[3@]„™ž„„Arrange in Frontž’…£…¤Èž……©¥ž’…¦…†˜„™ž„„ Close Windowž’…£…¤Èž……©w¥ž’…¦…††……ÿÿ„ff‰µ„ff@@#::sÿÿ……™……„c·†™ „„„ MenuTemplate”’„¬’…µ%T„*@*@ccc„„ LazyScrollDir„¡’…«¬mȬmÈ’…’…­……®…Ø’…’…’…’…¯„¦± „[10@]„™ž„„Info...ž’…£…¤Èž……©¥ž’…¦…†„™ž„„ Directoryž’„¬’­µ’ô¹„½„¡’…«¬U(¬U(’…’…­……®…È’…’…’…’…¯„¦±„[2@]„™ž„„Open...ž’…£…¤Èž……©o¥ž’…¦…†„™ž„„ Export...ž’…£…¤Èž……©s¥ž’…¦…††……ÿÿµUµ¶ÿÿ……™……··†„„Menu…†£„submenuAction:¤Èž……¨™„„„NXImage”„s*p„„ NXmenuArrow†…’µ¦…†„™ž„„Filež’„¬’­µ’ô¹„Æ„¡’…«¬A(¬A(’…’…­……®…È’…’…’…’…¯„¦±¾„™ž„„Openž’…£…¤Èž……©O¥ž’…¦…†„™ž„„Deletež’…£…¤Èž……©r¥ž’…¦…††……ÿÿµAµ¶ÿÿ……™……··†„Á…†£Â¤Èž……¨™¾…’æ…†„™ž„„Editž’„¬’­µ’̹„É„¡’…«¬RP¬RP’…’…­……®…Ø’…’…’…’…¯„¦±„[4@]„™ž„„Cutž’…£…¤Èž……©x¥ž’…¦…†„™ž„„Copyž’…£…¤Èž……©c¥ž’…¦…†„™ž„„Pastež’…£…¤Èž……©v¥ž’…¦…†„™ž„„ Select Allž’…£…¤Èž……©a¥ž’…¦…††……ÿÿµRµ¶ÿÿ……™……··†„Á…†£Â¤Èž……¨™¾…’Φ…†„™ž„„Formatž’„¬’­µ’ไτ¡’…«¬m<¬m<’…’…­……®…Ø’…’…’…’…¯„¦±²„™ž„ ž’„¬’ݵไ „¡’…«¬c<¬c<’…’…­……®…È’…’…’…’…¯„¦±²„™ž„„ Font Panel...ž’…£…¤Èž……©t¥ž’…¦…†„™ž„„Boldž’…£…¤Èž……©b¥ž’…¦…†„™ž„„Italicž’…£…¤Èž……©i¥ž’…¦…††……ÿÿµcµ¶ÿÿ……™……··†„Á…†£Â¤Èž……¨™¾…’㦅†„™ž„„ Colors...ž’…£…¤Èž……©C¥ž’…¦…†„™ž„„Page Layout...ž’…£…¤Èž……©P¥ž’…¦…††……ÿÿµmµ¶ÿÿ……™……··†„Á…†£Â¤Èž……¨™¾…’ݦ…†„™ž„„Windowsž’«£Â¤Èž……¨™¾…’«¦…†„™ž„„Print...ž’…£…¤Èž……©p¥ž’…¦…†„™ž„„Servicesž’„¬’­µ’¹„ׄ¡’…«¬R¬R’…’…­……®…Ø’…’…’…’…¯„¦±†……ÿÿµRµ¶ÿÿ……™……··†„Á…†£Â¤Èž……¨™¾…’ù¦…†„™ž„„Hidež’…£…¤Èž……©h¥ž’…¦…†„™ž„„Quitž’…£…¤Èž……©q¥ž’…¦…††……ÿÿ µmµ¶ÿÿ……™……··†„Á…†µ’ไՠ„Á…†™ÒЙµ³™© ™ÔЙéå™Ì¯™ßÝ™§ ™ëå™þ¯™ÇÅ™ÝÛ™«ó™ðß™ó¯™ãá™áß™ÎÌ™õ¯™ÖЙûù™ÐΙ¹·™·µ™³¯™»·™ù÷™÷¯™¯­™åã™îß™¯™„–—„„ DirController…†•™ÅÙçå™±¯™­•™„–—„„ FontManager…†•™Á¯™Û¯™ØÐ™ÉÅ™ÃÁ± „@*•„„ File's OwnerÜ„„ Font ManagerÜÔ„ÌÜÒ„ËÜþ„ØÜ„ÚÜÖ„ÍÜ„ÙÜØ„ÎÜ­„„MainMenuǕɱ’„¦±„[21@]„„„IBControlConnector„„ IBConnector”„@@*þ•„„hide:†„ã•„„ terminate:†„ãÒ…„„cut:†„ãÔ…„„copy:†„ãÖ…„„paste:†„ãØ…„„ selectAll:†„„„IBOutletConnectorã•„„delegate†„㘅„„performMiniaturize:†„ã©…„„ performClose:†„ã§…„„arrangeInFront:†„㹄„openDirectory:†„㱄„info:†„ã»…„„export:†„ãõ…„„print:†„ãð…„„runPageLayout:†„ãç„„orderFrontFontPanel:†„ãé„„ addFontTrait:†„ãë9†„ãî…„„orderFrontColorPanel:†„ãÇ…„„ openSelected:†„ãÉ…„„destroy:††’†MiscKit/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/ 40755 1750 1750 0 6735010731 24561 5ustar sunshinesunshineMiscKit/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/data.classes100444 1750 1750 625 6735010731 27127 0ustar sunshinesunshineSD_PageLayout = { ACTIONS = {}; OUTLETS = { accessoryWindow = accessoryWindow; bottomMarginField = bottomMarginField; centerMatrix = centerMatrix; leftMarginField = leftMarginField; paginationMatrix = paginationMatrix; rightMarginField = rightMarginField; topMarginField = topMarginField; }; SUPERCLASS = Object; }; FirstResponder = {ACTIONS = {}; SUPERCLASS = Object; }; MiscKit/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/data.nib100444 1750 1750 5241 6735010731 26261 0ustar sunshinesunshine streamtyped¢„@„„„ IBObjectData„„Object…„@i„„„ CustomObject”„*@„„ SD_PageLayout…†„@@„„„ ButtonCell„„ ActionCell„„Cell”„*@ss„„„„„Font”„%fss„ Helvetica €† ’…„i:…„ssÈ……À7™„„„NXImage”„s*b@„„Pagination.HClip.VFit†…†„„„Matrix„„Control„„View„„ Responder”’„¥’„„„Box¥’„¥’…„f„ffff Ü·­Ü·’…’…„@ss@„„„List”„i„[3@]„©’ª¬­rÚE­ÚE’ª’…®„¬°„[1@]„¥’­¬­Ö3­Ö3’­’…®„¬°„[8@]„„„ TextField¤’¯¬­-8­8’¯’…®… …„i@s„„„ TextFieldCellš„ž8–’…¢…„ff„c¸†À’…’…’…„:…†„²’¯¬­!*­*’¯’…®… …µ„´„„Left:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­-8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­*­*’¯’…®… …µ„´„„Right:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­™8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­m!,­,’¯’…®… …µ„´„„Top:€†’…¢…·ÿ¸¸†À’…’…’…¹…†„²’¯¬­™8­8’¯’…®… …µ„´„ž8–’…¢…·¸¸†À’…’…’…¹…†„²’¯¬­i0­0’¯’…®… …µ„´„„Bottom:€†’…¢…·ÿ¸¸†À’…’…’…¹…††…††…·„@@s„›„„Margins†¯Ð†„©’ª¬­JS­JS’ª’…®„¬°²„¥’ͬ­FA­FA’Í’…®„¬°²„£’Ϭ­<<­<<’Ï’…®……µ…À’…’…’…’…„@:@iiii„¬°„[4@]„™„ž‹’…¢…£È……Ä7™„ ¥b@„„Align.HLeft.VTop†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Align.HCentered.VTop†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Align.HLeft.VCentered†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Align.HCentered.VCentered†…††…Ó··„ff@@#::sÿÿ…„™„ž ’…¢…£È……À7™Õ…†š……B¸¸††…††…·¾„›„„Center†ÏІ¨†@…†¬­rhq­hq’ª’…®„¬°²§†…·¾„›„„ Pagination†§Ð†¬­d_­d_’¨’…®„¬°²¢†…†¬­ZZ­ZZ’§’…®……µ…À’…’…’…’…À„¬° „[9@]„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HFit.VFit†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VFit†…†˜„™„ž‹’…¢…£È……Ä7™„ ¥b@„„Pagination.HFit.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HClip.VAuto†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HFit.VClip†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HAuto.VClip†…†„™„ž ’…¢…£È……À7™„ ¥b@„„Pagination.HClip.VClip†…††…ô··Æÿÿ…„™„ž ’…¢…£È……À7™î…†š……B¸¸†™È¯™ì¢™Íª™Ñϙ𢙧¨™ßÑ™ø¢™Â¯™ô¢™ÛÑ™×Ñ™¶¯™Å¯™ÓÑ™¢§™¹¯™¿¯™±¯™¼¯™¢™ü¢™„„„WindowTemplate”­Ü·„ iiii***@s@‚ï„„Window„©„Ôªx`…¸­¼¸·Z †•™¢™ÏÍ™¯­™ª™¢™­ª™¨ª°„@*„ÔÕ•„„ File's Owner°’„¬°„[14@]„„„IBOutletConnector„„ IBConnector”„@@*•±„„leftMarginField†„Ú•„„accessoryWindow†„Ú•Å„„bottomMarginField†„Ú•¹„„rightMarginField†„Ú•¿„„topMarginField†„Ú±¿„„nextText†„Ú±•„„ textDelegate†„Ú¿¹#†„Ú¿•%†„Ú¹Å#†„Ú¹•%†„ÚÅ•%†„Ú•Ñ„„ centerMatrix†„Ú•¢„„paginationMatrix††’…†MiscKit/Examples/LazyScrollDir/Align.HLeft.VCentered.tiff100444 1750 1750 430 6757716260 23505 0ustar sunshinesunshineMM*J€* J¤©TªVO¿ßï(L-¼‘ïøŠ0‰Åbñ(£Ê-‡Äa°ÈSÉ  j¨€?àP8$ „BaP˜ø (R;3 ü€' ü€'MiscKit/Examples/LazyScrollDir/Align.HLeft.VTop.tiff100444 1750 1750 426 6757716260 22523 0ustar sunshinesunshineMM*H€* J¤*VG¿Çï$` …Ãað¨d9å…§ßï÷”j9ŽÆä1Ä€ª  €?àP8$ „BaP˜ö þ(R91 ü€' ü€'MiscKit/Examples/LazyScrollDir/LazyScrollDir.tiff100444 1750 1750 14004 6757716260 22373 0ustar sunshinesunshineMM*ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿU_U_U_ÿÿU_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_U_ÿÿU_U_U_U_U_ÿÿU_U_U_U_U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯U_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿU_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_U_U_ÿÿÿÿÿÿU_U_U_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯U_U_U_U_U_ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿª¯ÿÿU_ª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª¯ÿÿÿÿÿÿÿÿÿÿU_ª¯ÿÿU_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ª¯ 00ª²º(RB ü€' ü€'ªªªªªªªªªª¿ÿÿÿÿÿÿÿÿüµMMUMUMU5TµMMUMUMU5TµMMUMUMU5T° 0¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ô°îîîîîîîä¿ÿÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿôµOÿÕÿõÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿÕÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿUÿUÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÕýUÿÿ¿ôµOïÿïÿïÿÿô° »»ªª«»»´¿ÿïÿꪯÿÿôµOÿÿéU¯ÿ¿ôµOïÿꪯÿÿô° »»ªª«»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµOïÿïÿïÿÿô° »»»»»»»´¿ÿïÿïÿïÿÿôµOÿÿÿÿÿÿ¿ôµUUUUUUUUT€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 00äìôü(RÂ@@ ü€' ü€'MiscKit/Examples/LazyScrollDir/Lock.insecure.tiff100444 1750 1750 2762 6757716260 22332 0ustar sunshinesunshineII*?ÕÀ@@ý@ê•@Àê•EÀê•EÀê•EÐUU????ÿÀ?ÿÀ?À0?À<?À<?À<?À<?ÿÿð?ÿÿð?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿ?? ¦®¶¾(R8†~~€ü '€ü 'ÿÿÿÿÿÿÿÿU?UOU?ÿÿÿÿU?U?ÿÿU?U?U?U?U?U?U?U?U?ÿÿþÿÿÿ™¯D_þÿªÏªÏª¿ªÏD_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_þÿªÏªÏª¿ªÏD_D_D_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_D_D_D_D_D_D_D_D_D_D_ ÚÆrâê(R€ü '€ü 'MiscKit/Examples/LazyScrollDir/Defaults.h100444 1750 1750 4613 6757716250 20670 0ustar sunshinesunshine#ifndef __Defaults_h #define __Defaults_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.h // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.h,v 1.1 97/02/05 08:21:32 sunshine Exp $ // $Log: Defaults.h,v $ // Revision 1.1 97/02/05 08:21:32 sunshine // v13: Synchronized with ScrollDir (v29). // //----------------------------------------------------------------------------- #import #import @class Font; @interface Defaults : Object + (void)set:(char const*)def str:(char const*)s; + (void)set:(char const*)def int:(int)i; + (void)set:(char const*)def float:(float)f; + (void)set:(char const*)def color:(NXColor)c; + (void)set:(char const*)def bool:(BOOL)b; + (void)set:(char const*)def font:(Font*)f; + (void)set:(char const*)def size:(NXSize)s; + (void)set:(char const*)def point:(NXPoint)p; + (void)set:(char const*)def rect:(NXRect)r; + (char const*) getStr: (char const*)def fallback:(char const*)s; + (int) getInt: (char const*)def fallback:(int)i; + (int) getInt: (char const*)def fallback:(int)i min:(int)n; + (int) getInt: (char const*)def fallback:(int)i min:(int)n max:(int)x; + (float) getFloat:(char const*)def fallback:(float)f; + (NXColor) getColor:(char const*)def fallback:(NXColor)c; + (BOOL) getBool: (char const*)def fallback:(BOOL)b; + (Font*) getFont: (char const*)def fallback:(Font*)f; + (NXSize) getSize: (char const*)def fallback:(NXSize)s; + (NXPoint) getPoint:(char const*)def fallback:(NXPoint)p; + (NXRect) getRect: (char const*)def fallback:(NXRect)r; @end #endif // __Defaults_h MiscKit/Examples/LazyScrollDir/Defaults.m100444 1750 1750 27317 6757716250 20723 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit disibution. Please refer to that file // for a list of all applicable permissions and resictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.m // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.m,v 1.1 97/02/05 08:21:36 sunshine Exp $ // $Log: Defaults.m,v $ // Revision 1.1 97/02/05 08:21:36 sunshine // v13: Synchronized with ScrollDir (v29). // //----------------------------------------------------------------------------- #import "Defaults.h" #import #import #import #import #import #import #import //----------------------------------------------------------------------------- // moduleName //----------------------------------------------------------------------------- static inline char const* moduleName( void ) { static char const* name = 0; if (name == 0) name = [NXApp appName]; return name; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation Defaults //----------------------------------------------------------------------------- // set:str: //----------------------------------------------------------------------------- + (void)set:(char const*)def str:(char const*)s { assert( def != 0 ); NXWriteDefault( moduleName(), def, s ); } //----------------------------------------------------------------------------- // getStr:fallback: //----------------------------------------------------------------------------- + (char const*)getStr:(char const*)def fallback:(char const*)fallback { char const* s; assert( def != 0 ); s = NXGetDefaultValue( moduleName(), def ); if (s == 0) s = fallback; return s; } //----------------------------------------------------------------------------- // set:int: //----------------------------------------------------------------------------- + (void)set:(char const*)def int:(int)i { char buf[ 32 ]; sprintf( buf, "%d", i ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getInt:fallback: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)fallback { int value = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { int x; if (sscanf( s, "%d", &x ) == 1) value = x; else fprintf( stderr, "%s/%s has a bad integer default value (%s)\n", moduleName(), def, s ); } return value; } //----------------------------------------------------------------------------- // getInt:fallback:min:max: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)f min:(int)imin max:(int)imax { int ret; assert( imin <= imax ); ret = [self getInt:def fallback:f]; if (ret < imin) ret = imin; else if (ret > imax) ret = imax; return ret; } //----------------------------------------------------------------------------- // getInt:fallback:min: //----------------------------------------------------------------------------- + (int)getInt:(char const*)def fallback:(int)fallback min:(int)imin { return [self getInt:def fallback:fallback min:imin max:INT_MAX]; } //----------------------------------------------------------------------------- // set:float: //----------------------------------------------------------------------------- + (void)set:(char const*)def float:(float)f { char buf[ 32 ]; sprintf( buf, "%g", f ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getFloat:fallback: //----------------------------------------------------------------------------- + (float)getFloat:(char const*)def fallback:(float)fallback { float value = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { float x; if (sscanf( s, "%f", &x ) == 1) value = x; else fprintf( stderr, "%s/%s has a bad float default value (%s)\n", moduleName(), def, s ); } return value; } //----------------------------------------------------------------------------- // set:color: //----------------------------------------------------------------------------- + (void)set:(char const*)def color:(NXColor)c { char buf[ 64 ]; sprintf( buf, "%g %g %g", NXRedComponent(c), NXGreenComponent(c), NXBlueComponent(c) ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getColor:fallback: //----------------------------------------------------------------------------- + (NXColor)getColor:(char const*)def fallback:(NXColor)fallback { NXColor color = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { float r,g,b; if (sscanf( s, "%f %f %f", &r, &g, &b ) == 3) color = NXConvertRGBToColor( r, g, b ); else fprintf( stderr, "%s/%s has a bad RGB default value (%s)\n", moduleName(), def, s ); } return color; } //----------------------------------------------------------------------------- // set:bool: //----------------------------------------------------------------------------- + (void)set:(char const*)def bool:(BOOL)b { assert( def != 0 ); NXWriteDefault( moduleName(), def, (b ? "Yes" : "No") ); } //----------------------------------------------------------------------------- // getBool:fallback: //----------------------------------------------------------------------------- + (BOOL)getBool:(char const*)def fallback:(BOOL)fallback { BOOL flag = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { char c = toupper( *s ); if ((c == 'Y') || (c == 'N')) flag = (c == 'Y'); else fprintf( stderr, "%s/%s has a bad boolean default value (%s)\n", moduleName(), def, s ); } return flag; } //----------------------------------------------------------------------------- // sizeParam -- caller must free returned value //----------------------------------------------------------------------------- static char* sizeParam( char const* def ) { static char const SIZE_STR[] = "Size"; char* p; assert( def != 0 ); p = (char*)malloc( strlen(def) + sizeof(SIZE_STR) ); // include null strcat( strcpy( p, def ), SIZE_STR ); return p; } //----------------------------------------------------------------------------- // set:font: //----------------------------------------------------------------------------- + (void)set:(char const*)def font:(Font*)f { char* p; assert( f != 0 ); assert( def != 0 ); NXWriteDefault( moduleName(), def, [f name] ); p = sizeParam( def ); [self set:p float:[f pointSize]]; free( p ); } //----------------------------------------------------------------------------- // getFont:fallback: //----------------------------------------------------------------------------- + (Font*)getFont:(char const*)def fallback:(Font*)fallback { Font* font = fallback; char const* name; assert( def != 0 ); assert( fallback != 0 ); if ((name = NXGetDefaultValue( moduleName(), def )) != 0) { Font* new_font; char* p = sizeParam( def ); float const size = [self getFloat:p fallback:[fallback pointSize]]; new_font = [Font newFont:name size:size]; if (new_font != 0) font = new_font; else fprintf( stderr, "%s/%s has a bad font default value (%s)\n", moduleName(), def, p ); free( p ); } assert( font != 0 ); return font; } //----------------------------------------------------------------------------- // set:size: //----------------------------------------------------------------------------- + (void)set:(char const*)def size:(NXSize)s { char buf[ 64 ]; sprintf( buf, "%g %g", s.width, s.height ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getSize:fallback: //----------------------------------------------------------------------------- + (NXSize)getSize:(char const*)def fallback:(NXSize)fallback { NXSize size = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord w,h; if (sscanf( s, "%f %f", &w, &h ) == 2) { size.width = w; size.height = h; } else fprintf( stderr, "%s/%s has a bad size default value (%s)\n", moduleName(), def, s ); } return size; } //----------------------------------------------------------------------------- // set:point: //----------------------------------------------------------------------------- + (void)set:(char const*)def point:(NXPoint)p { char buf[ 64 ]; sprintf( buf, "%g %g", p.x, p.y ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getPoint:fallback: //----------------------------------------------------------------------------- + (NXPoint)getPoint:(char const*)def fallback:(NXPoint)fallback { NXPoint point = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord x,y; if (sscanf( s, "%f %f", &x, &y ) == 2) { point.x = x; point.y = y; } else fprintf( stderr, "%s/%s has a bad point default value (%s)\n", moduleName(), def, s ); } return point; } //----------------------------------------------------------------------------- // set:rect: //----------------------------------------------------------------------------- + (void)set:(char const*)def rect:(NXRect)r { char buf[ 128 ]; sprintf( buf, "%g %g %g %g", r.origin.x, r.origin.y, r.size.width, r.size.height ); assert( def != 0 ); NXWriteDefault( moduleName(), def, buf ); } //----------------------------------------------------------------------------- // getRect:fallback: //----------------------------------------------------------------------------- + (NXRect)getRect:(char const*)def fallback:(NXRect)fallback { NXRect rect = fallback; char const* s; assert( def != 0 ); if ((s = NXGetDefaultValue( moduleName(), def )) != 0) { NXCoord x,y,w,h; if (sscanf( s, "%f %f %f %f", &x, &y, &w, &h ) == 4) { rect.origin.x = x; rect.origin.y = y; rect.size.width = w; rect.size.height = h; } else fprintf( stderr, "%s/%s has a bad rect default value (%s)\n", moduleName(), def, s ); } return rect; } @end MiscKit/Examples/LazyScrollDir/DirArray.h100444 1750 1750 5400 6757716250 20631 0ustar sunshinesunshine#ifndef __DirArray_h #define __DirArray_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirArray.h // // An extensible array of directory entries. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirArray.h,v 1.2 97/06/10 04:53:08 sunshine Exp $ // $Log: DirArray.h,v $ // Revision 1.2 97/06/10 04:53:08 sunshine // v15: Upgraded naming. Fixed bug: Wasn't taking sticky-bit into account // when computing canToggleLock. // // Revision 1.1 97/02/05 08:22:31 sunshine // v13: Synchronized with ScrollDir (v29). Added unscaledImage. Added // isLocked & canToggleLock. Added manipulation methods. Supports file // renaming. //----------------------------------------------------------------------------- #import #import #import @class DirArray; @class NXImage; typedef struct DirEntryStruct { DirArray* dir; char* name; char* softLink; struct stat status; BOOL isDirectory; BOOL isLocked; BOOL canToggleLock; NXImage* scaledImage; NXImage* unscaledImage; } DirEntry; @interface DirArray : Object { char* name; size_t totalBytes; int numEntries; int maxEntries; DirEntry* entries; BOOL writable; BOOL sticky; uid_t effectiveUid; }; - (id)init; - (id)free; - (void)empty; - (int)count; - (size_t)totalBytes; - (BOOL)dirWritable; - (BOOL)dirSticky; - (DirEntry const*)entryAt:(int)n; - (void)remove:(int)n; // Returns: 0 for success, else errno if could not open directory. - (int)loadPath:(char const*)path showHidden:(BOOL)flag; - (BOOL)isDir:(DirEntry const*)entry; - (BOOL)isDirAt:(int)n; - (NXImage*)getImage:(DirEntry const*)entry scaled:(BOOL)flag; - (NXImage*)getImageAt:(int)n scaled:(BOOL)flag; - (BOOL)canToggleLock:(DirEntry const*)entry; - (BOOL)canToggleLockAt:(int)n; - (BOOL)isLocked:(DirEntry const*)entry; - (BOOL)isLockedAt:(int)n; - (void)setLocked:(BOOL)flag at:(int)n; - (void)setName:(char const*)name at:(int)n; @end #endif // __DirArray_h MiscKit/Examples/LazyScrollDir/DirArray.m100444 1750 1750 32273 6757716250 20666 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirArray.m // // An extensible array of directory entries. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirArray.m,v 1.2 97/06/10 04:53:13 sunshine Exp $ // $Log: DirArray.m,v $ // Revision 1.2 97/06/10 04:53:13 sunshine // v15: Upgraded naming. Fixed bug: Wasn't taking sticky-bit into account // when computing canToggleLock. // // Revision 1.1 97/02/05 08:22:38 sunshine // v13: Synchronized with ScrollDir (v29). Added unscaledImage. Added // isLocked & canToggleLock. Added manipulation methods. Supports file // renaming. //----------------------------------------------------------------------------- #import "DirArray.h" #import #import #import #import #import #import #import #ifdef _POSIX_SOURCE # define GRP_TYPE gid_t # define MAX_GRPS NGROUPS_MAX #else # define GRP_TYPE int # define MAX_GRPS NGROUPS #endif @implementation DirArray //----------------------------------------------------------------------------- // safeStrdup //----------------------------------------------------------------------------- - (char*)safeStrdup:(char const*)s { char* t = 0; if (s != 0) t = NXCopyStringBufferFromZone( s, [self zone] ); return t; } //----------------------------------------------------------------------------- // safeFree //----------------------------------------------------------------------------- - (void)safeFree:(void*)p { if (p != 0) NXZoneFree( [self zone], p ); } //----------------------------------------------------------------------------- // dirWritable: //----------------------------------------------------------------------------- - (BOOL)dirWritable:(char const*)path { BOOL rc = NO; struct stat st; if (stat( path, &st ) == 0) { unsigned int mode = st.st_mode; if ((mode & 0002) != 0 || // "other" ((mode & 0200) != 0 && st.st_uid == geteuid())) // "owner" rc = YES; else if ((mode & 0020) != 0) // "group" { gid_t const gid = getegid(); if (st.st_gid == gid) rc = YES; else { GRP_TYPE groups[ MAX_GRPS ]; int n = getgroups( MAX_GRPS, groups ); while (n-- > 0) if (gid == groups[n]) { rc = YES; break; } } } } return rc; } //----------------------------------------------------------------------------- // dirSticky: //----------------------------------------------------------------------------- - (BOOL)dirSticky:(char const*)path { struct stat st; if (stat( path, &st ) == 0) return ((st.st_mode & 01000) != 0); return NO; } //----------------------------------------------------------------------------- // dirEntryCons:name:path:isDotDot: //----------------------------------------------------------------------------- - (void)dirEntryCons:(DirEntry*)de name:(char const*)n path:(char const*)path isDotDot:(BOOL)dotdot { int rc; memset( de, 0, sizeof(*de) ); de->dir = self; de->name = [self safeStrdup:n]; if ((rc = lstat( path, &(de->status) )) == 0) { unsigned int mode = de->status.st_mode; if ((mode & S_IFMT) == S_IFLNK) // soft-link? { char symbuf[ FILENAME_MAX + 1 ]; int cc = readlink( path, symbuf, FILENAME_MAX ); if (cc >= 0) { struct stat st; symbuf[ cc ] = '\0'; de->softLink = [self safeStrdup:symbuf]; if (stat( path, &st ) == 0) mode = st.st_mode; // mode of file linked to } } de->isDirectory = ((mode & S_IFMT) == S_IFDIR); } de->canToggleLock = (!dotdot && [self dirWritable] && (!sticky || de->status.st_uid == effectiveUid)); de->isLocked = !de->canToggleLock; } //----------------------------------------------------------------------------- // freeImage //----------------------------------------------------------------------------- - (void)freeImage:(NXImage*)p { if (p != 0) [p free]; } //----------------------------------------------------------------------------- // dirEntryDestroy: //----------------------------------------------------------------------------- - (void)dirEntryDestroy:(DirEntry*)de { [self freeImage:de->scaledImage]; [self freeImage:de->unscaledImage]; [self safeFree:de->name]; [self safeFree:de->softLink]; } //----------------------------------------------------------------------------- // entryAt: //----------------------------------------------------------------------------- - (DirEntry const*)entryAt:(int)n { assert( 0 <=n && n < numEntries ); return (entries + n); } //----------------------------------------------------------------------------- // isDir: //----------------------------------------------------------------------------- - (BOOL)isDir:(DirEntry const*)de { return de->isDirectory; } //----------------------------------------------------------------------------- // isDirAt: //----------------------------------------------------------------------------- - (BOOL)isDirAt:(int)n { return [self isDir:[self entryAt:n]]; } //----------------------------------------------------------------------------- // canToggleLock: //----------------------------------------------------------------------------- - (BOOL)canToggleLock:(DirEntry const*)de { return de->canToggleLock; } //----------------------------------------------------------------------------- // canToggleLockAt: //----------------------------------------------------------------------------- - (BOOL)canToggleLockAt:(int)n { return [self canToggleLock:[self entryAt:n]]; } //----------------------------------------------------------------------------- // isLocked: //----------------------------------------------------------------------------- - (BOOL)isLocked:(DirEntry const*)de { return de->isLocked; } //----------------------------------------------------------------------------- // isLockedAt: //----------------------------------------------------------------------------- - (BOOL)isLockedAt:(int)n { return [self isLocked:[self entryAt:n]]; } //----------------------------------------------------------------------------- // setLocked:at: //----------------------------------------------------------------------------- - (void)setLocked:(BOOL)flag at:(int)n { assert( entries[n].canToggleLock ); entries[n].isLocked = flag; } //----------------------------------------------------------------------------- // setName:at: //----------------------------------------------------------------------------- - (void)setName:(char const*)s at:(int)n { [self safeFree:entries[n].name]; entries[n].name = [self safeStrdup:s]; } //----------------------------------------------------------------------------- // loadImage: //----------------------------------------------------------------------------- - (void)loadImage:(DirEntry*)de { char buff[ FILENAME_MAX + 1 ]; char const* const dir_part = de->dir->name; int const dirlen = strlen( dir_part ); memcpy( buff, dir_part, dirlen ); strcpy( buff + dirlen, de->name ); de->unscaledImage = [[Application workspace] getIconForFile:buff]; de->scaledImage = [de->unscaledImage copy]; [de->scaledImage setScalable:YES]; } //----------------------------------------------------------------------------- // getImage:scaled: //----------------------------------------------------------------------------- - (NXImage*)getImage:(DirEntry const*)de scaled:(BOOL)wantsScaled { if (de->unscaledImage == 0) [self loadImage:(DirEntry*)de]; return (wantsScaled ? de->scaledImage : de->unscaledImage); } //----------------------------------------------------------------------------- // getImageAt:scaled: //----------------------------------------------------------------------------- - (NXImage*)getImageAt:(int)n scaled:(BOOL)flag { return [self getImage:[self entryAt:n] scaled:flag]; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; totalBytes = 0; numEntries = 0; maxEntries = 0; entries = 0; writable = NO; sticky = NO; effectiveUid = geteuid(); return self; } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- - (void)empty { DirEntry* p; for (p = entries + numEntries; p != entries; ) [self dirEntryDestroy:--p]; numEntries = 0; totalBytes = 0; } //----------------------------------------------------------------------------- // free //----------------------------------------------------------------------------- - (id)free { [self empty]; [self safeFree:name]; [self safeFree:entries]; return [super free]; } //----------------------------------------------------------------------------- // count //----------------------------------------------------------------------------- - (int)count { return numEntries; } //----------------------------------------------------------------------------- // totalBytes //----------------------------------------------------------------------------- - (size_t)totalBytes { return totalBytes; } //----------------------------------------------------------------------------- // dirWritable //----------------------------------------------------------------------------- - (BOOL)dirWritable { return writable; } //----------------------------------------------------------------------------- // dirSticky //----------------------------------------------------------------------------- - (BOOL)dirSticky { return sticky; } //----------------------------------------------------------------------------- // remove: //----------------------------------------------------------------------------- - (void)remove:(int)n { if (0 <= n && n < numEntries) { DirEntry* p = entries + n; totalBytes -= p->status.st_size; numEntries--; [self dirEntryDestroy:p]; if (n < numEntries) memmove( p, p + 1, (numEntries - n) * sizeof(*p) ); } } //----------------------------------------------------------------------------- // expand //----------------------------------------------------------------------------- - (void)expand { DirEntry* p = entries; int N = maxEntries; if (N == 0) { N = 16; p = (DirEntry*) NXZoneMalloc( [self zone], N * sizeof(*p) ); } else { N += N; p = (DirEntry*) NXZoneRealloc( [self zone], p, N * sizeof(*p) ); } maxEntries = N; entries = p; } //----------------------------------------------------------------------------- // addName:path:isDotDot: //----------------------------------------------------------------------------- - (void)addName:(char const*)n path:(char const*)fullpath isDotDot:(BOOL)dotdot { DirEntry* p; if (numEntries >= maxEntries) [self expand]; p = entries + numEntries++; [self dirEntryCons:p name:n path:fullpath isDotDot:dotdot]; totalBytes += p->status.st_size; } //----------------------------------------------------------------------------- // loadPath:showHidden: //----------------------------------------------------------------------------- - (int)loadPath:(char const*)path showHidden:(BOOL)showHidden { int rc = 0; int dirlen; DIR* dirp; char namebuff[ FILENAME_MAX + 1 ]; dirlen = strlen( path ); strcpy( namebuff, path ); if (dirlen == 0 || namebuff[ dirlen - 1 ] != '/') { namebuff[ dirlen++ ] = '/'; namebuff[ dirlen ] = '\0'; } [self empty]; [self safeFree:name]; name = [self safeStrdup:namebuff]; writable = [self dirWritable:path]; sticky = [self dirSticky:path]; if ((dirp = opendir( path )) != 0) { struct direct const* dp; while ((dp = readdir(dirp)) != 0) { // Do not include the "." (self) entry. int const len = dp->d_namlen; char const* const nam = dp->d_name; BOOL const dot_name = (nam[0] == '.'); BOOL const dot_dot_name = (dot_name && len == 2 && nam[1] == '.'); if ((len > 1 || !dot_name) && // exclude "." (showHidden || !dot_name || dot_dot_name)) // include ".." { memcpy( namebuff + dirlen, nam, len + 1 ); [self addName:nam path:namebuff isDotDot:dot_dot_name]; } } closedir( dirp ); } else rc = errno; return rc; } @end MiscKit/Examples/LazyScrollDir/DirController.h100444 1750 1750 3151 6757716251 21700 0ustar sunshinesunshine#ifndef __DirController_h #define __DirController_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.h // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.h,v 1.2 99/06/29 08:25:04 sunshine Exp $ // $Log: DirController.h,v $ // Revision 1.2 99/06/29 08:25:04 sunshine // v19: Synchronized with LazyScrollDir v19.1 for OpenStep. // For clarity renamed -new: to -openDirectory:. // //----------------------------------------------------------------------------- #import @class Panel, Text; @interface DirController : Object { Panel* infoPanel; Text* infoText; } - (id)init; - (id)free; - (id)appDidInit:(id)sender; - (id)openDirectory:(id)sender; - (id)info:(id)sender; @end #endif // __DirController_h MiscKit/Examples/LazyScrollDir/DirController.m100444 1750 1750 10117 6757716251 21725 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.m // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.m,v 1.2 99/06/29 08:25:01 sunshine Exp $ // $Log: DirController.m,v $ // Revision 1.2 99/06/29 08:25:01 sunshine // v19: Synchronized with LazyScrollDir v19.1 for OpenStep. // For clarity renamed -new: to -openDirectory:. // //----------------------------------------------------------------------------- #import "DirController.h" #import "DirWindow.h" #import "SD_PageLayout.h" #import #import #import #import #import @implementation DirController //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; infoPanel = 0; return self; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { if (infoPanel) [infoPanel free]; return [super free]; } //----------------------------------------------------------------------------- // - appWillInit: //----------------------------------------------------------------------------- - (id)appWillInit:(id)sender { [SD_PageLayout new]; return self; } //----------------------------------------------------------------------------- // - appDidInit: //----------------------------------------------------------------------------- - (id)appDidInit:(id)sender { [DirWindow launchDir:0]; return self; } //----------------------------------------------------------------------------- // - openDirectory: //----------------------------------------------------------------------------- - (id)openDirectory:(id)sender { int rc; OpenPanel* panel = [OpenPanel new]; [panel setTitle:"Open Directory"]; [panel setPrompt:"Directory:"]; [panel chooseDirectories:YES]; [panel allowMultipleFiles:NO]; // OpenPanel screws up multiple dirs. [panel setTreatsFilePackagesAsDirectories:YES]; rc = [panel runModal]; [panel close]; if (rc == NX_OKTAG) { char const* const* filename; char const* dir = [panel directory]; if (dir == 0) dir = ""; for (filename = [panel filenames]; *filename != 0; filename++) { char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, dir ), "/" ), *filename ); [DirWindow launchDir:buff]; } } return self; } //----------------------------------------------------------------------------- // - info: //----------------------------------------------------------------------------- - (id)info:(id)sender { if (infoPanel == 0) { char buff[ FILENAME_MAX + 1 ]; id const bundle = [NXBundle bundleForClass:[self class]]; [bundle getPath:buff forResource:"Info" ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:[self zone]]; if (![bundle getPath:buff forResource:"README" ofType:"rtf"]) [bundle getPath:buff forResource:"README" ofType:"rtfd"]; [infoText openRTFDFrom:buff]; } [infoPanel makeKeyAndOrderFront:self]; return self; } @end MiscKit/Examples/LazyScrollDir/DirWindow.h100444 1750 1750 4401 6757716267 21032 0ustar sunshinesunshine#ifndef __DirWindow_h #define __DirWindow_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.h // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.h,v 1.4 99/06/29 08:25:22 sunshine Exp $ // $Log: DirWindow.h,v $ // Revision 1.4 99/06/29 08:25:22 sunshine // v19: +launchDir: now returns (void) rather than (id). // // Revision 1.3 97/11/24 17:04:43 sunshine // v17: Added row-numbers switch. // // Revision 1.2 97/06/10 04:54:52 sunshine // v15: Upgraded naming. Removed Message slot. //----------------------------------------------------------------------------- #import @class Button, DirArray, MiscTableScroll, TextField, Window; enum { ICON_SLOT, NAME_SLOT, LOCK_SLOT, SIZE_SLOT, MODIFIED_SLOT, PERMS_SLOT, OWNER_SLOT, GROUP_SLOT, HARDLINKS_SLOT, SOFTLINK_SLOT, MAX_SLOT }; @interface DirWindow : Object { MiscTableScroll* scroll; Window* window; Button* autoSortSwitch; Button* cdButton; Button* dragUnscaledSwitch; Button* hiddenFilesSwitch; Button* highlightSwitch; Button* refreshButton; Button* rowNumbersSwitch; TextField* countField; char* path; BOOL autoSort; BOOL dragUnscaled; BOOL highlightDirs; BOOL showHidden; DirArray* dirArray; id lazyRow[ MAX_SLOT ]; } + (void)launchDir:(char const*)dirname; @end #endif // __DirWindow_h MiscKit/Examples/LazyScrollDir/DirWindow.m100444 1750 1750 124762 6757716267 21114 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.m // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.m,v 1.7 99/06/29 08:26:03 sunshine Exp $ // $Log: DirWindow.m,v $ // Revision 1.7 99/06/29 08:26:03 sunshine // v19: Synchronized with LazyScrollDir v19.1 for OpenStep. // For clarity, renamed: -open: to -openSelected: & -save: to -export:. // Now prompts user for confirmation before deleting files in -destroy:. // Fixed bug: Was responding to -tableScroll:fontChanged:to: rather than // -tableScroll:changeFont:to:. The latter is sent in response to user- // initiated font changes, which is what we are interested in. // For naming consistency, renamed: -didClick: to -scrollClick: & // -didDoubleClick: to -scrollDoubleClick:. This is more consistent with // other methods such as -lockClick:. // +launchDir: now returns (void) rather than (id). // // Revision 1.6 98/03/30 10:33:59 sunshine // v18: Wasn't respecting highlighted-text color. Problem was cell's "owner" // was never getting set. // // Revision 1.5 98/03/23 23:47:53 sunshine // v18: Added -tableScrollIgnoreModifierKeysWhileDragging: returning NO. // Had to implement -tableScroll:draggingSourceOperationMaskForLocal: since // in MiscTableScroll v126 the default changed from "copy" to "generic". //----------------------------------------------------------------------------- #import "DirWindow.h" #import "Defaults.h" #import "DirArray.h" #import "NameCache.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import // getwd() #import #import // getcwd() #import // vm_page_size #ifdef _POSIX_SOURCE # define GET_CURR_DIR(_BF_,_SZ_) getcwd( _BF_, _SZ_ ) #else # define GET_CURR_DIR(_BF_,_SZ_) getwd( _BF_ ) #endif static int const CASCADE_MAX = 10; static int CASCADE_COUNTER = 0; static NXCoord CASCADE_ORIGIN_X; static NXCoord CASCADE_ORIGIN_Y; static NXCoord CASCADE_DELTA_X; static NXCoord CASCADE_DELTA_Y; static BOOL DEFAULT_AUTO_SORT; static BOOL DEFAULT_ROW_NUMBERS; static BOOL DEFAULT_SHOW_HIDDEN; static BOOL DEFAULT_HIGHLIGHT_DIRS; static BOOL DEFAULT_DRAG_UNSCALED; static NXColor DEFAULT_COLOR; static NXSize DEFAULT_WIN_SIZE; static Font* DEFAULT_FONT; static List* OPEN_DIRS = 0; static NXImage* LOCKED_ICON = 0; static NXImage* UNLOCKED_ICON = 0; static OwnerCache* OWNERS = 0; static GroupCache* GROUPS = 0; static char const COLOR_DEF[] = "DirColor"; static char const SIZE_DEF[] = "DirSize"; static char const FONT_DEF[] = "DirFont"; static char const SORT_DEF[] = "AutoSort"; static char const HIDDEN_DEF[] = "ShowHidden"; static char const HLIGHT_DEF[] = "HighlightDirs"; static char const UNSCALED_DEF[] = "DragUnscaled"; static char const COL_SIZES_DEF[] = "ColSizes"; static char const COL_ORDER_DEF[] = "ColOrder"; static char const ROW_NUMBERS_DEF[] = "RowNumbers"; static char const LOCKED_ICON_S[] = "Lock.secure"; static char const UNLOCKED_ICON_S[] = "Lock.insecure"; //----------------------------------------------------------------------------- // NOTE: USE_PRIVATE_ZONE // When set to '1', this program will place each window in a separate // NXZone and destroy the zone when the window is closed. However, // the NEXTSTEP 3.3 Cell class caches ClipViews which it uses for editing // scrollable cells. Unfortunately the caching code is buggy. It // blindly allocates ClipViews from transient zones such as ours then // caches and tries to re-use the ClipViews even after the originating // zones are defunct. Hence the program crashes. Verification of this // bug was obtained via disassembly of relevant portions of the AppKit. // The OPENSTEP AppKit does not have this problem. Disassembly of the // relevant OPENSTEP AppKit code reveals that the NSClipViews are // allocated from a zone which is guranteed to stay around for the life // of the application, NSDefaultMallocZone(). //----------------------------------------------------------------------------- #define USE_PRIVATE_ZONE 0 #if USE_PRIVATE_ZONE # define EMPLOY_ZONE() NXCreateZone( vm_page_size, vm_page_size, YES ) # define RETIRE_ZONE(Z) NXDestroyZone(Z) #else # define EMPLOY_ZONE() NXDefaultMallocZone() # define RETIRE_ZONE(Z) (void)(Z) #endif //----------------------------------------------------------------------------- // normalize_path //----------------------------------------------------------------------------- static void normalize_path( char* buff, size_t sz ) { char save_dir[ FILENAME_MAX + 1 ]; char tmp[ FILENAME_MAX + 1 ]; if (buff != 0 && sz > 0) { if (GET_CURR_DIR( save_dir, sizeof(save_dir) ) != 0) { if (chdir( buff ) == 0) { if (GET_CURR_DIR( tmp, sizeof(tmp) ) != 0) { int const tmp_len = strlen( tmp ); if (tmp_len < sz) strcpy( buff, tmp ); else { strncpy( buff, tmp, sz ); buff[ sz - 1 ] = '\0'; } } chdir( save_dir ); } } } } //----------------------------------------------------------------------------- // str_int //----------------------------------------------------------------------------- static char const* str_int( int n ) { static char buff[ 32 ]; sprintf( buff, "%d", n ); return buff; } //----------------------------------------------------------------------------- // str_date //----------------------------------------------------------------------------- static char const* str_date( time_t t ) { #define BUFF_SIZE 64 static char buff[ BUFF_SIZE ]; strftime( buff, BUFF_SIZE, "%m/%d/%y %H:%M", localtime(&t) ); return buff; } //----------------------------------------------------------------------------- // str_perms //----------------------------------------------------------------------------- static char const* str_perms( unsigned int mode ) { static char buff[ 16 ]; int ftype; int c; char* s = buff; ftype = (mode & S_IFMT); switch (ftype) { case S_IFDIR: c = 'd'; break; case S_IFCHR: c = 'c'; break; case S_IFBLK: c = 'b'; break; case S_IFREG: c = '-'; break; case S_IFLNK: c = 'l'; break; case S_IFSOCK: c = 's'; break; default: c = '-'; break; } *s++ = c; *s++ = (mode & 0400) ? 'r' : '-'; *s++ = (mode & 0200) ? 'w' : '-'; *s++ = (mode & S_ISUID) ? 's' : (mode & 0100) ? 'x' : '-'; *s++ = (mode & 0040) ? 'r' : '-'; *s++ = (mode & 0020) ? 'w' : '-'; *s++ = (mode & S_ISGID) ? 's' : (mode & 0010) ? 'x' : '-'; *s++ = (mode & 0004) ? 'r' : '-'; *s++ = (mode & 0002) ? 'w' : '-'; *s++ = (mode & S_ISVTX) ? 't' : (mode & 0001) ? 'x' : '-'; *s = '\0'; return buff; } //----------------------------------------------------------------------------- // fmt_icon //----------------------------------------------------------------------------- static void fmt_icon( MiscTableScroll* ts, DirEntry const* de, id cell ) { NXCoord h,w,s; NXSize sz; NXImage* img; w = [ts colSize:ICON_SLOT]; if (w == 0) w = 18; h = [ts uniformSizeRows]; if (h == 0) h = 18; s = (w < h ? w : h) - 1.0; sz.width = s; sz.height = s; img = [de->dir getImage:de scaled:YES]; [img setSize:&sz]; [cell setImage:img]; } //----------------------------------------------------------------------------- // fmt_lock //----------------------------------------------------------------------------- static void fmt_lock( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setState:!de->isLocked]; [cell setEnabled:de->canToggleLock]; } //----------------------------------------------------------------------------- // fmt_name //----------------------------------------------------------------------------- static void fmt_name( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValueNoCopy:de->name]; } //----------------------------------------------------------------------------- // fmt_size //----------------------------------------------------------------------------- static void fmt_size( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setIntValue:de->status.st_size]; } //----------------------------------------------------------------------------- // fmt_modified //----------------------------------------------------------------------------- static void fmt_modified( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:str_date( de->status.st_mtime )]; } //----------------------------------------------------------------------------- // fmt_perms //----------------------------------------------------------------------------- static void fmt_perms( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValue:str_perms( de->status.st_mode )]; } //----------------------------------------------------------------------------- // fmt_owner //----------------------------------------------------------------------------- static void fmt_owner( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValueNoCopy:[OWNERS lookup:de->status.st_uid]]; } //----------------------------------------------------------------------------- // fmt_group //----------------------------------------------------------------------------- static void fmt_group( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setStringValueNoCopy:[GROUPS lookup:de->status.st_gid]]; } //----------------------------------------------------------------------------- // fmt_hardlinks //----------------------------------------------------------------------------- static void fmt_hardlinks( MiscTableScroll* ts, DirEntry const* de, id cell ) { [cell setIntValue:de->status.st_nlink]; } //----------------------------------------------------------------------------- // fmt_softlink //----------------------------------------------------------------------------- static void fmt_softlink( MiscTableScroll* ts, DirEntry const* de, id cell ) { char const* s = de->softLink; [cell setStringValue:(s != 0 ? s : "")]; } //----------------------------------------------------------------------------- // FORMAT_FUNC //----------------------------------------------------------------------------- typedef void (*FormatFunc)( MiscTableScroll*, DirEntry const*, id ); static FormatFunc FORMAT_FUNC[ MAX_SLOT ] = { fmt_icon, // ICON_SLOT, fmt_name, // NAME_SLOT, fmt_lock, // LOCK_SLOT, fmt_size, // SIZE_SLOT, fmt_modified, // MODIFIED_SLOT, fmt_perms, // PERMS_SLOT, fmt_owner, // OWNER_SLOT, fmt_group, // GROUP_SLOT, fmt_hardlinks, // HARDLINKS_SLOT, fmt_softlink, // SOFTLINK_SLOT, }; //----------------------------------------------------------------------------- // format_cell //----------------------------------------------------------------------------- static inline void format_cell( MiscTableScroll* ts, DirEntry const* de, id cell, unsigned int col ) { FORMAT_FUNC[ col ]( ts, de, cell ); } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation DirWindow //----------------------------------------------------------------------------- // + initCascader //----------------------------------------------------------------------------- + (void)initCascader { NXSize s; [NXApp getScreenSize:&s]; CASCADE_ORIGIN_X = s.width / 4; CASCADE_ORIGIN_Y = s.height - 40; CASCADE_DELTA_X = 20; CASCADE_DELTA_Y = 20; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (self == [DirWindow class]) { [self initCascader]; OPEN_DIRS = [[List alloc] init]; LOCKED_ICON = [NXImage findImageNamed:LOCKED_ICON_S]; UNLOCKED_ICON = [NXImage findImageNamed:UNLOCKED_ICON_S]; OWNERS = [OwnerCache commonInstance]; GROUPS = [GroupCache commonInstance]; DEFAULT_COLOR = [Defaults getColor:COLOR_DEF fallback:NX_COLORLTGRAY]; DEFAULT_AUTO_SORT = [Defaults getBool:SORT_DEF fallback:NO]; DEFAULT_SHOW_HIDDEN = [Defaults getBool:HIDDEN_DEF fallback:NO]; DEFAULT_ROW_NUMBERS = [Defaults getBool:ROW_NUMBERS_DEF fallback:NO]; DEFAULT_HIGHLIGHT_DIRS = [Defaults getBool:HLIGHT_DEF fallback:NO]; DEFAULT_DRAG_UNSCALED = [Defaults getBool:UNSCALED_DEF fallback:YES]; } return self; } //----------------------------------------------------------------------------- // - cascade //----------------------------------------------------------------------------- - (void)cascade { NXCoord top,left; left = CASCADE_ORIGIN_X + (CASCADE_DELTA_X * CASCADE_COUNTER); top = CASCADE_ORIGIN_Y - (CASCADE_DELTA_Y * CASCADE_COUNTER); [window moveTopLeftTo:left:top]; if (++CASCADE_COUNTER >= CASCADE_MAX) CASCADE_COUNTER = 0; } //----------------------------------------------------------------------------- // - isDir: //----------------------------------------------------------------------------- - (BOOL)isDir:(int)r { return [dirArray isDirAt:r]; } //----------------------------------------------------------------------------- // - updateButtons //----------------------------------------------------------------------------- - (void)updateButtons { BOOL const enable = [scroll numSelectedRows] == 1 && [self isDir:[scroll selectedRow]]; if (enable != [cdButton isEnabled]) [cdButton setEnabled:enable]; } //----------------------------------------------------------------------------- // - tableScroll:cellAt:: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts cellAt:(int)row :(int)col { id cell = lazyRow[col]; DirEntry const* const de = [dirArray entryAt:row]; format_cell( ts, de, cell, col ); if ([cell respondsTo:@selector(setBackgroundColor:)]) { if (highlightDirs && [dirArray isDir:de]) [cell setBackgroundColor:NX_COLORCYAN]; else [cell setBackgroundColor:[ts backgroundColor]]; } return cell; } //----------------------------------------------------------------------------- // - tableScroll:stringValueAt:: //----------------------------------------------------------------------------- - (char const*)tableScroll:(MiscTableScroll*)ts stringValueAt:(int)r :(int)c { char const* rc = 0; if (r < [dirArray count]) { DirEntry const* const de = [dirArray entryAt:r]; switch (c) { case SIZE_SLOT: rc = str_int(de->status.st_size); break; case MODIFIED_SLOT: rc = str_date(de->status.st_mtime); break; case PERMS_SLOT: rc = str_perms(de->status.st_mode); break; case OWNER_SLOT: rc = [OWNERS lookup:de->status.st_uid]; break; case GROUP_SLOT: rc = [GROUPS lookup:de->status.st_gid]; break; case HARDLINKS_SLOT:rc = str_int(de->status.st_nlink); break; case NAME_SLOT: rc = de->name; break; case SOFTLINK_SLOT: rc = de->softLink; break; case ICON_SLOT: case LOCK_SLOT: default: rc = ""; break; } } return (rc != 0 ? rc : ""); } //----------------------------------------------------------------------------- // -intValueAt:: //----------------------------------------------------------------------------- - (int)intValueAt:(int)r :(int)c { int rc = 0; if (r < [dirArray count]) { DirEntry const* const de = [dirArray entryAt:r]; switch (c) { case LOCK_SLOT: rc = de->isLocked; break; case SIZE_SLOT: rc = de->status.st_size; break; case MODIFIED_SLOT: rc = de->status.st_mtime; break; case PERMS_SLOT: rc = de->status.st_mode; break; case OWNER_SLOT: rc = de->status.st_uid; break; case GROUP_SLOT: rc = de->status.st_gid; break; case HARDLINKS_SLOT: rc = de->status.st_nlink; break; case ICON_SLOT: case NAME_SLOT: case SOFTLINK_SLOT: default: break; } } return rc; } //----------------------------------------------------------------------------- // - tableScroll:intValueAt:: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts intValueAt:(int)r :(int)c { return [self intValueAt:r:c]; } //----------------------------------------------------------------------------- // - tableScroll:tagAt:: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts tagAt:(int)r :(int)c { return [self intValueAt:r:c]; } //----------------------------------------------------------------------------- // - tableScroll:stateAt:: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts stateAt:(int)r :(int)c { return [self intValueAt:r:c]; } //----------------------------------------------------------------------------- // - tableScroll:changeFont:to: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts changeFont:(Font*)oldFont to:(Font*)newFont { int col; for (col = 0; col < MAX_SLOT; col++) [lazyRow[col] setFont:newFont]; DEFAULT_FONT = newFont; [Defaults set:FONT_DEF font:DEFAULT_FONT]; return self; } //----------------------------------------------------------------------------- // - tableScroll:border:slotResized: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotResized:(int)n { char* s; assert( b == MISC_COL_BORDER ); s = [ts colSizesAsString:0 size:0 canExpand:YES]; [Defaults set:COL_SIZES_DEF str:s]; free(s); return self; } //----------------------------------------------------------------------------- // saveSlotOrder:border: //----------------------------------------------------------------------------- - (void)saveSlotOrder:(MiscTableScroll*)ts border:(MiscBorderType)b { if (b == MISC_COL_BORDER) { char* s = [ts colOrderAsString:0 size:0 canExpand:YES]; [Defaults set:COL_ORDER_DEF str:s]; free(s); } } //----------------------------------------------------------------------------- // - tableScroll:border:slotDraggedFrom:to: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotDraggedFrom:(int)fromPos to:(int)toPos { [self saveSlotOrder:ts border:b]; return self; } //----------------------------------------------------------------------------- // - tableScroll:border:slotSortReversed: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts border:(MiscBorderType)b slotSortReversed:(int)n { [self saveSlotOrder:ts border:b]; return self; } //----------------------------------------------------------------------------- // - tableScroll:canEdit:at:: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts canEdit:(NXEvent const*)ev at:(int)row :(int)col { return ((ev == 0 || ev->data.mouse.click == 2) && col == NAME_SLOT && ![dirArray isLockedAt:row]); } //----------------------------------------------------------------------------- // - tableScroll:setStringValue:at:: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts setStringValue:(char const*)s at:(int)row :(int)col { while (*s != '\0' && isspace(*s)) s++; [dirArray setName:s at:row]; return YES; } //----------------------------------------------------------------------------- // -tableScroll:draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (NXDragOperation)tableScroll:(MiscTableScroll*)s draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NX_DragOperationAll; } //----------------------------------------------------------------------------- // tableScrollIgnoreModifierKeysWhileDragging: //----------------------------------------------------------------------------- - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)s { return NO; } //----------------------------------------------------------------------------- // - tableScroll:preparePasteboard:forDragOperationAt:: //----------------------------------------------------------------------------- - (void)tableScroll:(MiscTableScroll*)s preparePasteboard:(Pasteboard*)pb forDragOperationAt:(int)r :(int)c { char const* const name = [dirArray entryAt:r]->name; char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, path ), "/" ), name ); [pb declareTypes:&NXFilenamePboardType num:1 owner:0]; [pb writeType:NXFilenamePboardType data:buff length:strlen(buff)]; } //----------------------------------------------------------------------------- // - tableScroll:allowDragOperationAt:: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)s allowDragOperationAt:(int)r :(int)c { return (c == ICON_SLOT); } //----------------------------------------------------------------------------- // - tableScroll:imageForDragOperationAt:: //----------------------------------------------------------------------------- - (NXImage*)tableScroll:(MiscTableScroll*)s imageForDragOperationAt:(int)r :(int)c { return [dirArray getImageAt:r scaled:!dragUnscaled]; } //----------------------------------------------------------------------------- // - fillScroll //----------------------------------------------------------------------------- - (void)fillScroll { char buff[ 128 ]; [window disableDisplay]; [scroll renewRows:[dirArray count]]; if ([scroll autoSortRows]) [scroll sortRows]; sprintf( buff, "%d files %lu bytes", [dirArray count], [dirArray totalBytes] ); [countField setStringValue:buff]; [self updateButtons]; [[window reenableDisplay] display]; } //----------------------------------------------------------------------------- // - setPath: //----------------------------------------------------------------------------- - (void)setPath:(char const*)dirname { NXZone* const z = [self zone]; int dirlen; if (path != 0) NXZoneFree( z, path ); if (dirname == 0) dirname = NXHomeDirectory(); if (dirname == 0) dirname = "/"; dirlen = strlen( dirname ) + 1; path = (char*) NXZoneMalloc( z, dirlen ); memcpy( path, dirname, dirlen ); [window setTitleAsFilename:path]; } //----------------------------------------------------------------------------- // - loadDirectory: //----------------------------------------------------------------------------- - (void)loadDirectory:(char const*)dirname { int rc = [dirArray loadPath:dirname showHidden:showHidden]; if (rc != 0) NXRunAlertPanel( "Can't Open", "Cannot open directory, %s\n%d:%s", "OK", 0, 0, path, rc, strerror(rc) ); } //----------------------------------------------------------------------------- // - reload //----------------------------------------------------------------------------- - (void)reload { [scroll abortEditing]; [self loadDirectory:path]; [self fillScroll]; } //----------------------------------------------------------------------------- // - load: //----------------------------------------------------------------------------- - (void)load:(char const*)dirname { [self setPath:dirname]; [self reload]; } //----------------------------------------------------------------------------- // - export: //----------------------------------------------------------------------------- - (id)export:(id)sender { [[MiscExporter commonInstance] exportTableScroll:scroll]; return self; } //----------------------------------------------------------------------------- // - print: //----------------------------------------------------------------------------- - (id)print:(id)sender { [scroll printPSCode:self]; return self; } //----------------------------------------------------------------------------- // - openSelected: //----------------------------------------------------------------------------- - (id)openSelected:(id)sender { if ([scroll hasRowSelection]) { int i; int len; char buff[ FILENAME_MAX + 1 ]; MiscIntList* list = [[MiscIntList allocFromZone:[self zone]] init]; strcpy( buff, path ); len = strlen( buff ); if (len == 0 || buff[len - 1] != '/') { buff[ len++ ] = '/'; buff[ len ] = '\0'; } [scroll selectedRows:list]; for (i = [list count]; i-- > 0; ) { int row = [list intAt:i]; strcpy( buff + len, [dirArray entryAt:row]->name ); if ([self isDir:row]) [[self class] launchDir:buff]; else [[Application workspace] openFile:buff]; } [list free]; } return self; } //----------------------------------------------------------------------------- // - destroy: //----------------------------------------------------------------------------- - (id)destroy:(id)sender { if ([dirArray dirWritable] && [scroll hasRowSelection]) { if (NXRunAlertPanel( "Delete Files", "Delete selected files?", "Yes", "No", 0 ) == NX_ALERTDEFAULT) { size_t totalLen = 0; char* fileList; int i; NXZone* const z = [self zone]; MiscIntList* list = [[MiscIntList allocFromZone:z] init]; [scroll selectedRows:list]; for (i = [list count]; i-- > 0; ) { DirEntry const* de = [dirArray entryAt:[list intAt:i]]; if (de->name != 0) totalLen += strlen( de->name ) + 1; } fileList = (char*) NXZoneMalloc( z, totalLen + 1 ); totalLen = 0; for (i = [list count]; i-- > 0; ) { DirEntry const* de = [dirArray entryAt:[list intAt:i]]; char const* const s = de->name; if (s != 0) { int const len = strlen(s); strcpy( fileList + totalLen, s ); totalLen += len; fileList[ totalLen++ ] = '\t'; } } fileList[ totalLen ] = '\0'; [[Application workspace] performFileOperation:WSM_DESTROY_OPERATION source:path destination:"" files:fileList options:""]; NXZoneFree( z, fileList ); [list free]; [self reload]; } } return self; } //----------------------------------------------------------------------------- // - rename:to:msg:sys: //----------------------------------------------------------------------------- - (BOOL)rename:(char const*)oldName to:(char const*)newName msg:(char const**)msg sys:(char const**)sys { BOOL ok = NO; char oldPath[ MAXPATHLEN ]; char newPath[ MAXPATHLEN ]; struct stat st; int pathLen; int rc; pathLen = strlen( path ); assert( pathLen > 0 ); memcpy( oldPath, path, pathLen ); memcpy( newPath, path, pathLen ); if (oldPath[ pathLen - 1 ] != '/') { oldPath[ pathLen ] = '/'; newPath[ pathLen ] = '/'; pathLen++; } strcpy( oldPath + pathLen, oldName ); strcpy( newPath + pathLen, newName ); rc = stat( newPath, &st ); if (rc == 0) *msg = "Filename in use."; else if (errno != ENOENT) { *msg = "stat(): "; *sys = strerror( errno ); } else // (rc != 0 && errno == ENOENT) { rc = rename( oldPath, newPath ); if (rc == 0) ok = YES; else { *msg = "rename(): "; *sys = strerror( errno ); } } return ok; } //----------------------------------------------------------------------------- // - textWillEnd: //----------------------------------------------------------------------------- - (BOOL)textWillEnd:(id)sender { BOOL reject = YES; int r,c,len; char const* errMsg; char const* sysErr; char const* oldName; char* newName; r = [scroll clickedRow]; c = [scroll clickedCol]; assert( c == NAME_SLOT ); oldName = [dirArray entryAt:r]->name; if (oldName == 0) oldName = ""; len = [sender textLength]; if (len == 0) errMsg = "Filename cannot be the empty string."; else if (len + 1 + strlen(path) >= MAXPATHLEN) errMsg = "Filename too long."; else { newName = (char*) malloc( len + 1 ); assert( newName != 0 ); [sender getSubstring:newName start:0 length:len + 1]; if (strcmp( newName, oldName ) == 0) reject = NO; // Unchanged, silently ignore. else if (strcmp( newName, ".." ) == 0 || strcmp( newName, "." ) == 0 || strchr( newName, '/' ) != 0) errMsg = "Illegal filename."; else reject = ![self rename:oldName to:newName msg:&errMsg sys:&sysErr]; free( newName ); } if (reject) { if (sysErr == 0) sysErr = ""; NXRunAlertPanel( "Error", "%s%s", "OK", 0, 0, errMsg, sysErr ); [sender setText:oldName]; } return reject; } //----------------------------------------------------------------------------- // - refreshPressed: //----------------------------------------------------------------------------- - (id)refreshPressed:(id)sender { [self reload]; return self; } //----------------------------------------------------------------------------- // - cdPressed: //----------------------------------------------------------------------------- - (id)cdPressed:(id)sender { [scroll abortEditing]; if ([scroll numSelectedRows] == 1) { MiscCoord_P const row = [scroll selectedRow]; if ([self isDir:row]) { char buff[ FILENAME_MAX * 2 + 1 ]; strcat( strcat( strcpy( buff, path ), "/" ), [dirArray entryAt:row]->name ); normalize_path( buff, sizeof(buff) ); [self load:buff]; } } return self; } //----------------------------------------------------------------------------- // - rowNumbersClick: //----------------------------------------------------------------------------- - (id)rowNumbersClick:(id)sender { BOOL const newVal = ([rowNumbersSwitch state] != 0); BOOL const oldVal = [scroll rowTitlesOn]; if (newVal != oldVal) { DEFAULT_ROW_NUMBERS = newVal; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [Defaults set:ROW_NUMBERS_DEF bool:DEFAULT_ROW_NUMBERS]; } return self; } //----------------------------------------------------------------------------- // - autoSortClick: //----------------------------------------------------------------------------- - (id)autoSortClick:(id)sender { BOOL const switchState = [autoSortSwitch state]; [scroll abortEditing]; if (autoSort != switchState) { DEFAULT_AUTO_SORT = autoSort = switchState; [Defaults set:SORT_DEF bool:DEFAULT_AUTO_SORT]; [scroll setAutoSortRows:switchState]; if (switchState) [scroll sortRows]; } return self; } //----------------------------------------------------------------------------- // - hiddenFilesClick: //----------------------------------------------------------------------------- - (id)hiddenFilesClick:(id)sender { BOOL const switchState = [hiddenFilesSwitch state]; [scroll abortEditing]; if (showHidden != switchState) { DEFAULT_SHOW_HIDDEN = showHidden = switchState; [Defaults set:HIDDEN_DEF bool:DEFAULT_SHOW_HIDDEN]; [self reload]; } return self; } //----------------------------------------------------------------------------- // - highlightClick: //----------------------------------------------------------------------------- - (id)highlightClick:(id)sender { BOOL const switchState = [highlightSwitch state]; [scroll abortEditing]; if (highlightDirs != switchState) { DEFAULT_HIGHLIGHT_DIRS = highlightDirs = switchState; [Defaults set:HLIGHT_DEF bool:DEFAULT_HIGHLIGHT_DIRS]; [scroll display]; } return self; } //----------------------------------------------------------------------------- // - dragUnscaledClick: //----------------------------------------------------------------------------- - (id)dragUnscaledClick:(id)sender { BOOL const switchState = [dragUnscaledSwitch state]; if (dragUnscaled != switchState) { DEFAULT_DRAG_UNSCALED = dragUnscaled = switchState; [Defaults set:UNSCALED_DEF bool:DEFAULT_DRAG_UNSCALED]; } return self; } //----------------------------------------------------------------------------- // - lockClick: //----------------------------------------------------------------------------- - (id)lockClick:(id)sender { int const row = [sender clickedRow]; if ([dirArray canToggleLockAt:row]) { [dirArray setLocked:![dirArray isLockedAt:row] at:row]; if ([sender autoSortRows]) [sender sortRow:row]; } return self; } //----------------------------------------------------------------------------- // - scrollClick: //----------------------------------------------------------------------------- - (id)scrollClick:(id)sender { [self updateButtons]; return self; } //----------------------------------------------------------------------------- // - scrollDoubleClick: //----------------------------------------------------------------------------- - (id)scrollDoubleClick:(id)sender { [self openSelected:sender]; return self; } //----------------------------------------------------------------------------- // - activateWindow //----------------------------------------------------------------------------- - (void)activateWindow { [window makeKeyAndOrderFront:0]; } //----------------------------------------------------------------------------- // - windowWillClose: //----------------------------------------------------------------------------- - (id)windowWillClose:(id)sender { [scroll abortEditing]; [OPEN_DIRS removeObject:self]; [NXApp delayedFree:self]; return self; } //----------------------------------------------------------------------------- // - windowDidResize: //----------------------------------------------------------------------------- - (id)windowDidResize:(id)sender { NXRect r; [sender getFrame:&r]; if (r.size.width != DEFAULT_WIN_SIZE.width || r.size.height != DEFAULT_WIN_SIZE.height) { DEFAULT_WIN_SIZE = r.size; [Defaults set:SIZE_DEF size:DEFAULT_WIN_SIZE]; } return self; } //----------------------------------------------------------------------------- // - setDefaultColor: //----------------------------------------------------------------------------- - (void)setDefaultColor:(NXColor)c { DEFAULT_COLOR = c; [Defaults set:COLOR_DEF color:c]; } //----------------------------------------------------------------------------- // - setColors: //----------------------------------------------------------------------------- - (void)setColors:(NXColor)c { [window disableDisplay]; [window setBackgroundColor:c]; [scroll setColor:c]; [window reenableDisplay]; } //----------------------------------------------------------------------------- // - draggingEntered: //----------------------------------------------------------------------------- - (NXDragOperation)draggingEntered:(id)sender { return ([sender draggingSourceOperationMask] & NX_DragOperationGeneric); } //----------------------------------------------------------------------------- // - performDragOperation: //----------------------------------------------------------------------------- - (BOOL)performDragOperation:(id)sender { [self setDefaultColor: NXReadColorFromPasteboard( [sender draggingPasteboard] )]; [self setColors:DEFAULT_COLOR]; [window display]; return YES; } //----------------------------------------------------------------------------- // - initLazyRow //----------------------------------------------------------------------------- - (void)initLazyRow { Font* font = [scroll font]; NXZone* const z = [self zone]; int i; for (i = 0; i < MAX_SLOT; i++) { id cell = [[scroll colCellPrototype:i] copyFromZone:z]; if ([cell respondsTo:@selector(setOwner:)]) [cell setOwner:scroll]; else if ([cell respondsTo:@selector(setFont:)]) [cell setFont:font]; lazyRow[i] = cell; } } //----------------------------------------------------------------------------- // - initDefaults //----------------------------------------------------------------------------- - (void)initDefaults { static BOOL initialized = NO; if (!initialized) { NXRect r; [window getFrame:&r]; DEFAULT_WIN_SIZE = r.size; DEFAULT_FONT = [Defaults getFont:FONT_DEF fallback:[scroll font]]; initialized = YES; } } //----------------------------------------------------------------------------- // - loadDefaults //----------------------------------------------------------------------------- - (void)loadDefaults { NXRect r; char const* s; [window getFrame:&r]; r.size = [Defaults getSize:SIZE_DEF fallback:DEFAULT_WIN_SIZE]; [window placeWindow:&r]; autoSort = DEFAULT_AUTO_SORT; showHidden = DEFAULT_SHOW_HIDDEN; highlightDirs = DEFAULT_HIGHLIGHT_DIRS; dragUnscaled = DEFAULT_DRAG_UNSCALED; [autoSortSwitch setState:autoSort]; [hiddenFilesSwitch setState:showHidden]; [highlightSwitch setState:highlightDirs]; [dragUnscaledSwitch setState:dragUnscaled]; [rowNumbersSwitch setState:DEFAULT_ROW_NUMBERS]; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [scroll setAutoSortRows:autoSort]; [scroll setFont:DEFAULT_FONT]; [self setColors:DEFAULT_COLOR]; s = [Defaults getStr:COL_SIZES_DEF fallback:0]; if (s) [scroll setColSizesFromString:s]; s = [Defaults getStr:COL_ORDER_DEF fallback:0]; if (s) [scroll setColOrderFromString:s]; } //----------------------------------------------------------------------------- // - initLockSlot //----------------------------------------------------------------------------- - (void)initLockSlot { id proto = [scroll colCellPrototype:LOCK_SLOT]; [proto setType:NX_SWITCH]; [proto setIconPosition:NX_ICONONLY]; [proto setTarget:self]; [proto setAction:@selector(lockClick:)]; [proto setImage:LOCKED_ICON]; [proto setAltImage:UNLOCKED_ICON]; } //----------------------------------------------------------------------------- // - initNameSlot //----------------------------------------------------------------------------- - (void)initNameSlot { id proto = [scroll colCellPrototype:NAME_SLOT]; [proto setEditable:YES]; [proto setScrollable:YES]; } //----------------------------------------------------------------------------- // - initSlots //----------------------------------------------------------------------------- - (void)initSlots { [self initLockSlot]; [self initNameSlot]; [[scroll colCellPrototype:SIZE_SLOT] setAlignment:NX_RIGHTALIGNED]; [[scroll colCellPrototype:HARDLINKS_SLOT] setAlignment:NX_RIGHTALIGNED]; } //----------------------------------------------------------------------------- // - initWithDir: //----------------------------------------------------------------------------- - (id)initWithDir:(char const*)dirname { char buff[ FILENAME_MAX + 1 ]; NXZone* const z = [self zone]; [super init]; path = 0; dirArray = [[DirArray allocFromZone:z] init]; [[NXBundle bundleForClass:[self class]] getPath:buff forResource:[[self class] name] ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:z]; [window registerForDraggedTypes:&NXColorPboardType count:1]; [self initSlots]; [self initDefaults]; [self loadDefaults]; [self initLazyRow]; [self load:dirname]; [OPEN_DIRS addObject:self]; [self cascade]; return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { return [self initWithDir:NXHomeDirectory()]; } //----------------------------------------------------------------------------- // - free //----------------------------------------------------------------------------- - (id)free { int i; NXZone* const z = [self zone]; [window setDelegate:0]; [window close]; [window free]; if (path != 0) free( path ); [dirArray free]; for (i = 0; i < MAX_SLOT; i++) [lazyRow[i] free]; [super free]; RETIRE_ZONE(z); return 0; } //----------------------------------------------------------------------------- // - path //----------------------------------------------------------------------------- - (char const*)path { return path; } //----------------------------------------------------------------------------- // + findDir: //----------------------------------------------------------------------------- + (DirWindow*)findDir:(char const*)normalizedPath { if (normalizedPath != 0) { unsigned int i; unsigned int const lim = [OPEN_DIRS count]; for (i = 0; i < lim; i++) { DirWindow* p = (DirWindow*) [OPEN_DIRS objectAt:i]; char const* s = [p path]; if (s != 0 && strcmp( s, normalizedPath ) == 0) return p; } } return 0; } //----------------------------------------------------------------------------- // + launchDir: //----------------------------------------------------------------------------- + (void)launchDir:(char const*)dirname { DirWindow* p = 0; char buff[ FILENAME_MAX + 1 ]; if (dirname == 0) dirname = NXHomeDirectory(); if (dirname == 0) dirname = "/"; strncpy( buff, dirname, sizeof(buff) ); buff[ sizeof(buff) - 1 ] = '\0'; normalize_path( buff, sizeof(buff) ); if ((p = [self findDir:buff]) == 0) p = [[self allocFromZone:EMPLOY_ZONE()] initWithDir:buff]; [p activateWindow]; } @end MiscKit/Examples/LazyScrollDir/HISTORY.txt100444 1750 1750 20012 6757716270 20663 0ustar sunshinesunshine//----------------------------------------------------------------------------- // LazyScrollDir HISTORY.txt // $Id: HISTORY.txt,v 1.10 99/06/29 08:28:56 sunshine Exp $ //----------------------------------------------------------------------------- v19 1999/06/29 08:20 EDT sunshine@sunshineco.com Synchronized with LazyScrollDir v19.1 for OpenStep. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Reorganized DirWindow.nib layout to match OpenStep counterpart. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Updated copyrignt on Info panel. Updated copyright and contact information in README. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Added copyright notice to LazyScrollDir_main.m. PB.project no longer generates main() file upon save. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Now correctly uses -tableScroll:changeFont:to: rather than -tableScroll:fontChangedFrom:to: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Superscript, Subscript, and Unscript from Font menu since they made no sense in this context. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Ported back to NextStep 3.2. Had to add -I & -L directives to OTHER_CFLAGS & OTHER_LDFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize these directives when specified via NextStep 3.3's Project Builder. Changed Files: * DirController.{h|m} * DirWindows.{h|m|nib} * Info.nib * LazyScrollDir.nib * LazyScrollDir_main.m * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf * SD_PageLayout.{h|m|nib} + unpack.sh v18 1998/03/23 23:38 EST sunshine@sunshineco.com Implemented -tableScroll:draggingSourceOperationMaskForLocal: since the default changed from Copy to Generic in MiscTableScroll v126. Added -tableScrollIgnoreModifierKeysWhileDragging:, which returns NO. Updated copyright notices on user interface items. Added a "Printing" section to the README. Added license and contact information to the README. Fixed v1 bug: Wasn't respecting highlighted-text color. Problem was that the cell's "owner" was never getting set. Changed Files: * DirWindow.m * Info.nib * Makefile * PB.project * README.rtf v17 1997/11/24 17:05 EST sunshine@sunshineco.com Synchronized with ScrollDir v33 for NEXTSTEP. Added row-numbers switch. Changed Files: * DirWindow.{h|m|nib} v16 1997/07/08 12:00 EDT sunshine@sunshineco.com Moved include and libarary paths from Makefile.preamble into PB.project. Added /LocalDeveloper/Headers to include paths. Added /LocalDeveloper/Libraries to library paths. Moved -Wwrite-strings from Makefile.preamble into PB.project. Removed hard-coded names from 'relink' target in Makefile.postamble. Worked around AppKit but where the Cell class blindly allocates ClipViews from transient zones and caches them for later re-use. Fixed broken wording in README. Changed Files: * DirWindow.m * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf v15 1997/06/10 04:51 EDT sunshine@sunshineco.com Synchonized with ScrollDir v30 for NEXTSTEP. Now sets window title with -setTitleAsFilename:. Fixed bug: Wasn't taking "sticky bit" on directories into account when computing whether file could be renamed. No longer misleadingly stat()'s the file which a soft-link points at. Ditched the Message slot. Changed Files: * DirArray.{h|m} * DirWindow.{h|m|nib} * pack.sh * pack_binaries.sh * unpack_binaries.sh v14 1997/03/22 23:36 EST sunshine@sunshineco.com Lock column in DirWindow.nib was incorrectly sizeable and auto-sizing. SD_PageLayout.{h|m} RCS files were missing. Changed Files: * DirWindow.nib + SD_PageLayout.{h|m},v v13 1997/02/05 04:03 EST sunshine@sunshineco.com Synchronized with ScrollDir v29 for NEXTSTEP. Fixed order of headers in DirWindow.m. If directory is readonly then no longer responds to Delete (cmd-r). Removed deviant semi-colon from NameCache.h. Reorganized main menu to be consistent with other NEXTSTEP applications. Added new delegate methods for support of image dragging out of cells. Added capability to drag scaled or unscaled image from icon cell. Added new column which demonstrates how to use ButtonCell in TableScroll. Fixed wording on Info panel. Updated all the copyrights to include 1997 (including Info.nib). Unified formatting. Updated documentation to reflect the new features. Renamed: "Update" -> "Refresh" Checked all of the files into RCS. Added pack and unpack scripts. Added text-cell editing to rename files. Also added preliminary printing. Changed Files: * Everything v12 1996/10/07 10:41 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v109. Added Save command for exporting contents of TableScroll. v11 1996/10/07 10:32 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v105. Responds to new slot-sort-reversed message. Added row-titles for purposes of testing row-wise dragging. This is not very nice or useful for the user interface, but is extremely useful for testing TableScroll. (Perhaps we should add a button to toggle this). v10 was created by sunshine. It incorporated many experimental features, but was abandoned. v11 is a direct descendent of v9. v9 1996/02/15 06:00 EST zarnuk@zarnuk.com Fixed includes since MiscTableScroll.h no longer includes MiscIntList.h v8 1996/02/09 01:00 EST sunshine@sunshineco.com Replaced NameCache's custom hash table with NeXT's HashTable. Info panel will now load README.rtf or README.rtfd. DirArray is now an Objective-C class rather than kludgy C. Updated README. v7 1996/02/01 04:15 EST sunshine@sunshineco.com Added Defaults.[mh] as a simple front-end to NeXT defaults. The following are now saved and restored via NeXT defaults: Auto-sort Column order Column widths Font Highlight directories Show hidden Window color Window size Fixed bug which caused file icons of "/" directory to be incorrect. The filename sent to the Workspace to retrieve the icons lacked a null-terminator. Fixed bug where toggling "show hidden" switch was ineffective on current brower window (but did correctly affect new ones). Added a README.rtf file which explains what this example demonstrates. Added an Info panel that displays the README.rtf file. v6 1996/01/17 05:00 EST sunshine@sunshineco.com Fixed warning that showed up when compiling for debug. Had to replace (int const) with #define for array size. v5 1996/01/17 04:00 EST zarnuk@zarnuk.com Added NameCache classes to cache user and group names since looking them up in NetInfo for every display and sort is excessively time consuming. v4 1996/01/17 02:00 EST sunshine@sunshineco.com Removed mcgh2misc conversions scripts since the one in the palette directory now handles the example directories automatically. v3 1996/01/16 20:00 EST zarnuk@zarnuk.com Fixed mcgh2misc.csh. v2 1996/01/16 19:00 EST zarnuk@zarnuk.com Implemented -tableScroll:intValueAt::, tagAt::, stringValueAt:: Sorting is much faster now. The only slow columns are the owner and group columns. v1 1996/01/05 13:00 EST zarnuk@zarnuk.com Lazy version derived from scrollDir v17 for NEXTSTEP. MiscKit/Examples/LazyScrollDir/LazyScrollDir.iconheader100444 1750 1750 110 6757716251 23475 0ustar sunshinesunshineF LazyScrollDir.app LazyScrollDir app F LazyScrollDir LazyScrollDir app MiscKit/Examples/LazyScrollDir/Lock.secure.tiff100444 1750 1750 2762 6757716261 22004 0ustar sunshinesunshineII*ð \40ý@ê•@Àê•EÀê•EÀê•EÐUU???ð?ü??ü?<?<À?<À?<À?ÿÿð?ÿÿð?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿÿ?ÿÿ?? ¦®¶¾(R8†~~€ü '€ü 'ÿÿÿÿÿÿÿÿU?U?U?ÿÿÿÿU?U?ÿÿU?U?U?U?U?U?U?ÿÿþÿÿÿ™¯D_þÿªÏªÏª¿ªÏD_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_þÿªÏªÏª¿ªÏD_D_D_D_D_D_ÿÿD_D_ÿÿªÏªÏªÏªÏD_D_D_D_D_D_ÿÿD_D_D_D_D_D_D_D_D_D_D_D_ ÚÆrâê(R€ü '€ü 'MiscKit/Examples/LazyScrollDir/LazyScrollDir_main.m100444 1750 1750 2337 6757716252 22672 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: LazyScrollDir_main.m,v 1.2 99/06/29 08:22:09 sunshine Exp $ // $Log: LazyScrollDir_main.m,v $ // Revision 1.2 99/06/29 08:22:09 sunshine // v19: Cleaned up. Added copyright notice. // //----------------------------------------------------------------------------- #import void main( int argc, char const* const argv [] ) { [Application new]; if ([NXApp loadNibSection:"LazyScrollDir.nib" owner:NXApp withNames:NO]) [NXApp run]; [NXApp free]; exit(0); } MiscKit/Examples/LazyScrollDir/Pagination.HAuto.VAuto.tiff100444 1750 1750 406 6757716261 23745 0ustar sunshinesunshineMM*8€? J¨ùÝUBa0ˆ, ‚@á°ˆ‚ê-UE—Qˆ€?àP8$ „BaP˜æ îöþ(R)! ü€' ü€'MiscKit/Examples/LazyScrollDir/Makefile100444 1750 1750 3306 6757716270 20410 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = LazyScrollDir PROJECTVERSION = 1.1 LANGUAGE = English APPICON = LazyScrollDir.tiff LOCAL_RESOURCES = DirWindow.nib Info.nib LazyScrollDir.nib\ SD_PageLayout.nib GLOBAL_RESOURCES = Align.HCentered.VCentered.tiff\ Align.HCentered.VTop.tiff Align.HLeft.VCentered.tiff\ Align.HLeft.VTop.tiff Lock.insecure.tiff\ Lock.secure.tiff Pagination.HAuto.VAuto.tiff\ Pagination.HAuto.VClip.tiff Pagination.HAuto.VFit.tiff\ Pagination.HClip.VAuto.tiff\ Pagination.HClip.VClip.tiff Pagination.HClip.VFit.tiff\ Pagination.HFit.VAuto.tiff Pagination.HFit.VClip.tiff\ Pagination.HFit.VFit.tiff PACKAGE_NUMBER README.rtf CLASSES = Defaults.m DirArray.m DirController.m DirWindow.m\ NameCache.m SD_PageLayout.m HFILES = Defaults.h DirArray.h DirController.h DirWindow.h NameCache.h\ SD_PageLayout.h MFILES = LazyScrollDir_main.m OTHERSRCS = Makefile Makefile.postamble Makefile.preamble MAKEFILEDIR = /NextDeveloper/Makefiles/app MAKEFILE = app.make INSTALLDIR = $(HOME)/Apps INSTALLFLAGS = -c -s -m 755 SOURCEMODE = 444 ICONSECTIONS = -sectcreate __ICON app LazyScrollDir.tiff LIBS = -lMedia_s -lMiscTableScroll -lNeXT_s DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit/Examples/LazyScrollDir/Makefile.postamble100444 1750 1750 1646 6757716252 22402 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.postamble # $Id: Makefile.postamble,v 1.3 99/06/29 08:20:53 sunshine Exp $ #------------------------------------------------------------------------------ relink: -rm $(PRODUCT_ROOT)/$(NAME) $(MAKE) MiscKit/Examples/LazyScrollDir/Makefile.preamble100444 1750 1750 3074 6757716271 22201 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.3 99/06/29 08:20:45 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # As of NextStep 3.3, -I & -L directives, and other CFLAGS settings can be # configured directly in Project Builder. However, in order to support # NextStep 3.2 which does not have such a facility, we still need to specify # these values here. #------------------------------------------------------------------------------ OTHER_CFLAGS = -Werror -Wwrite-strings \ -I../MiscTableScroll -I../../Headers -I../../../Headers \ -I../../Palettes/MiscTableScroll -I/LocalDeveloper/Headers OTHER_LDFLAGS = -L../MiscTableScroll -L../../../Libraries \ -L../../Palettes/MiscTableScroll -L/LocalDeveloper/Libraries \ -L/LocalLibrary/lib MiscKit/Examples/LazyScrollDir/NameCache.h100444 1750 1750 3140 6757716253 20722 0ustar sunshinesunshine#ifndef __NameCache_h #define __NameCache_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // NameCache.h // // Data structure and routines for caching user names and group names. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: NameCache.h,v 1.1 97/02/05 08:22:55 sunshine Exp $ // $Log: NameCache.h,v $ // Revision 1.1 97/02/05 08:22:55 sunshine // v13: Synchronized with ScrollDir (v29). // //----------------------------------------------------------------------------- #import @class HashTable; @interface NameCache : Object { HashTable* table; } - (char const*)lookup:(int)ident; @end @interface OwnerCache : NameCache // user name (owner) cache. + (id)commonInstance; @end @interface GroupCache : NameCache // group name cache. + (id)commonInstance; @end #endif // __NameCache_h MiscKit/Examples/LazyScrollDir/NameCache.m100444 1750 1750 13034 6757716253 20752 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // NameCache.m // // Data structure and routines for caching user names and group names. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: NameCache.m,v 1.1 97/02/05 08:22:53 sunshine Exp $ // $Log: NameCache.m,v $ // Revision 1.1 97/02/05 08:22:53 sunshine // v13: Synchronized with ScrollDir (v29). // //----------------------------------------------------------------------------- #import "NameCache.h" #import #import #import #import // vm_page_size #import static NXZone* theZone = 0; //----------------------------------------------------------------------------- // store_string //----------------------------------------------------------------------------- static char const* store_string( char const* s ) { char* t = 0; if (s != 0) t = NXCopyStringBufferFromZone( s, theZone ); return t; } //----------------------------------------------------------------------------- // str_int //----------------------------------------------------------------------------- static char const* str_int( int x ) { static char buff[ 32 ]; sprintf( buff, "%d", x ); return buff; } //============================================================================= // NAME CACHE //============================================================================= @implementation NameCache //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (id)initialize { if (theZone == 0) theZone = NXCreateZone( vm_page_size, vm_page_size, NO ); return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; table = [[HashTable alloc] initKeyDesc:"i" valueDesc:"*"]; return self; } //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)x { [self subclassResponsibility:_cmd]; return 0; } //----------------------------------------------------------------------------- // - store: //----------------------------------------------------------------------------- - (char const*)store:(int)ident { char const* name = store_string( [self resolve:ident] ); [table insertKey:(void const*)ident value:(void*)name]; return name; } //----------------------------------------------------------------------------- // - lookup: //----------------------------------------------------------------------------- - (char const*)lookup:(int)ident { char const* name = 0; if ([table isKey:(void const*)ident]) name = [table valueForKey:(void const*)ident]; else name = [self store:ident]; return name; } @end //============================================================================= // OWNER CACHE //============================================================================= @implementation OwnerCache //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)uid { char const* s = 0; struct passwd const* const pw = getpwuid( uid ); if (pw != 0) s = pw->pw_name; else s = str_int( uid ); return s; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (id)commonInstance { static id obj = 0; if (obj == 0) obj = [[self allocFromZone:theZone] init]; return obj; } @end //============================================================================= // GROUP CACHE //============================================================================= @implementation GroupCache //----------------------------------------------------------------------------- // - resolve: //----------------------------------------------------------------------------- - (char const*)resolve:(int)gid { char const* s = 0; struct group const* const gr = getgrgid( gid ); if (gr != 0) s = gr->gr_name; else s = str_int( gid ); return s; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (id)commonInstance { static id obj = 0; if (obj == 0) obj = [[self allocFromZone:theZone] init]; return obj; } @end MiscKit/Examples/LazyScrollDir/PACKAGE_NUMBER100444 1750 1750 3 6757716253 20706 0ustar sunshinesunshine19 MiscKit/Examples/LazyScrollDir/PB.gdbinit100444 1750 1750 166 6757716253 20575 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # view MiscKit/Examples/LazyScrollDir/PB.project100444 1750 1750 2704 6757716270 20642 0ustar sunshinesunshineINSTALLDIR = "$(HOME)/Apps"; DOCICONFILES = (); COMPILEROPTIONS = ""; APPICON = LazyScrollDir.tiff; GENERATEMAIN = NO; FILESTABLE = { M_FILES = (LazyScrollDir_main.m); OTHER_LINKED = (); H_FILES = (Defaults.h, DirArray.h, DirController.h, DirWindow.h, NameCache.h, SD_PageLayout.h); CLASSES = (Defaults.m, DirArray.m, DirController.m, DirWindow.m, NameCache.m, SD_PageLayout.m); IMAGES = (Align.HCentered.VCentered.tiff, Align.HCentered.VTop.tiff, Align.HLeft.VCentered.tiff, Align.HLeft.VTop.tiff, Lock.insecure.tiff, Lock.secure.tiff, Pagination.HAuto.VAuto.tiff, Pagination.HAuto.VClip.tiff, Pagination.HAuto.VFit.tiff, Pagination.HClip.VAuto.tiff, Pagination.HClip.VClip.tiff, Pagination.HClip.VFit.tiff, Pagination.HFit.VAuto.tiff, Pagination.HFit.VClip.tiff, Pagination.HFit.VFit.tiff); HEADERSEARCH = (); C_FILES = (); OTHER_RESOURCES = (PACKAGE_NUMBER, README.rtf); OTHER_SOURCES = (Makefile, Makefile.postamble, Makefile.preamble); PUBLIC_FILES = (); LIBRARYSEARCH = (); OTHER_LIBS = (Media_s, MiscTableScroll, NeXT_s); INTERFACES = (DirWindow.nib, Info.nib, LazyScrollDir.nib, SD_PageLayout.nib); }; APPCLASS = Application; MAINNIB = LazyScrollDir; LINKEROPTIONS = ""; DOCEXTENSIONS = (); PROJECTTYPE = Application; PROJECTVERSION = 1.1; LOCALIZABLE_FILES = { DirWindow.nib; LazyScrollDir.nib; Info.nib; SD_PageLayout.nib; }; PROJECTNAME = LazyScrollDir; SYSTEMEXTENSIONS = (); LANGUAGE = English; MiscKit/Examples/LazyScrollDir/Pagination.HAuto.VClip.tiff100444 1750 1750 414 6757716261 23723 0ustar sunshinesunshineMM*>€? J¨ùÝUBa%hbªV3CáP¸l># ‰¦£Q5Ti5€€€?àP8$ „BaP˜ì ôü(R.& ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HAuto.VFit.tiff100444 1750 1750 374 6757716261 23563 0ustar sunshinesunshineMM*.€* P8$ BUP—óºˆD`°€?àP8$ „BaP˜Ü äìô(R ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HClip.VAuto.tiff100444 1750 1750 410 6757716261 23717 0ustar sunshinesunshineMM*:€?ŠÅeT¬fƒ*¡P¨L…Ã"èLEtšMDUQxÌF€?àP8$ „BaP˜è ðø(R+# ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HClip.VClip.tiff100444 1750 1750 412 6757716262 23701 0ustar sunshinesunshineMM*<€?ŠÅeT¬fƒ*¡P¨f†Âá5T>#MFbJ¨Êj7€?àP8$ „BaP˜ê òú(R,$ ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HClip.VFit.tiff100444 1750 1750 376 6757716262 23545 0ustar sunshinesunshineMM*0€* P8$ ŠÊ¨IXÍ ƒÄbPX€?àP8$ „BaP˜Þ æîö(R  ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HFit.VAuto.tiff100444 1750 1750 402 6757716262 23554 0ustar sunshinesunshineMM*4€*•î¥T ‚Âa¸* †AáJ¸t)€€€?àP8$ „BaP˜â êòú(R% ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HFit.VClip.tiff100444 1750 1750 406 6757716262 23537 0ustar sunshinesunshineMM*8€*•î¥T ‚ÂUJST†Â¡q|N$ªTÅãx€?àP8$ „BaP˜æ îöþ(R)! ü€' ü€'MiscKit/Examples/LazyScrollDir/Pagination.HFit.VFit.tiff100444 1750 1750 374 6757716262 23376 0ustar sunshinesunshineMM*.€* P8$ Wº P˜\*ˆA €?àP8$ „BaP˜Ü äìô(R ü€' ü€'MiscKit/Examples/LazyScrollDir/README.rtf100444 1750 1750 15716 6757716270 20452 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs;} \paperw10980 \paperh10140 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\b\i0\ulnone\fs36\fc1\cf1 LazyScrollDir\ \b0\fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 ã \f0 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine\ June 25, 1999\ \ \b\fs28 Overview \fs24 \ \ \b0 This program demonstrates the use of MiscTableScroll in \i lazy \i0 mode. It is as a simple directory browser which supports basic operations such as \i open, delete, \i0 and \i change directory \i0 .\ \ \ \b\fs28 Notable Features \fs24 \ \ Lazy Mode\ \b0 This program illustrates how to use a \i lazy \i0 mode MiscTableScroll. In \i lazy \i0 mode the data-delegate is responsible for supplying the cells that the MiscTableScroll will display. In this example, the data-delegate also supplies information (such as \i stringValue \i0 , \i intValue \i0 , \i tag \i0 , etc.) during sorting as a speed optimization.\ \ This program allocates a single cell for each column. When the MiscTableScroll requests a cell for some column and row, the data-delegate takes the cell it allocated for that column, fills it with information from that row, and returns it. As a side-effect of this, time-consuming operations like fetching a file's icon can be delayed until it is actually needed. Likewise retrieval of group and owner names from NetInfo (also time-consuming) is delayed until display or sort time.\ \ This contrasts sharply with \i eager \i0 mode, in which all cells are created and filled immediately. \i Lazy \i0 mode is useful for exceptionally large data sets or data sets for which data retrieval is very time-consuming. \i Eager \i0 mode, however, is usually easier to program. \b \ \ Color \b0 \ The example shows how to use color with the MiscTableScroll. Color swatches can be dragged from the \i Color Panel \i0 and dropped onto the browser window. The background of the MiscTableScroll is set to the color of the dropped swatch.\ \ When the \i highlight directories \i0 switch is toggled \i on \i0 the rows for directories are highlighted in a color independent of the MiscTableScroll. \b \ \ Font\ \b0 When the MiscTableScroll is first-responder, the \i Font Panel \i0 can be used to change its font. \b \ \ Users Preferences\ \b0 This program demonstrates how to save and restore the user's column order and width preferences. Additionally, all other user preferences -- \i font, color, \i0 \i switch settings \i0 , and \i window size -- \i0 are also saved and restored.\ \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b\fc1\cf1 Sorting\ \b0 A switch on the browser window controls whether or not rows are automatically sorted as columns are rearranged. This demonstrates the very powerful built-in sorting capability of MiscTableScroll. Sorting can be fine-tuned right in the \i nib \i0 file by adjusting the criteria on a column-by-column basis. For instance, columns may contribute \i stringValue, title, intValue, tag, \i0 etc. to the row-wise comparisons.\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b\fc1\cf1 Icon Display\ \b0 One column in the browser displays the file's icon. This demonstrates how to use \i icon \i0 columns in addition to \i text \i0 columns.\ \ \b Image Dragging\ \b0 MiscTableScroll allows images to be dragged directly out cells. In this example, the file's icon can be dragged directly from the directory browser into any other application which accepts \i dragged filenames \i0 , such as File Viewer, Mail, Edit, etc. A button controls whether or not the scaled or full-size image is used during the dragging operation. This illustrates how the delegate can optionally substitute an image in place of the one already contained in the cell.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc1\cf1 Text Editing\ \b0 MiscTableScroll supports \i in-cell \i0 text editing. This example program uses the editing feature to allow the user to rename files. Double-clicking with the mouse on the file name in the \i Name \i0 column initiates editing.\ \ \b Buttons\ \b0 This example illustrates how to use \i ButtonCells \i0 with the MiscTableScroll. One column contains a \i ButtonCell \i0 configured as a toggle switch. It displays a padlock in either a locked or unlocked state and clicking on it toggles its state. The padlock indicates whether or not the file can be renamed. When \i unlocked, \i0 renaming is allowed, and double-clicking on the file name in the \i Name \i0 column initiates an edit session. When \i locked, \i0 renaming is not allowed. If you do not have permission to rename a file the browser displays a \i locked \i0 icon and disables the \i ButtonCell \i0 .\ \ \b Exporting \b0 \ MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the \i Export \i0 menu item on the \i Directory \i0 menu.\ \ \b Printing \b0 \ MiscTableScroll respects the various page layout options, such as shrink-to-fit, spill, crop, centering, etc.\ \ \b Name Caching \b0 \ NetInfo is notoriously slow. Translation of user and group numbers into their text equivalents is sped up by caching the results of calls to \i getpwuid \i0 and \i getgrgid \i0 (both of which ultimately consult NetInfo).\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc1\cf1 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs28\fc1\cf1 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b0\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 LazyScrollDir was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 ã \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc1\cf1 · Paul S. McCarthy \f2\fs20 \f0\fs24 \ · Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc1\cf1 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc1\cf1 MIME, and ASCII mail accepted. \fs12 \ } MiscKit/Examples/LazyScrollDir/SD_PageLayout.h100444 1750 1750 3320 6757716255 21560 0ustar sunshinesunshine#ifndef __SD_PageLayout_h #define __SD_PageLayout_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // "SD_PageLayout.h" // // Custom subclass of AppKit's PageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.h,v 1.2 99/06/29 08:18:30 sunshine Exp $ // $Log: SD_PageLayout.h,v $ // Revision 1.2 99/06/29 08:18:30 sunshine // v19: Synchronized with LazyScrollDir v19.1 for OpenStep. Cleaned up comments. // //----------------------------------------------------------------------------- #import @class TextField, Matrix; @interface SD_PageLayout : PageLayout { Window* accessoryWindow; TextField* leftMarginField; TextField* topMarginField; TextField* rightMarginField; TextField* bottomMarginField; Matrix* centerMatrix; Matrix* paginationMatrix; } @end #endif // __SD_PageLayout_h MiscKit/Examples/LazyScrollDir/SD_PageLayout.m100444 1750 1750 14210 6757716255 21605 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.m // // Custom subclass of AppKit's PageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.m,v 1.2 99/06/29 08:18:06 sunshine Exp $ // $Log: SD_PageLayout.m,v $ // Revision 1.2 99/06/29 08:18:06 sunshine // v19: Synchronized with LazyScrollDir v19.1 for OpenStep. // Removed unused +launch method. Cleaned up comments. // //----------------------------------------------------------------------------- #import "SD_PageLayout.h" #import #import #import #import #import #import @implementation SD_PageLayout //----------------------------------------------------------------------------- // loadAccessoryView //----------------------------------------------------------------------------- - (void)loadAccessoryView { View* v; char buff[ FILENAME_MAX + 1 ]; [[NXBundle bundleForClass:[self class]] getPath:buff forResource:[[self class] name] ofType:"nib"]; [NXApp loadNibFile:buff owner:self withNames:NO fromZone:[self zone]]; v = [accessoryWindow setContentView:0]; [accessoryWindow close]; [accessoryWindow free]; [self setAccessoryView:v]; [[leftMarginField setTarget:ok] setAction:@selector(performClick:)]; [[rightMarginField setTarget:ok] setAction:@selector(performClick:)]; [[topMarginField setTarget:ok] setAction:@selector(performClick:)]; [[bottomMarginField setTarget:ok] setAction:@selector(performClick:)]; [bottomMarginField setNextText:[scale nextText]]; [scale setNextText:leftMarginField]; } //----------------------------------------------------------------------------- // +new //----------------------------------------------------------------------------- + (id)new { static id p = 0; if (p == 0) { p = [super new]; [p loadAccessoryView]; } return p; } //----------------------------------------------------------------------------- // pickedUnits: //----------------------------------------------------------------------------- - (id)pickedUnits:(id)sender { float old_factor, new_factor, scaler; [self convertOldFactor:&old_factor newFactor:&new_factor]; scaler = new_factor / old_factor; [leftMarginField setFloatValue: [leftMarginField floatValue] * scaler]; [rightMarginField setFloatValue: [rightMarginField floatValue] * scaler]; [topMarginField setFloatValue: [topMarginField floatValue] * scaler]; [bottomMarginField setFloatValue:[bottomMarginField floatValue] * scaler]; return [super pickedUnits:sender]; } //----------------------------------------------------------------------------- // pagination_to_slot //----------------------------------------------------------------------------- static int pagination_to_slot( int pg ) { int slot = 1; if (pg == NX_FITPAGINATION) slot = 0; else if (pg == NX_CLIPPAGINATION) slot = 2; return slot; } //----------------------------------------------------------------------------- // slot_to_pagination //----------------------------------------------------------------------------- static int slot_to_pagination( int slot ) { int pg = NX_AUTOPAGINATION; if (slot == 0) pg = NX_FITPAGINATION; else if (slot == 2) pg = NX_CLIPPAGINATION; return pg; } //----------------------------------------------------------------------------- // readPrintInfo //----------------------------------------------------------------------------- - (id)readPrintInfo { int pg_row, pg_col; float left,right,top,bottom; float old_factor, new_factor; id rc = [super readPrintInfo]; PrintInfo* pinfo = [NXApp printInfo]; [pinfo getMarginLeft:&left right:&right top:&top bottom:&bottom]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [leftMarginField setFloatValue:new_factor*left]; [rightMarginField setFloatValue:new_factor*right]; [topMarginField setFloatValue:new_factor*top]; [bottomMarginField setFloatValue:new_factor*bottom]; [centerMatrix selectCellAt:(int)[pinfo isVertCentered] :(int)[pinfo isHorizCentered]]; pg_row = pagination_to_slot( [pinfo vertPagination] ); pg_col = pagination_to_slot( [pinfo horizPagination] ); [paginationMatrix selectCellAt:pg_row:pg_col]; return rc; } //----------------------------------------------------------------------------- // writePrintInfo //----------------------------------------------------------------------------- - (id)writePrintInfo { id rc = [super writePrintInfo]; PrintInfo* pinfo = [NXApp printInfo]; float old_factor, new_factor; [self convertOldFactor:&old_factor newFactor:&new_factor]; [pinfo setMarginLeft:[leftMarginField floatValue] / old_factor right:[rightMarginField floatValue] / old_factor top:[topMarginField floatValue] / old_factor bottom:[bottomMarginField floatValue] / old_factor]; [pinfo setVertCentered: [centerMatrix selectedRow]]; [pinfo setHorizCentered:[centerMatrix selectedCol]]; [pinfo setHorizPagination: slot_to_pagination([paginationMatrix selectedCol])]; [pinfo setVertPagination: slot_to_pagination([paginationMatrix selectedRow])]; return rc; } @end MiscKit/Examples/LazyScrollDir/TODO.txt100444 1750 1750 1574 6757716255 20266 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir TODO.txt // $Id: TODO.txt,v 1.1 97/02/05 08:20:07 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ----- - Change the behavior: * Double-click on a directory should perform a "change-dir" (*not* launch a new window). * cmd-o / cmd-n should create new windows pre-loaded with the currently selected directories (or something like that). - Fix scroll position after reload. Only "update" should preserve the scroll position. - Should ask the workspace manager for notification of file system changes. DONE: ----- - Implement save/restore settings to/from NXDefaults. - Don't load the image immediately while scanning the directory. - Separate the extra formatting that needs to be done for lazy mode from the stuff done for eager mode. MiscKit/Examples/LazyScrollDir/Align.HCentered.VTop.tiff100444 1750 1750 422 6757716260 23356 0ustar sunshinesunshineMM*D€* J¤¨VOß$øÀ …C!Ñ\6ŸƒCïøÔq?ŽÈR` U€?àP8$ „BaP˜ò ú (R5- ü€' ü€'MiscKit/Examples/LazyScrollDir/Align.HCentered.VCentered.tiff100444 1750 1750 426 6757716260 24351 0ustar sunshinesunshineMM*H€* J¤©TªVO¿ßï(L->CïÈ`ÀŠ'âш¬^†Ã!O$„@U@@€?àP8$ „BaP˜ö þ(R80 ü€' ü€'MiscKit/License.rtf100444 1750 1750 12063 6757716345 14557 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f0\ftech Symbol;\f1\fswiss Helvetica;\f2\fmodern Ohlfs;} \paperw9420 \paperh8980 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f3\b0\i0\ulnone\fs24\fc0\cf0 Copyright \f0 Ó \f3 1993, 1994, 1995, 1996, 1997 Don Yacktman. All Rights Reserved. Version 1.10.0.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fc1\cf1 \ \ \b\qc\fs72 MiscKit License Agreement \b0 \ \ql\fs24 \ \f3\li360 In this license, the \b MiscKit administrator \b0 is Don Yacktman. \fs20\up8 ² \fs24\up0 The \b MiscKit authors \b0 include any individual or organization who has contributed a resource to the MiscKit. \b MiscKit owners \b0 are those who hold any of the copyrights associated with the MiscKit and the resources it contains. \b Resources \b0 are the components of the MiscKit, such as an Objective-C \fs20\up8 TM \fs24\up0 object, an application, an Objective-C \fs20\up8 TM \fs24\up0 category, an Interface Builder \fs20\up8 TM \fs24\up0 palette, a Project Builder \fs20\up8 TM \fs24\up0 project, or a documentation file. In special cases, a resource is a single .tiff, .snd, .nib, .eps, or other file, but usually such files are component parts of another resource.\ \ Although the copyright for a resource remains with the author of the resource (unless the copyright has been reassigned), the MiscKit owners have licensed to the MiscKit administrator the right to copy, distribute, license, and print their works. Some of these rights are passed on to you through this license agreement. Any resource which is a part of the MiscKit falls under the terms of this license agreement unless explicitly stated in the resource itself or its accompanying files. The copyright for the MiscKit, held by the MiscKit administrator, covers the collection or arrangement of objects which comprises the MiscKit and any auxiliary files such as, but not limited to, the MiscKit License Agreement, Charter, and Makefiles. The file ªLicense_Notes.rtfº explains the articles of this license in greater detail.\ \ Permission to copy the MiscKit, to redistribute it, and to use it for any purpose is granted, subject to the following restrictions and understandings:\ \fi440 \ \fi-260\li1060 1. Any copy made of the MiscKit or modified versions of the MiscKit must include verbatim copies of this copyright and license notice and accompanying MiscKit charter.\ \ 2. The MiscKit administrator's permission must be obtained for:\ \pard\tx520\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-240\li1300\fc1\cf1 a. any large-scale distribution of the MiscKit.\ b. redistribution of the MiscKit, or any parts of the MiscKit, in printed form.\ c. distributing a modified version of the MiscKit. Modified versions of the MiscKit must also be plainly marked as such, with a suitable warning, and may not be misrepresented as being the original software.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-260\li1060\fc1\cf1 \ 3. All materials developed as a consequence of the use of the MiscKit shall duly acknowledge such use.\ \ 4. Anyone, the MiscKit administrator, a MiscKit author, or a third party is free to provide consulting and support services for the MiscKit.\ \ 5. The MiscKit administrator may make changes to this license at any time, providing that a simple majority of MiscKit authors and owners agree to the changes. If a change is made, it immediately becomes binding upon all current resources of and subsequently added to the MiscKit. Changes to the license do not, however, retroactively affect previous versions or uses of the MiscKit or its resources.\ \fi440\li360 \ \fi0 The MiscKit administrator, MiscKit authors and owners, and Brigham Young University make no express or implied warranty or representation of any kind with respect to the MiscKit, including any warranty that the MiscKit is defect- free. ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE IS HEREBY DISCLAIMED. IN NO EVENT WILL THE AFOREMENTIONED PARTIES BE LIABLE FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE THE MISCKIT. The parties are under no obligation to provide any services, by way of maintenance, update, or otherwise.\ \ Interface Builder and Project Builder are trademarks of NeXT Computer, Inc. Objective-C is a registered trademark of The Stepstone Corporation.\ \ __________\ \pard\tx1440\tx2720\fs20\fi-440\li800\fc1\cf1\up8 ² \fs24\up0 The MiscKit administrator may be contacted at:\ U.S. mail: Don Yacktman\ 4279 N. Ivy Lane\ Provo, UT 84604\ telephone: (801) 221 - 0344\ e-mail: don@misckit.com\ \pard\li520\fc1\cf1 This contact information will be valid until at \i least \i0 December 31, 1997, after which time inquiries should be mailed to: Donald A. Yacktman, Jr \b . \b0 , 2826 N. Elm Lane, Arlington Heights, IL, 60004, from which point they will be properly forwarded. Releases of the MiscKit after that time will contain any new addresses.\ } MiscKit/License_Notes.rtf100444 1750 1750 35047 6757716345 15736 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f0\ftech Symbol;\f1\fswiss Helvetica;\f2\fmodern Ohlfs;} \paperw9420 \paperh8980 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f3\b0\i0\ulnone\fs24\fc0\cf0 Copyright \f0 Ó \f3 1993, 1994, 1995, 1996, 1997 Don Yacktman. All Rights Reserved. Version 1.10.0.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fc0\cf0 \ \ \qc\fs48 How the MiscKit License Agreement applies to you (explanatory notes)\ \f3\ql\fs24\fi440\li360\fc1\cf1 \ \ \fi0 In order to understand what is required in order to properly comply with this license, this file describes what is expected of you. It follows the same numbering scheme as the articles of the license, adding clarification to particular requirements. This document is as legally binding as the license in that it attempts to provide the proper interpretation of the license requirements. It is not necessary that you read this entire document, but it is probably worth the time. Hopefully this document will answer any questions you may have about the license. This document grants you some permissions required by the MiscKit license so that the MiscKit administrator does not need to be contacted to give permission for several common uses of the MiscKit. Finally, this document provides the reasoning behind many of the current restrictions. \fi440 \ \fi-260\li1060 \ \fi0\li360 Before covering the articles of the license, there are a few consequences of the copyright scheme which should be understood. Basically, the author retains all rights and the copyright for a resource (unless these have been transferred to another owner) and the owner is granting the MiscKit permission to use the resource (the MiscKit administrator is free to use, distribute, copy, license, and print the resource). As consequences of this:\ \fi-260\li1060 \ \pard\tx520\tx1360\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-280\li1340\fc1\cf1 · The author may distribute a resource via any means, and for any cost, outside of the MiscKit. Example: the owner of a resource is free to sell modified versions of said resource to anyone at any price they set. The owner can also give you permission to do so, if they so choose.\ \ · Modifications to a resource which are donated to the MiscKit become the property of the owner of a resource. (This is meant to eliminate administrative hassles.) Note that an Objective-C \fs20\up8 TM \fs24\up0 category is not considered a modification of a resource; it is a resource in it's own right, so if a contributor wishes to retain ownership, this is a possible option.\ \ · Ownership of a resource may be transferred to an individual other than the author or previous owner if a signed agreement between both parties exists. This is because the original author still retains all rights to the resource, and, more importantly, retains the copyright.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi440\li360\fc1\cf1 \ \pard\tx520\tx1360\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-280\li1340\fc1\cf1 · The author cannot remove a resource from the MiscKit. By contributing, an author has granted the rights to redistribute and use the resource. As part of the agreement between MiscKit administrator and contributor, once those rights are granted, it cannot be revoked. However, the author may remove support for the resource. In such a case, the contributed resource will \b remain \b0 in the MiscKit and one of the MiscKit authors will be assigned to carry on any future development and bug fixes. The copyright for the code will still remain with the original author. (In effect the MiscKit will end up being a separate development branch of the resource.) This provision is to allow authors to stop providing MiscKit support for a resource and transfer the responsibility without having to give up the copyright to the object. Because a contributor cannot remove a donated resource, they should make sure that they truly intend it to be a public resource. Basically, removing a donated resource is far too detrimental to the MiscKit. People who use the kit will come to depend upon the resources in it and many MiscKit resources rely upon other MiscKit resources. Removing a resource would most likely break something else in the MiscKit. Also, pulling a resource and then selling it to those who need it would be the height of rudeness. If this provision weren't included, it is feared that the MiscKit would become a bunch of disjoint objects that don't leverage off the capabilities of existing objects in the kit for fear of something suddenly disappearing in the future. In addition, people would be hesitant to use any object that might disappear some day, thus leaving the kit unused by most people It is hoped that this policy will provide a sense of security to everyone.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi440\li360\fc1\cf1 \ \ \fi-260\li1060 1. Software built using the MiscKit does \i not \i0 have this restriction; this restriction applies only to the MiscKit source code and development tools. So, if you redistribute MiscKit \i source \i0 you must supply these documents in the distribution. An app built with the MiscKit, containing MiscKit objects should \i not \i0 include these documents, as they apply to the MiscKit only.\ \ 2. This article deals with distribution of the MiscKit source. An application that uses the MiscKit (ie. includes binary object code created from the MiscKit source code or contains a .nib, .tiff, etc. taken from the MiscKit) is only restricted by article 3. In other words, the MiscKit license does not ªinfectº any project which makes use of the MiscKit.\ \ Any redistribution of the MiscKit without the MiscKit administrator's explicit permission must contain all files which are in the original distribution as it originates from the MiscKit administrator. Currently, the definitive ªoriginalº distribution is available via anonymous ftp from ftp.byu.edu. Any modified distributions fall under part (2.c.), should have all changes clearly marked, and require the MiscKit administrator's permission. For commercial distributions, it is suggested that, where possible, you provide the MiscKit in an uncompressed form so that the user can peruse the documentation easily. (For example, on a CD-ROM, it would be most convenient for the user to have the compressed \i and \i0 the uncompressed MiscKit on the disc. Then, the documentation is easily accessible, without taking up hard drive space, but when a user decides to install the kit, it is much faster to read the compressed version off of the CD-ROM. Obviously such a move increases the value of your product, and would be desirable in most cases.) Also, as this is a free kit, it is hoped that commercial re±distributors will not attempt to gouge their customers. (This is unlikely to have happen since this document must be included unchanged in all distributions, and anyone who was bamboozled and then read this would get pretty darn mad, and would likely take the matter into their own hands.)\ \ 2.a. A large-scale distribution is one which is mass-produced; in other words, any time more than 50 copies would be distributed. (In other words, the typical user group could give copies of the Misckit to members, but if they went to press a CD-ROM, then they need to get permission first.) Requiring you to ask permission is mostly to make sure that you have the option of distributing the latest version of the MiscKit and to allow us to be aware which versions of the kit came from a particular source, which makes the job of support much easier when bug reports come in from users. Upon contact, you will be provided with any newer versions of the kit and will be given the option to be added to a list of people who are notified of new releases of the MiscKit. Your product will also, if you wish, be added to a public listing which points to products which contain the MiscKit distribution. (For example, if you produce a CD-ROM and someone wanted a permanent copy of the MiscKit on CD-ROM, they would then be directed to your product.) In practically all circumstances, requested permission will be granted, but you are still required to obtain it from the MiscKit administrator first. An individual making copies for a friend is \i not \i0 required to contact the MiscKit administrator; restriction 2.a. applies only to commercial products.\ \ The MiscKit administrator hereby grants you permission to redistribute the complete, unmodified MiscKit via ftp, e-mail, or any other means of transmission over an electronic network.\ \ 2.b. Again, in practically all circumstances, permission will be granted, but you are still required to obtain it from the MiscKit administrator first. Because the owner of a resource's copyright has licensed the MiscKit administrator the rights to license and print the resource, the MiscKit administrator can transfer the license to print to you upon request. The right to print is not given you in the current license; you must request it. Note that the author of a resource can also give you permission to print it, so that is an alternate route which you may use to obtain permission.\ \ 2.c. Distributing modified versions of the MiscKit is highly discouraged, but some will want to do so anyway. The license automatically grants permission to redistribute the MiscKit \i without \i0 requesting the permission of the MiscKit administrator, but only for unmodified distributions, and under the circumstances delineated in other areas of the license, parts 2.a. and 2.b. in particular. If you have altered the MiscKit or added to it, then part 2.c. applies to the re-distribution. When you attempt to request permission under the terms of part 2.c. you will be expected to give a \i very \i0 good reason for wanting to do this; contribution to the kit should be the norm. It would be preferred that any modifications to the MiscKit be forwarded to the maintainers of the MiscKit so that such modifications become part of the official MiscKit, but this is not required by this license. The warning you will be required to give should clearly state that modified versions are wholly unsupported by the MiscKit authors and may not be compatible with past, current, or future versions of the MiscKit. The license and charter which must be included with modified versions of the MiscKit (see article 1.) are both found in the official MiscKit distribution, and may not be modified.\ \ Due to the rights granted by the MiscKit authors to the MiscKit administrator, the MiscKit administrator hereby grants you permission to redistribute partial versions of the MiscKit comprised of \i unchanged \i0 MiscKit resources, subject to the restrictions of parts 2.a. and 2.b. but you must mark the distribution as being incomplete. If the resources are modified, you must obtain permission to redistribute from the MiscKit administrator or the original author of a resource. If you wish to distribute a single resource, the owner of the resource should be contacted. Some resources may explicitly give permission for any type of redistribution, if the author has included such permission at the top of the file and/or accompanying README file. When an author grants this permission in the resource as it is distributed in the MiscKit, this allows you to redistribute that resource under the terms given, but only that resource and not in conjunction with the MiscKit. If you decide to distribute a partial version of the unmodified MiscKit, be careful that you include all necessary resources; many MiscKit resources depend on each other. For this reason, partial distributions are not generally recommended; they could cause unnecessary hassle.\ \fi440\li360 \ \fi-260\li1060 3. This acknowledgement should, in the case of a GUI application, be both in the application itself, either in the info panel or at some location in the on-line help, and in the printed manual, if such exists. Placing the phrase ªThe MiscKit was used in development of this softwareº in a help panel and the printed manual or the phrase ªUses the MiscKitº in the Info panel would be sufficient. In the case of a command-line application, acknowledgement should be placed in the README file distributed with the application. This restriction applies only to applications which use objects from the MiscKit library and palettes; no acknowledgement is required for applications which \i only \i0 make use of any specialized development tools (applications) provided with the MiscKit. Why promote the MiscKit in this way? So that it gets used by people! Why develop it if no one ever uses it? Often a developer will not buy objectware because ªI can do that myself¼º which defeats the whole purpose of OOPÐcode reuseÐand so we want our code to be used. As a free project, this is the only kind of ªadvertisingº we can afford to achieve this goal!\ \fi440\li360 \ \fi-260\li1060 4. Such activities are welcome as long as they do not violate this license agreement.\ \fi440\li360 \ \fi-260\li1060 5. If you are an author and/or owner, and you object to a proposed change, speak up or be forgotten! See the Charter for details on the voting process. Also, note that the kit must always remain free to users; changes which limit the freedom of users and distributors more than the current license are not allowed. Note that since a vote of all authors is required to make changes, this should keep itself in check quite easily.\ \fi440\li360 \ \ \ \ \f1\qc\fs48\fi0\li0\fc0\cf0 Goals of the MiscKit license agreement:\ \f3\ql\fs24\fi440\li360\fc1\cf1 \ \ \fi0 The purpose and intent of the MiscKit license is to fulfill the following goals:\ \ \fi-260\li1060 · Allow the MiscKit to be freely distributed to as large an audience as possible.\ \ · Provide a kit of useful programming tools which may be used by anybody without having to pay for its use.\ \ · Allow programmers to contribute to a project which will aid themselves and their peers.\ \ · Assure that there will always be a ªdefinitiveº version of the MiscKit, distributed by the MiscKit administrator, which may be trusted. By allowing contributors, it is hoped that branches will not break off of the MiscKit, which will make the kit more useful as a whole because there will be less confusion as to which version should be used.\ \ \fi0\li360 Basically, we're trying to make something which is almost a public domain kit, but do it in a manner that is organized and lacks the confusion of multiple incompatible versions often seen with public domain code. \fi-260\li1060 \ }