Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shai-almog committed Sep 21, 2017
2 parents 2f44b5c + cd59d29 commit 36d50c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions CodenameOne/src/com/codename1/ui/Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,37 @@ public Calendar() {
* @param tmz a reference timezone
*/
public Calendar(long time, TimeZone tmz) {
this(time, java.util.TimeZone.getDefault(), null, null);
}

/**
* Constructs a calendar with the current date and time with left and right images set
*
* @param leftArrowImage an image for calendar left arrow
* @param rightArrowImage an image for calendar right arrow
*/
public Calendar(Image leftArrowImage, Image rightArrowImage) {
this(System.currentTimeMillis(), java.util.TimeZone.getDefault(), leftArrowImage, rightArrowImage);
}

/**
* Creates a new instance of Calendar set to the given date based on time
* since epoch (the java.util.Date convention)
*
* @param time time since epoch
* @param tmz a reference timezone
* @param leftArrowImage an image for calendar left arrow
* @param rightArrowImage an image for calendar right arrow
*/
public Calendar(long time, TimeZone tmz, Image leftArrowImage, Image rightArrowImage) {
super(new BorderLayout());
this.tmz = tmz;
setUIID("Calendar");
mv = new MonthView(time);

Image leftArrow = UIManager.getInstance().getThemeImageConstant("calendarLeftImage");
if (leftArrow != null) {
Image rightArrow = UIManager.getInstance().getThemeImageConstant("calendarRightImage");
Image leftArrow = leftArrowImage != null ? leftArrowImage : UIManager.getInstance().getThemeImageConstant("calendarLeftImage");
Image rightArrow = rightArrowImage != null ? rightArrowImage : UIManager.getInstance().getThemeImageConstant("calendarRightImage");
if (leftArrow != null && rightArrow != null) {
final Button left = new Button(leftArrow, "CalendarLeft");
final Button right = new Button(rightArrow, "CalendarRight");
ActionListener progress = new ActionListener() {
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/TextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public TextArea(String text, int rows, int columns, int constraint){
public TextArea(String text, int maxSize){
this(text,maxSize, 1, 3, ANY);
}

/**
* Creates an area with the given text, this constructor
* will create a single line text area similar to a text field!
Expand Down

0 comments on commit 36d50c9

Please sign in to comment.