Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Al
i have used your test for length in the following editbox program. The problem i have encountered is that when i introduce another text file say named "00s00mm.txt' the form itself changing according to your program - however the inner box (edit1) remains the same despite the new parameters for length. I think this is because the object is not removed from memory - do you happen to know how i can refresh the
'ADD OBJECT Edit1 AS EditBox WITH' so it responds to the new length numbers - thanks so much for help - almost there.
apologies to all for the cross over with my previous thread (clear memory from class).
k
mes = '00c00mm.TXT' &&& this text is variable otheres have variable widths
lnmaxlength =0
DO LENTEST && test length of text file (Al Doman's program)
MESLEN = lnmaxlength
meslen= (meslen*7.2)+18 &&&(convets character to pixels + window screen size)
LOCAL oFrm
oFrm= createOBJECT("classRooms")
oFrm.Top = 24
oFrm.left = 1420-meslen && will keep right border assuming 1440 screen width
oFrm.Height = 573
oFrm.Width = meslen
****** oFrm.desktop = .t. moved to class definition
oFrm.edit1.value = filetostr(mes)
oFrm.Show(1)
************************************
DEFINE CLASS classrooms AS Form
ADD OBJECT Edit1 AS EditBox WITH ;
FontSize = 8, ;
FontStyle = 'n', ;
Height= 550, ;
Left= 2, ;
fontname='lucida console', ;
ReadOnly= .t., ;
TabIndex= 2, ;
Top= 2, ;
Width= meslen-5, ;
Value= ""
desktop = .t. &&& moved from setting oFrm
ENDDEFINE
Public Event MouseWheel As MouseWheelEventHandler
PROCEDURE Object.MouseWheel
LPARAMETERS nDirection, nShift, nXCoord, nYCoord
PROCEDURE edit1.MouseWheel
LPARAMETERS nDirection, nShift, nXCoord, nYCoord
* Set focus to this control
If Type("thisform.ActiveControl") # "O" or thisform.ActiveControl < > this
this.SetFocus
EndIf
ENDPROC
Object.RemoveObject(edit1)
oFrm.hide(1)
PROC LENTEST
CREATE CURSOR LengthTest ;
( LineChars C( 254 ) )
APPEND FROM &MES TYPE SDF
CALCULATE MAX( LEN( TRIM( LengthTest.LineChars ) ) ) TO lnMaxLength
USE IN LengthTest
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement