Skip to content

Commit 5eae857

Browse files
authored
Merge pull request #74 from Sciss/2.0.x
fixes #73
2 parents 7a0176f + 9040cd1 commit 5eae857

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

build.sbt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ scalaModuleSettings
44

55
name := "scala-swing"
66

7-
version := "2.0.2-SNAPSHOT"
7+
version := "2.0.3-SNAPSHOT"
88

99
scalacOptions ++= Seq("-deprecation", "-feature")
1010

@@ -20,7 +20,13 @@ mimaPreviousVersion := Some("2.0.0")
2020
// set the prompt (for this build) to include the project id.
2121
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }
2222

23-
lazy val swing = project.in( file(".") )
23+
lazy val swing = project.in(file("."))
24+
.settings(
25+
libraryDependencies += {
26+
val v = if (scalaVersion.value == "2.13.0-M3") "3.0.5-M1" else "3.0.5"
27+
"org.scalatest" %% "scalatest" % v % "test"
28+
}
29+
)
2430

2531
lazy val examples = project.in( file("examples") )
2632
.dependsOn(swing)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.17
1+
sbt.version=0.13.17

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.13")
1+
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")

src/main/scala/scala/swing/RichWindow.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ object Dialog {
121121
object Result extends Enumeration {
122122
import JOptionPane._
123123
val Yes : Result.Value = Value(YES_OPTION)
124-
val Ok : Result.Value = Value(OK_OPTION)
124+
val Ok : Result.Value = Yes // N.B. Do not use `Value` because id 0 is already used
125125
val No : Result.Value = Value(NO_OPTION)
126126
val Cancel: Result.Value = Value(CANCEL_OPTION)
127127
val Closed: Result.Value = Value(CLOSED_OPTION)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package scala.swing
2+
3+
import org.scalatest.{FlatSpec, Matchers}
4+
5+
class Issue73 extends FlatSpec with Matchers {
6+
"Enumerations" should "not contain duplicate ids" in {
7+
// the initializers of any of these will through an
8+
// assertion error if an enumeration `Value` id is used twice.
9+
Alignment
10+
BorderPanel.Position
11+
Dialog.Message
12+
Dialog.Options
13+
Dialog.Result
14+
FileChooser.Result
15+
FileChooser.SelectionMode
16+
FlowPanel.Alignment
17+
FormattedTextField.FocusLostBehavior
18+
GridBagPanel.Anchor
19+
GridBagPanel.Fill
20+
ListView.IntervalMode
21+
Orientation
22+
ScrollPane.BarPolicy
23+
TabbedPane.Layout
24+
Table.AutoResizeMode
25+
Table.ElementMode
26+
Table.IntervalMode
27+
event.Key
28+
event.Key.Location
29+
}
30+
}

0 commit comments

Comments
 (0)