How to create multi line text field with vertical scrollbar enabled in openedge progress 4gl? - char

I have a database column called user_notes. This column length is 4000 char. this column having records in multi line.
Now I want to display this column value in progress form. I have tried the method mentioned in the reference URL Progress display long field (frame/form)
But scrollbar not enabled for the field. can anyone advice how to enable vertical scrollbar for long text item field.

Use an editor widget. It does word wrapping and has a vertical scrollbar.
DEFINE VARIABLE Editor-1 AS CHARACTER
VIEW-AS EDITOR SCROLLBAR-VERTICAL
SIZE 34 BY 8 NO-UNDO.
Editor-1 = "Test text".
DEFINE VARIABLE wWindow AS WIDGET-HANDLE NO-UNDO.
DEFINE FRAME fFrame
Editor-1 AT ROW 2 COL 4 NO-LABEL
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 40 BY 10.
CREATE WINDOW wWindow ASSIGN
HEIGHT = 10
WIDTH = 40
SENSITIVE = yes
HIDDEN = no.
DISPLAY Editor-1 WITH FRAME fFrame IN WINDOW wWindow.
ENABLE Editor-1 WITH FRAME fFrame IN WINDOW wWindow.
VIEW wWindow.
WAIT-FOR CLOSE OF THIS-PROCEDURE.

Add the READ-ONLY option to disallow data entry.

Related

optimalfill of a label

