Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fancymax committed Sep 17, 2016
1 parent 3be092d commit ea241dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TicketQueryViewController: NSViewController {
// MARK: - firstSearchView
@IBOutlet weak var fromStationNameTxt: AutoCompleteTextField!
@IBOutlet weak var toStationNameTxt: AutoCompleteTextField!
@IBOutlet weak var queryDate: NSDatePicker!
@IBOutlet weak var queryDate: ClickableDatePicker!
@IBOutlet weak var queryBtn: NSButton!
@IBOutlet weak var converCityBtn: NSButton!

Expand Down Expand Up @@ -152,14 +152,14 @@ class TicketQueryViewController: NSViewController {
self.fromStationNameTxt.enabled = false
self.toStationNameTxt.enabled = false
self.converCityBtn.enabled = false
self.queryDate.enabled = false
self.queryDate.clickable = false
filterCbx.enabled = false
}
else {
queryBtn.title = "开始抢票"
self.fromStationNameTxt.enabled = true
self.toStationNameTxt.enabled = true
self.queryDate.enabled = true
self.queryDate.clickable = true
self.converCityBtn.enabled = true
filterCbx.enabled = true
if self.filterQueryResult.count > 0 {
Expand Down Expand Up @@ -326,6 +326,8 @@ class TicketQueryViewController: NSViewController {
trainFilterWindowController.fromStationName = self.fromStationNameTxt.stringValue
trainFilterWindowController.toStationName = self.toStationNameTxt.stringValue
trainFilterWindowController.trainDate = self.date!


if let window = self.view.window {
window.beginSheet(trainFilterWindowController.window!, completionHandler: {response in
if response == NSModalResponseOK{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="O67-gD-stZ" customClass="TrainInfoTableCellView" customModule="_2306ForMac" customModuleProvider="target">
<tableCellView misplaced="YES" id="O67-gD-stZ" customClass="TrainInfoTableCellView" customModule="_2306ForMac" customModuleProvider="target">
<rect key="frame" x="453" y="1" width="997" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
Expand Down
2 changes: 1 addition & 1 deletion 12306ForMac/UserControls/AutoCompleteTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class AutoCompleteTextField:NSTextField{
case 36: // Return
if isShow{
self.insert(self)
return //skip default behavior
}
return

case 48: //Tab
if isShow{
Expand Down
4 changes: 3 additions & 1 deletion 12306ForMac/UserControls/ClickableDatePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import Cocoa

class ClickableDatePicker: NSDatePicker {

@IBInspectable var clickable:Bool = true

override func mouseDown(theEvent: NSEvent) {
if self.enabled {
if self.clickable {
sendAction(self.action, to: self.target)
}
}
Expand Down

0 comments on commit ea241dd

Please sign in to comment.