Jump to content

unimemo charcase


jahlxx

Recommended Posts

Hi,

 

For now try this:

 

1.

uses ... uniGUIJSInterface;

2.

For example:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  (UniMemo1 as IUniJSInterface).JSCall('setFieldStyle', ['textTransform:uppercase']);
  //(UniMemo1 as IUniJSInterface).JSCall('setFieldStyle', ['textTransform:lowercase']);
  //(UniMemo1 as IUniJSInterface).JSCall('setFieldStyle', ['textTransform:none']);
end;

Best regards.

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

You can use this config for this:

function beforeInit(sender, config)
{
    config.fieldStyle='text-transform:uppercase;'+config.fieldStyle;
}

In runtime (when an app is ready):

lUniMemo.JSInterface.JSCall('inputEl.setStyle', ['textTransform', 'textTransform:uppercase']); //lowercase or none
Link to comment
Share on other sites

Hello ! (:

 

First of all, thank you for the quick answer !

I just tested your solution and it does work perfectly at one little detail:

When you close the memo Editor, the charCase is not respected :

  • LowerCase while Edditing TUniMemo: OK

                        post-4875-0-54412700-1528126730_thumb.png.

  • LowerCase when not edditing TUniMemo: NOK

                         post-4875-0-13317100-1528126826_thumb.png

 

NB: Same behavior with lowerCase and UpperCase!

 

 

 

Link to comment
Share on other sites

When you close the memo Editor, the charCase is not respected :

  • LowerCase while Edditing TUniMemo: OK

                        attachicon.gifRespectedLowerCaseWhileEdditing.png.

  • LowerCase when not edditing TUniMemo: NOK

                         attachicon.gifNotRespectedLowerCase.png

 

NB: Same behavior with lowerCase and UpperCase!

 

Sorry, can you explain in more details?!

Link to comment
Share on other sites

Sorry, can you explain in more details?!

For sure!

 

I am working in a DBGrid containing a field with fieldType = uftMemo.

I would like that the contents on this memo is always set to LowerCase or UpperCase..

The solution you gave me is working only when I am editing the memo. When you get to the next cell in order to edit it, the memo (which is not focus anymore) does not respect the charCase configuration:

  • Memo focused:

                        post-4875-0-91611500-1528182524_thumb.png

  • Memo unFocused:

                        post-4875-0-17706200-1528182573_thumb.png

Link to comment
Share on other sites

  • 3 years later...
On 6/4/2018 at 12:17 PM, Sherzod said:

Hello,

 

You can use this config for this:


function beforeInit(sender, config)
{
    config.fieldStyle='text-transform:uppercase;'+config.fieldStyle;
}

In runtime (when an app is ready):


lUniMemo.JSInterface.JSCall('inputEl.setStyle', ['textTransform', 'textTransform:uppercase']); //lowercase or none

@Sherzod this do not work in runtime( OnReady )... 

lUniMemo.JSInterface.JSCall('inputEl.setStyle', ['textTransform', 'textTransform:uppercase']); //lowercase or none
Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...