Topic: Memo Field

I'm wondering if there is a way to show all of the text in a Memo field when you TAB into it?
-
Sort of like when you Tab into a Combobox field and Dropdown has been set to True.
-
I have a number of Memo fields that are part of my forms and I can't make them too big or they will take up too much space on the form.
-
Thanks, Frank

2 (edited by derek 2020-12-08 00:55:59)

Re: Memo Field

Hi Frank,
I'm wondering if just setting the scrollbar to 'ssvertical' would get you around the problem (see screenshot1), assuming you've not done this already.
But if the current size of the memo fields is still too small,  another couple of options might be to
1.  call a separate form with a large version of the memo so that it can more easily read (attachment frankmemo1)
2.  stay on the same form as the memo field but overlay it with a panel (attachment frankmemo2) - this option feels a little more 'integrated' but you're ultimately limited by the overall dimensions of the form on which the memo fields is found, which may be an issue if the memo fields contain very large amounts of text.
Derek.

Post's attachments

Attachment icon frank.zip 980.26 kb, 219 downloads since 2020-12-08 

Re: Memo Field

Derek,
Thanks for the suggestions.
Setting the Scroll Bars to Vertical just might be all I need.  Having the UP and DOWN arrows visible should tell the user that the field has or can have more data if they use the arrows.
-
I'm thinking that in my application most of the info put into My memo fields will be only a few words and not a whole lot of text.
-
However, I do like your idea of 1.  call a separate form with a large version of the memo so that it can more easily read (attachment frankmemo1)
-
Here's my brilliant idea using your suggestion (lol).
Could we have a generic Memo-form that could be called from any Memo field in the application?
-
Then could we use the Event OnDoubleClick for the Memo field to call the Memo-form with the larger version of the data from the original memo field?
-
This would eliminate having to use a button to call the Memo-form.  I could put a Hint on each Memo field to tell the user to Double-Click to open the Memo-form.
-
I have the procedure sort of worked out in my head but I haven't quite figured out how to implement it.
Thanks, Frank

Re: Memo Field

Derek,
Thanks to your suggestions I've got it working the way I like. YEAH
-
I created a Memo Form (frmMemo) with a Scrollable Memo field (Memo1)
Then I added a procedure into my Script as follows:
procedure frmEducation_Activities_OnDoubleClick (Sender: TObject);
begin
   frmMemo.memo1.Text:= frmEducation.Activities.text;
   frmMemo.Show;
end;

-
I also put an Exit button on the Memo Form.  Now all I have to do is to change the name of the Memo field so I can use the same form for any memo field.
-
Thanks for the inspiration
Frank

5 (edited by derek 2020-12-08 17:05:05)

Re: Memo Field

Hi Frank,
Good idea to make the memo form available from anywhere.
Just a couple of thoughts (taken from old projects I've done) that might be of interest.
1.  Users might double-click in a memo field to highlight a word.  So instead of double-clicking in the memo field to call the 'memo form', you could use a 'bounce bar' (I use them in quite a few places on other projects).  Simply move the mouse across the bounce bar (the blue line below the memo field) to call the 'memo form'.
2.  The 'memo form' could be specified with no borders (so it looks like a pop-up).  To close the 'memo form', simple move off it with the mouse.
3.  The contents of the memo field could be maintained in either form - as you move between the original form and the 'memo form', the memo text is simply copied from one to the other and back.
4.  The discrete 'memo form' gives the opportunity to display the text in a larger font - so if there is a lot to read through, it makes it a bit easier on the eye.
As I say, just a couple of thoughts.
Derek.

Post's attachments

Attachment icon frankmemo1.zip 341.25 kb, 217 downloads since 2020-12-08 

6 (edited by papafrankc 2020-12-09 05:35:47)

Re: Memo Field

Derek,
Many thanks for the suggestions.
I have implemented them into my app and it works great, but...........there's always a but smile
-
I would like to use the Memo-form for multiple Memo fields on the same form.
My current form has 6 Memo fields.  So it works for one field but I'm not able to get the data from Memo.memo1 back into the other fields.
-
Here's what I have tried so far.  I thought by using a variable it might help but it doesn't seem to help.
I'm using a couple of buttons to open and close the Memo form.  I think they're  a little more user friendly than the "bounce bar".  But the same procedure works with either a button or the "bounce" bar
These are my procedures to move the DATA to and from frmMemo .
// GLOBAL VARIABLE
var varMemo: String;

// Procedure to put the data from the Memo-field into frmMemo
procedure frmEducation_ActivitiesViewEdit_OnClick (Sender: TObject; var Cancel: boolean);
begin
  // Put the memo field into varMemo
  varMemo := frmEducation.Activities.Text;
  frmMemo.Show;
  // Put the DATA from the varMemo into the frmMemo Memo1 field
  frmMemo.Memo1.Text := varMemo;
end;

// Procedure to put the data back into the original Memo field
procedure frmMemo_btnExit_OnClick (Sender: TObject; var Cancel: boolean);
begin
varMemo := frmMemo.Memo1.Text;
frmEducation.Activities.Text := varMemo;
frmMemo.Close;
end;

-
The above procedures work OK
-
When someone opens up frmMemo and changes the data and then tries to put it back into the original Memo field, it requires the Original Memo field as seen in my example above.
However I don't know how to make this process so I can use it with other Memo fields on the same form.
-
Thanks, Frank

7 (edited by derek 2020-12-09 18:03:04)

Re: Memo Field

Hi Frank,
Had a play around with this and the attached is the best I could come up with.
I was hoping to do it by storing the field name that had been clicked and then writing back from FrmMemo to the appropriate memo field - well, that worked okay but the memo fields on the calling form weren't refreshing.  And when I fixed that I noticed that the script had a problem if single or double quotes were part of the memo text.  So in the end, I decided to keep it simple (which is probably what I should have done in the first place - LOL!)..
Derek.

Post's attachments

Attachment icon frank multiple memos.zip 342.42 kb, 228 downloads since 2020-12-09 

Re: Memo Field

Derek,
Thanks for the solution, it looks like it works great and I should be able to make it work in my application.
-
FYI: At first I had trouble because frmMemo went off the bottom of my screen when opened.  So I never saw the Close button at the bottom of the form.
Your form is 865 high and it just won't fit on my monitor.
I have a laptop and the screen is only about 7" high.
And once frmMemo was open in the application I couldn't even see the close button.
-
So, I resized the form and now everything works OK.
-
Note: this screen sizing is a problem in my opinion.  I have another laptop that is even smaller than mine so I have had to limit the height of the forms in my application to 480.
So I'm assuming that my app will be fairly small on larger monitors.
I couldn't find any way in MVD to have my application/forms to scale to the size of the monitor.
-
But functionally your solution works great.
Thanks
Frank