What I want is to create a morph that has the ability to input text from the user that formats it automatically and allows for a limited amount of characters. This input field will be in the format of HH:MM:SS , (H)our (M)inute (S)econd. The : seperators will be entered automagically by the input field and of course the input field should accept numbers and preferably sensible ones , so seconds and minutes will have a maximum of 60, hours 24. Is this possible with the existing Morphs or is this something I must implement myself ? |
Le 10/11/15 18:16, Dimitris Chloupis a écrit : > What I want is to create a morph that has the ability to input text > from the user that formats it automatically and allows for a limited > amount of characters. This input field will be in the format of > HH:MM:SS , (H)our (M)inute (S)econd. The : seperators will be entered > automagically by the input field and of course the input field should > accept numbers and preferably sensible ones , so seconds and minutes > will have a maximum of 60, hours 24. > > Is this possible with the existing Morphs or is this something I must > implement myself ? > > I have been looking to the textmorph and all its subclasses but I have > not made a lot of sense out of it, it looks very messy code. and it got cleaned :) Stef |
In reply to this post by kilon.alios
On 10-11-15 18:16, Dimitris Chloupis wrote:
> What I want is to create a morph that has the ability to input text from > the user that formats it automatically and allows for a limited amount of > characters. You might want to take a look at RubFloatingEditorBuilder. In #buildEditor you see how to react to announcements send by the RubScrolledTextMorph. If you do The Right Thing in whenKeystroke: (like #setTextWith: and fixing the selection and cursor position) you'll be able to do what you want. Stephan |
I have taken a look at rubric elemenst, they look even more messier than morphic. I can do something similar with textMorph without messing with announcers. It looks to me a bit too much to send an announcement on a key event. Anyway I will give a try at textMorph and will go from there, probably subclass it and create my own morph for time input. "and it got cleaned :) Stef" On Tue, Nov 10, 2015 at 7:59 PM Stephan Eggermont <[hidden email]> wrote: On 10-11-15 18:16, Dimitris Chloupis wrote: |
Hi,
sins you dislike Spec I cannot resist to taunt you with these 3 lines of Spec code that do what you want :-P field := TextInputFieldModel new autoAccept:true; acceptBlock: [:text | field text: text asUppercase]. field openWithSpec Note that the transform here is a simple asUppercase, replace that with whatever logic suits you. Spec does have its advantages :-)
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile |
In reply to this post by kilon.alios
On 10-11-15 20:03, Dimitris Chloupis wrote:
> Well my experience with other language has taught me GUI APIs are generally > a nightmare to work with, the only exception to this rule was DELPHI, those > guys were just awesome at GUI design. VCL was simple yet incredible > flexible, I would even dare say the smalltalky thing I have used. It takes > a ton of effort and expertise to get it that good. Delphi has no text editor in the VCL. TEdit is just a wrapper. And that means that you cannot change the storage structure or do line breaking. And while VCL was great in 1995, there was essentially no development of it after 2000. The Cocoa/Next GUI APIs are much better than Delphi's, but they needed much more hardware to run smoothly. Stephan |
In reply to this post by jfabry
My problem is not whether Morphic can do this , it can and its not even any more complex than your Spec code, all I have to do is override the keyStroke: message, my question was on the formating of the input data, I assumed since I see several diffirent inputs fiels in pharo that do some kind of filtering that there was a some kind of formating message or class but now I see its all custom made. I dont use Spec because I am making custom looking gui and I need fine control over it, every little detail counts. And yes I really dont like its design because most of it , does not even remotely look like those 3 lines of code that you just posted. As I said in the past , I have made a single GUI with Spec, my Nireas GUI was built with it and I did not like the experience at all. "Delphi has no text editor in the VCL. TEdit is just a wrapper. And that means that you cannot change the storage structure or do line breaking. And while VCL was great in 1995, there was essentially no development of it after 2000. The Cocoa/Next GUI APIs are much better than Delphi's, but they needed much more hardware to run smoothly." On Tue, Nov 10, 2015 at 9:16 PM Johan Fabry <[hidden email]> wrote:
|
Just for the record when I say I dont like something is a mere stating of an opinion and in no way a chance to offend or downgrade the hard work that went to those libraries. Afterall most of the time I dont even like my own code. There is no right or wrong here, just personal taste. And I have recommended Spec to several people because its still the simpler way to build GUIs on the go. And I am grateful for the Morphic cleanup and Rubrics extra functionality. For the record my days with Delphi are long gone and I would not leave Pharo to go back to Delphi in a million years. I love Pharo because the things I like are far more than the things I dislike. Keep up the awesome work. You made Pharo my new home and I am here to stay :) On Tue, Nov 10, 2015 at 10:18 PM Dimitris Chloupis <[hidden email]> wrote:
|
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile |
yes the dynamic building of spec guis is definetly better than morphic On Tue, Nov 10, 2015 at 11:11 PM Johan Fabry <[hidden email]> wrote:
|
In reply to this post by kilon.alios
On 10-11-15 21:18, Dimitris Chloupis wrote:
> Delphi continued with the new company but since > the new company has nowhere near the resources of Borland the decided to > embrace .NET while keeping VCL around purely for compatibility reasons. Now > Delphi works on .NET which follow a very similar design to Delphi anyway > and for the first time Delphi can run on all 3 OSes through Mono which the > company does actively support. Prism/Oxygene/Elements/Silver are from a different company (RemObjects) that originally delivered a remoting/database solution to Delphi. The original Delphi is now with Embarcadero, who used FreePascal for a while to build a cross-platform solution. Stephan |
In reply to this post by kilon.alios
The same type of fluid interface is available in Glamour.
That is why this quick prototyping has to make it in the base layer, not just in the libraries that are built on top (like Glamour or Spec). Doru > On Nov 10, 2015, at 10:16 PM, Dimitris Chloupis <[hidden email]> wrote: > > yes the dynamic building of spec guis is definetly better than morphic > > On Tue, Nov 10, 2015 at 11:11 PM Johan Fabry <[hidden email]> wrote: > > No worries, no offense taken (at least on my part). I could just not resist posting a 3-liner that showed you that some things do work nicely in Spec :-) > >> On Nov 10, 2015, at 17:50, Dimitris Chloupis <[hidden email]> wrote: >> >> Just for the record when I say I dont like something is a mere stating of an opinion and in no way a chance to offend or downgrade the hard work that went to those libraries. Afterall most of the time I dont even like my own code. There is no right or wrong here, just personal taste. >> >> And I have recommended Spec to several people because its still the simpler way to build GUIs on the go. And I am grateful for the Morphic cleanup and Rubrics extra functionality. For the record my days with Delphi are long gone and I would not leave Pharo to go back to Delphi in a million years. I love Pharo because the things I like are far more than the things I dislike. Keep up the awesome work. You made Pharo my new home and I am here to stay :) >> > > ---> Save our in-boxes! http://emailcharter.org <--- > > Johan Fabry - http://pleiad.cl/~jfabry > PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile -- www.tudorgirba.com "Every thing should have the right to be different." |
how come Spec does not unite with Glamour and vice versa if the goals are similar ? On Wed, Nov 11, 2015 at 12:22 PM Tudor Girba <[hidden email]> wrote: The same type of fluid interface is available in Glamour. |
Hi,
The only similarity is the need to have a more scriptable API for widgets. Other than that, the two engines have different goals and structure: Glamour is for browsers, Spec is for declarative user interfaces. Cheers, Doru > On Nov 11, 2015, at 11:58 AM, Dimitris Chloupis <[hidden email]> wrote: > > how come Spec does not unite with Glamour and vice versa if the goals are similar ? > > On Wed, Nov 11, 2015 at 12:22 PM Tudor Girba <[hidden email]> wrote: > The same type of fluid interface is available in Glamour. > > That is why this quick prototyping has to make it in the base layer, not just in the libraries that are built on top (like Glamour or Spec). > > Doru > > > > On Nov 10, 2015, at 10:16 PM, Dimitris Chloupis <[hidden email]> wrote: > > > > yes the dynamic building of spec guis is definetly better than morphic > > > > On Tue, Nov 10, 2015 at 11:11 PM Johan Fabry <[hidden email]> wrote: > > > > No worries, no offense taken (at least on my part). I could just not resist posting a 3-liner that showed you that some things do work nicely in Spec :-) > > > >> On Nov 10, 2015, at 17:50, Dimitris Chloupis <[hidden email]> wrote: > >> > >> Just for the record when I say I dont like something is a mere stating of an opinion and in no way a chance to offend or downgrade the hard work that went to those libraries. Afterall most of the time I dont even like my own code. There is no right or wrong here, just personal taste. > >> > >> And I have recommended Spec to several people because its still the simpler way to build GUIs on the go. And I am grateful for the Morphic cleanup and Rubrics extra functionality. For the record my days with Delphi are long gone and I would not leave Pharo to go back to Delphi in a million years. I love Pharo because the things I like are far more than the things I dislike. Keep up the awesome work. You made Pharo my new home and I am here to stay :) > >> > > > > ---> Save our in-boxes! http://emailcharter.org <--- > > > > Johan Fabry - http://pleiad.cl/~jfabry > > PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile > > -- > www.tudorgirba.com > > "Every thing should have the right to be different." > > > > -- www.tudorgirba.com "Quality cannot be an afterthought." |
Free forum by Nabble | Edit this page |