I have two forms in my application, form1 sending a long string (more than 300 characters) or short string (less than 50 characthers) to a label on form2 with a click of a button, I'm using a label because I can't find a memo component with transparent background, and Canvas stuff requires a long code compared with the label properties.
Some label properties
Align == alClient
Alignment = taCenter
Layout = tlCenter
WordWrap = True
AutoSize = True
OptimalFill = True
The idea is to adjust the height of the text with OptimalFill, but when I send a long string to the label, the font size, goes all wrong, sometimes the label fills right (when I repeat a long string after a short string for example).
With a:
showMessage(IntToStr(label.Font.Size));
I've got some weird changes on the font size, if I send a string with 100 chars for the first time I got a font like 18, if I send a string with 20 I got a font like 30 and if I send the same string with 100 chars, I got a 22 (numbers are just an example, not the real / right ones), and not even what they should be btw
IF I change the Caption, the text height goes bad (still the font size of the first string that I've used), it only changes when I send a small string, things just go strange.
Following the above example will be something like:
string with 100 chars returns a font size of 20
string with 70 chars returns a font size of 20 //should be arround 25 or so
string with 10 chars returns a font size of 40
string with 100 chars returns a font size of 22
Already tried:
// to 'reset' the font size then put the string on the caption and later the real string
Caption: = '';
Caption: = # 0;
Caption: = ' ';
Caption: = '-';
Label.Update; // to update the 'math'
Label.Refresh; // to update the 'math'
Label.Repaint; //one by one and all togheter
Label.AdjustSize
Application.ProcessMessages
Form2.Update
Label.UpdateBaseBound
Labe.AdjustFontForOptimalFill;
I tried after and before the 'on click sent string to'
label.Caption: = stringGrid.Cells [0, stringGrid.Row];
Also tried enable and disable the label to 'reset' everything.
Nothing works right, things have a strange value (font size) and the font size depends on the length of the sequence.
How can I make it work right and create the right source calculation each time Legend changes?
Arch Linux X64 with the latest Lazarus (QT) using Gnome 3.22.3 (not sure if this is relevant)

Kendo grid group header customize to show the value and more

I have a Kendo grid that is groupable. The initial display needs to show all data items with no groupings displayed, i.e no 'group' and 'groupHeaderTemplate' are defined.
The grid contains a column (Suspension) where the value displayed is a translated dataitem value, i.e. if value > 10, display '*'.
When the user drags the Suspension column header cell to group, how can you customize the group header to show the value that it is grouping on plus the display 'value', i.e. 10-* ?
Do you mean on the button to turn off the group, or the group header text above each group in the grid ?
If the button to remove the grouping, I think you are stuck doing that manually.
If you mean the text above each group, columns have a groupHeaderTemplate property you can set.
groupHeaderTemplate: "Grouped By Name: #= value #"
See sample http://jsbin.com/IbITaT/2/edit

Change cell background color without changing focus

On a form I have 4 MSFlexGrids.
The top grid contains dynamic data, which updates once in a while.
The user can enter data in the cells of the 3 other grids.
The data which is used to fill the top grid is received via a Winsock control, processed, and then the results are written into the appropriate cells using .TextMatrix(intRow, intCol) = strData
This works fine. The data is updated flawlessly, and the user can enter his data into the other 3 grids without any problems.
The problem occurs when I want to change the background color of some cells in the top grid.
On rare occasions the received data is very important, and the background color of the corresponding cells should change color.
I change the color of the cells with the following code:
With grd
For lngRow = 1 To .Rows - 1
'default background color
lngBack = vbWhite
'check for important values
If Val(.TextMatrix(lngRow, 1)) >= lngMax Then
'important color
lngBack = &H3040FF
End If
'select whole row
.Row = lngRow
.Col = 0
.RowSel = lngRow
.ColSel = .Cols - 1
'set the background color of the selected row
.CellBackColor = lngBack
Next lngRow
End With 'grd
The problem with this is that when the user is entering data in the other 3 grids, and the background color of a row in the top grid is changed, then the focus moves to the top grid, and the user has to enter his data anew in the grid where he was working.
Is it possible to change the background color of a cell or whole row in a MSFlexGrid without moving the focus to that grid?
So far I could not find a solution to the problem itself.
I created a work around though :
I created an enum containing a value for each grid:
Public Enum ActiveGrid
enuSystem = 0
enuTel = 1
enuRLN = 2
enuRood = 3
enuData = 4
enuCircuit = 5
End Enum
Whenever a grid gets the focus I save the corresponding enum value in a form level variable.
After coloring the required cells in the first grid I return the focus to the grid which last had it.
The user is not editing in the grid itself, but in a textbox which is laid over the cell, so there is no real problem with the grid losing the focus.
When you look closely though you see the focus leave and return quickly.
For now I will accept this work around, and its minor glitches.
Maybe in the future I can come up with a better solution, or anyone else has a better suggestion?

Extend the cells in a view in Lotus Notes 7

I have a view which contains 5 columns. Each column has a value of a field.
For example if a value from a text field is to big, let say: " sadereara meareareareea erarearea emeammera" in the view' column it appears only : "saderera ". It appears only in he specified length of the column.
Is there any possibility to expand / extand the cell / the row to see all the text, not just a part of it? Thanks
In View properties on the Style tab (3rd tab) you can set height of Rows to e.g. 9 and then mark the Shrink rows to content option.
That should do the trick.

Change background color of ListView in VB6

I'm working with some legacy code and need to change the background color of a row (and the font color) in a ListView in VB6 based on some criteria. I need to change the color of the row when the row is selected and not selected. I can change the font color of a non-selected row via the .Foreground property but I can't change the color in any of the other scenarios.
Check out this forum post. Here's an sample from the code which colors every other row:
'\\ loop through the rows to select every other row
For i = 1 To lvwBackColour.ListItems.Count
If (lvwBackColour.ListItems(i).Index Mod 2) = 0 Then
'\\ add a tick to the checkbox
lvwBackColour.ListItems(i).Checked = True
'\\ add the colour to the picturebox
'\\ See Here (http://msdn2.microsoft.com/en-us/library/aa230480(VS.60).aspx)
'\\ for information about the Line method
picBG.Line (0, i - 1)-(1, i), &H4000FF, BF
'\\ update column four caption
lvwBackColour.ListItems(i).SubItems(3) = "Hidden column value = 1"
Else
'\\ remove the tick from the checkbox
lvwBackColour.ListItems(i).Checked = False
'\\ reset backcolour to white
picBG.Line (0, i - 1)-(1, i), &HFFFFFF, BF
'\\ reset the Column Four caption
lvwBackColour.ListItems(i).SubItems(3) = "Hidden column value = 0"
End If
Next i
'\\ set the listview to use the picturebox image
lvwBackColour.Picture = picBG.Image
Here's the link to the msdn article which talks about the Line method.
The background color of selected rows is controlled by the system. You cannot change it to anything else.
If you have to be able to change the background of the selected rows, you will need to custom draw the listview -- which, to be honest, is too much of a pain to seriously consider :)

Resources