3
A
回答
7
基於約書亞Nozzi和馬克Alldritt的答案,完整的解決方案:
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
NSButton *button = [[NSButton alloc] init];
[button setButtonType:NSSwitchButton];
button.title = NSLocalizedString(@"I am a checkbox", @"");
[button sizeToFit];
[openDlg setAccessoryView:button];
openDlg.delegate = self;
[openDlg beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
{
openDlg.delegate = nil; // TODO: Check if this is necessary
if (result != NSFileHandlingPanelOKButton) return;
BOOL checkboxOn = (((NSButton*)openDlg.accessoryView).state == NSOnState);
// Do something
}];
的NSOpenSavePanelDelegate:
- (void)panelSelectionDidChange:(id)sender {
NSOpenPanel *panel = sender;
NSButton *button = (NSButton*)panel.accessoryView;
// Update button based on panel selection
}
3
NSOpenPanel是NSSavePanel的子類,它有-setAccessoryView:
。
3
要根據所選文件驗證您的複選框,您需要執行NSOpenSavePanelDelegate
委託協議中的panelSelectionDidChange:
。然後,您可以查詢打開的面板當前選定的文件並根據需要更新您的複選框狀態。
+0
+1幫助。 – hpique
相關問題
- 1. 添加複選框到Gridview
- 2. 添加複選框到ComboboxItem
- 3. 添加複選框到gridview
- 4. 動態添加複選框到組框
- 5. 添加複選框到WPF消息框
- 6. 將值添加到複選框字段
- 7. 複選框組添加到數據庫
- 8. 添加一個複選框到cxGridDBColumn(DateEdit)
- 9. 將圖像添加到winforms複選框
- 10. 將標籤添加到複選框cakephp
- 11. 將複選框添加到asp.net RadTreeView ChildNodes?
- 12. 將內容添加到複選框
- 13. 將onCheckChanged添加到動態複選框
- 14. 如何將複選框添加到UITableViewCell?
- 15. 如何添加複選框列到gridview
- 16. 將複選框添加到UniformGrid
- 17. 添加複選框到CheckBoxField字段列
- 18. 將Gif動畫添加到複選框
- 19. 無法添加複選框到ToolStrip
- 20. Extjs將複選框添加到container.viewport
- 21. 將複選框列添加到DataGridView中
- 22. Sencha Touch2:將複選框添加到itemTpl
- 23. 將複選框值添加到salesforce
- 24. 將複選框列添加到DataGrid
- 25. 添加複選框到Magento結帳?
- 26. 添加複選框和ID到表? localstorage
- 27. 添加複選框到edittext/textview?
- 28. 將複選框列添加到GridControlEx中
- 29. 一個複選框列添加到GridView
- 30. 的Zend添加複選框多選框
+1指着我在正確的方向。我將在稍後發佈完整解決方案的答案。 – hpique