I totally agree, that the internals shouldnt be visible from the outside. 
But by making the inner SignatureDialogBody class protected and adding a 
protected factory method into the SignatureComponent which just returns a 
new SignatureDialogBody you are able to customize the component and it isnt 
visible to the outside.

For translations, sure some statics would help alot and would be accessable 
without going into the component itself. Unfortunatly we cant use the build 
in localization mechanism from CN1 cause our localizations have a specific 
pattern and are provided from our server application ad hoc.

Sure you can remove the signature programmaticly but the user isnt able to 
remove it without adding a extra button which calls setSignatureImage(img).
If you open up the SignatureDialogBody, reset it and click ok, you get a 
dialog box which says that you have to write down a signature. So out of 
the box, the user is unable to remove a signature.

On Monday, February 27, 2017 at 7:07:37 PM UTC+1, Steve Hannah wrote:
>
>
>
> On Mon, Feb 27, 2017 at 5:10 AM, xhatti via CodenameOne Discussions <
> [email protected] <javascript:>> wrote:
>
>> Hey everyone!
>>
>> I just added a SignatureComponent into out app and realized, that it is 
>> another component i have to copy paste cause its way to inflexible.
>>
>
> This was intentional so that the internal workings of the component did 
> not bleed out.  When the component was created it was just a black box that 
> allowed users to add a signature.  The "how" was considered internal 
> workings.  I didn't want to open the flood gates to modifying the "how" too 
> much in case it needed to be changed later.  Better to add support for 
> specific use cases in a consistent manner as they came up.
>  
>
>> As example: The inner SignatureDialogBody class cant be accessed. All 
>> labels and other texts are hardcoded in english without any way to modify 
>> or translate them.
>>
>
> Please file an RFE.  By default all of the labels and buttons are set to 
> be localized anyways so you can translate these by simply adding the 
> appropriate translations to your resource file with the English version as 
> the key.  I can see how it would be good to add static keys for these 
> translations though in case the english text is changed.
>  
>
>> The dialog itself have methods for the done, reset and cancel button but 
>> cant be accessed. Instead of beeing able to override those methods or add a 
>> specific actionlistener for those actions, 
>>
> Please file an RFE.  I'm not sure I want to expose these buttons 
> directly.  There is already an action event fired when the user presses 
> done.  Possibly other action listeners if it seems helpful.
>  
>
>> the SignatureComponent only have one eventdispatcher if something has 
>> changed which is pretty useless cause you cant remove the signature or 
>> leave it empty.
>>
> I'm not sure I understand why you can't remove the signature or leave it 
> empty?  You can call setSignatureImage(img) with some default image to 
> clear it out.
>
>
> Best regards
>
> Steve
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/33462bae-ed91-488f-8d35-8b882a19efe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to