Menu

calendar class

Help
2011-11-04
2013-03-18
  • nenad cikic

    nenad cikic - 2011-11-04

    I have added a calendar control and i got in java the CalendarClass. When i pressed the button my application failed on Screen.init -> ButtonControl.setDelay (exception not implemented).
    I have commented the exception in ButtonControl and now it does not fail, but neither it works. It seems as it is not fully implemented. May I ask how you call some sort of calendar popup in yours application (you surely have a calendar somewhere)?
    Thanks
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-11-04

    I have calendars in my app. None of the buttons have delay attribute enabled. JButton swing controls do not have a notion of delay, but I think I can build something easily enough to simulate the behaviour.

    But I would expect that are you commented out the exception, it would work. I assume you put in a 'return this;' after commenting out the exception? All DELAY does is if a button is pressed down, after a delay the ACCEPTED event keeps firing on regular intervals. Just like holding down a key on the keyboard. But still, the calendar should work if you repeatedly click the buttons. Something else must be broken as well.

     
  • nenad cikic

    nenad cikic - 2011-11-05

    Yes, I put "return this". I will investigate more. It is not a showstopper for now.
    You are very responsive; thank you very much. I will let you relax now for a week or more, i hope. I am investigating now on a particular need i have, and for doing that i will probably have to change slightly the c2j sysruntime. When I will succeed I would like to discuss with you about.
    Thanks
    Nenad

     
  • nenad cikic

    nenad cikic - 2011-11-11

    I have managed to make the calendar not blocking.
    If it might help; when it was blocking the calendar did not have system menu (title bar).

    I have created MojScreen,MojCalendarbaseclass and MojCalendarclass (copies of the original) and I come that to make it work i have to do:
    1. Add protected ClarionWindow lwnd; to MojCalendarbaseclass
    2. In MojCalendarclass.ask after the screen.open i have added
    this.lwnd=screen;
    3.In MojCalendarbaseclass i have replaced Clarion.getWindowTarget() with lwnd
    4.In MojCalendarbaseclass before lwnd.accept() i have put another one
    lwnd.open()

    After that the calendar window had the system menu and was reacting.

    However i have one more problem that persist, and that i can not solve for now. If you may help. The days are not displaying as numbers but instead are all "…". This behaviour was before the workaround of before and stayed. I have tried everything i can imagine, and i am close to end on ideas. I have come to the point where i am sure the Clarion.getControl(butnum).setProperty(Prop.TEXT does not work well because if i manually send for example a constant string "1" i still get  "…" and if i comment the line then i got empty strings.

    Thanks
    Cikic Nenad

     
  • nenad cikic

    nenad cikic - 2011-11-11

    I have managed to see the numbers. After i have added the screen.setfont before screen.open i have understood that the issue is due to swing. If i set the size ofthe font high enough the numbers show; but the overall look is poor.

    After a fast binging i have found http://objectmix.com/java/116338-jbutton-setmargin-broken.html

    I have then changed the c2j buttoncontrol following this but without outerborder i.e.
    Border innerBorder = BorderFactory.createEmptyBorder( 2, 5, 2, 5 );
    button.setBorder(BorderFactory.createCompoundBorder( null,innerBorder ));

    and the setMargin is commented.

    Is this something that could be committed in the runtime or should i define my buttoncontrol class just for the purpose of calendar?

    Thanks
    Cikic Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-11-12

    I'll need access to working code in order to properly debug why it is not working. I suspect threading + windowing problem from description above.  i.e. trying to display calendar which does not have MDI set, where parent window is a MDI child, or something of that nature.

    Re margins and displaying '…'. Yep - aware of this problem. In early days I corresponded with the authors of Nimbus to discover workarounds. I tried a few workarounds, they all had issues; ii.e. memory leaking or same such.  At one point I tried shipping a hacked version of nimbus, but this in itself is problematic and high risk, so in the end I decided to live with it, and I redesigned key screens to live with the limitation.

     
  • Andrew Barnham

    Andrew Barnham - 2011-11-12

    Further : calendar I use is calendar in Locus template. I works fine in c2j.  If you like, package up some working code using calendar you are using that demonstrates the bug.  I'll take a look.

    Andrew

     

Log in to post a comment.

Auth0 Logo