WinFBE 2.0.7 - Frame

Started by SeaVipe, March 04, 2020, 05:42:02 PM

Previous topic - Next topic

SeaVipe

Hi Paul, In a new project, there is 1 frame on a form. Modifying the Text property prior to modifying the Form's Text property from Form_Load works but modifying the Frame's Text property a second time, the frame disappears.
If I reverse the order of the 2 calls, frmMain.Text = "Some text" before frmMain.Frame1.Text = "Some text" then the frame will not disappear regardless of where its called from.




Clive Richey

Paul Squires

Hi Clive, thanks for the report. I am trying to replicate the problem but have not yet been successful. I create a simple new project and added a Frame and a Button. Here is the code but the frame does not disappear. I am using 2.0.6.

''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   frmMain.Frame1.Text = "Frame new text"
   frmMain.Text = "Form Name modified"
   frmMain.Frame1.Text = "Frame New Load Text"
   Function = 0
End Function

''
''
Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
   frmMain.Frame1.Text = "FrameText from Button"
   Function = 0
End Function


Paul Squires
PlanetSquires Software

SeaVipe

Hi Paul,
This hides the frame:

Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
    frmMain.Frame1.Text = "FrameText from Button"
    '' Modifying the form's text here will hide the frame
    frmMain.Text = "FormText from button"
    Function = 0
End Function

Reverse the order of the 2 lines of code:


Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
    '' Modifying the form's text here will NOT hide the frame
    frmMain.Text = "FormText from button"
    frmMain.Frame1.Text = "FrameText from Button"
    Function = 0
End Function

Also, I added a second button that does not hide the frame (like the second example code) and when clicked it restores the frame, if hidden, and displays the new text. I'm using WinFBE 2.0.7
Clive Richey

Paul Squires

Thanks Clive - yes, I see the problem now using your code. Looks like when I call AfxRedrawWindow in the Text set property of the base wfxControl class that it causes the frame to disappear. If I comment out that function call then the frame does not vanish.


property wfxControl.Text( byref nValue as wstring )
   if this.hWindow then
      AfxSetWindowText(this.hWindow, nValue)
      AfxRedrawWindow(this.hWindow)   '<--- this is causing the frame issue
   End If   
   _Text = nValue
end property


I might just add a Text property to the wfxForm class in order to override the base wfxControl call. I can't remember why I added AfxRedrawWindow after the call to AfxSetWindowText but I must have done so for a reason....maybe there was another control that needed the window refresh after setting the text. I can't remember at this point.
Paul Squires
PlanetSquires Software