Announcement

Collapse
No announcement yet.

Desktop Bleed Through

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rodney Hicks
    replied
    I'm not sure that PBWin handles calling the InitCommonControls, where did you see that? PBForms handles calling but I don't think the compiler does.

    Leave a comment:


  • Gary Beene
    replied
    Howdy, Rodney!
    Thanks for the suggestion, but even with a manifest, the bleed through occurs. And as I recall, PBWin handles calling InitCommonControls.

    Code:
    #Resource Manifest, 1, "xptheme.xml"
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity
        version="1.0.0.0"
        processorArchitecture="*"
        name="PowerBASIC EXE"
        type="win32"
    />
    <description>PowerBASIC Application</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
    </dependency>
    </assembly>

    Leave a comment:


  • Rodney Hicks
    replied
    From here:
    https://docs.microsoft.com/en-us/win...-edit-controls

    o use visual styles with these controls, an application must include a manifest and must call the InitCommonControls function at the beginning of the program.

    Leave a comment:


  • Gary Beene
    replied
    Well, well, well! I bumped up the font size and the bleed through appears!

    ... added ... there seems to be some correlation to the amount of text. With one line of text the bleed through does not appear. but with many lines of text the bleed through does appear. Not sure of any exact size that triggers the effect.

    Code:
    #Include "win32api.inc"
    %MultiLineREStyle_Wrap    = %WS_Child Or %WS_ClipSiblings Or %WS_Visible Or %ES_MultiLine Or %WS_VScroll Or %ES_AutoVScroll Or %ES_WantReturn Or %ES_NoHideSel Or %WS_TabStop Or %ES_SaveSel
    %IDC_RichEdit = 500
    Global hDlg, hRichEdit, hFont As Dword
    
    Function PBMain()
       Dialog Default Font "Arial Bold", 72, 1
       Dialog New Pixels, 0, "Bleed Test",0,0,1920,1080, %WS_Popup Or %WS_ClipSiblings Or %WS_ClipChildren To hDlg
       LoadLibrary("msftedit.dll")
       Control Add "RichEdit50W", hDlg, %IDC_RichEdit, Repeat$(25,"Bleed Test one more time!"+$CrLf),10,10,1900,1060, %MultiLineREStyle_Wrap, %WS_Ex_ClientEdge
       Control Handle hDlg, %IDC_RichEdit To hRichEdit
       Dialog Show Modal hDlg Call DlgProc
    End Function
    
    CallBack Function DlgProc() As Long
       Select Case Cb.Msg
          Case %WM_InitDialog
             Font New "Arial Black", 96, 1 To hFont
             Control Set Font GetParent(hRichEdit), %IDC_RichEdit, hFont
          Case %WM_ContextMenu : Dialog End hDlg
          Case %WM_Command     : If Cb.Ctl = %IdCancel Then Dialog End hDlg
       End Select
    End Function

    Leave a comment:


  • Gary Beene
    replied
    Howdy, Dave!

    Well, since I've used similar code for years now, without seeing any bleeding, then I assume its something I've done differently. I'll continue to look at it until the difference bleeds through to my brain!

    Leave a comment:


  • Dave Biggs
    replied
    I am still not clear on why there is any bleedthrough in the first place
    Something to do with the child dialog sharing the main Dialog Message loop and getting a lower priority for redraws and so on ??

    Leave a comment:


  • Gary Beene
    replied
    This combination, redrawing both RichEdit and Dialog under %WM_User seems to eliminate the bleedthrough.

    I am still not clear on why there is any bleedthrough in the first place.

    Code:
    Dialog Post hDlg, %WM_User+500, 0, 0
    
    Case %WM_User+500
       Control ReDraw hDlg, %IDC_RichEdit
       Dialog ReDraw hDlg

    Scrolling the RichEdit will cause the bleed through to go away
    While scrolling works (as I mentioned in #1), this two-line Redraw doesn't introduce as much flicker on startup.

    Leave a comment:


  • Gary Beene
    replied
    Howdy David/Borje!

    I tried both of your suggestions and still got the bleed through.

    However, in my main app I tried replacing this:

    Code:
     %WS_Popup Or %WS_ClipChildren Or %WS_ClipSiblings
    ... with just this and the bleed through went away. I had seem some flickering on startup, hence the use of ClipChildren and ClipSIblings.

    Code:
     %WS_Popup
    Then, I tried using these and saw no bleedthrough.

    Code:
    WS_SysMenu Or %WS_ClipChildren Or %WS_ClipSiblings
    %WS_OverlappedWIndow Or %WS_ClipChildren Or %WS_ClipSiblings
    I did a bit of searching on the web but did not find any mention that %WS_Popup could not be used with %WS_ClipChildren or %WS_ClipSiblings

    Leave a comment:


  • Gary Beene
    replied
    Howdy, Borge!

    Thanks for the comment!

    I've never seen the problem before, so I was a bit surprised. Plus, I've used very similar code on multiple apps. So I'm guessing that my latest app has added a new "feature"!

    I'll try both Dave's and your suggestions this evening when I have time to play with it. Since it won't fail on demand, it's hard to judge the effect of code changes.

    ... added ... actually, I open my main app dialog first - it has no RichEdit. It's when I open a child dialog that has a RichEdit that the bleed through occurs.

    Leave a comment:


  • Borje Hagsten
    replied
    Does it happen when you switch between apps? Then you maybe could try redraw / refresh RichEdit under %WM_Activate or %WM_NcActivate. Oh, I now see you meant at startup. Maybe dialog post to %WM_User+500 and do CONTROL REDRAW on RichEdit instead. Sometimes I have had to use one or more DOEVENTS to finalize things properly at end of such places.

    Leave a comment:


  • Dave Biggs
    replied
    Hi Gary,

    Yes that's what I had in mind..
    Code:
       Dialog Hide hDlg
       Dialog Show Modal hDlg Call DlgProc
    End Function
    
    CallBack Function DlgProc() As Long
       Select Case Cb.Msg
          Case %WM_InitDialog  : Dialog Post hDlg, %WM_User+500,0,0
          Case %WM_User+500    : Dialog Redraw hDlg : Dialog Normalize hDlg

    Leave a comment:


  • Gary Beene
    replied
    Howdy, Dave!

    Thanks for the reply.

    Do you mean something like this ...

    Code:
    Dialog New ...
    Dialog Hide hDlg
    
    then  under WM_InitDialog ...
    Dialog Post hDlg, %WM_User+500,0,0
    
    Case %WM_User+500
       Dialog Normalize
    I did try posting and using Dialog Redraw hDlg under %WM_User+500, but as best I could tell, that did not have the desired result.

    Leave a comment:


  • Dave Biggs
    replied
    You could try hiding the app until it has finished initializing, show by posting a message at the end of %WM_INITDIALOG ?

    Leave a comment:


  • Gary Beene
    started a topic Desktop Bleed Through

    Desktop Bleed Through

    When starting an app of mine, I sometimes get bleed through of the underlying desktop - where a rectangle of the desktop appears in the RichEdit. Scrolling the RichEdit will cause the bleed through to go away (correctly redraw the RichEdit control).

    It does not happen every time - only occasionally.

    The code below is pretty much what I use in the app, but the code below will not duplicate the bleed-through. It's hard to test fixes because the problem doesn't happen repeatedly.
    Code:
    #Include "win32api.inc"
    %MultiLineREStyle_Wrap    = %WS_Child Or %WS_ClipSiblings Or %WS_Visible Or %ES_MultiLine Or %WS_VScroll Or %ES_AutoVScroll Or %ES_WantReturn Or %ES_NoHideSel Or %WS_TabStop Or %ES_SaveSel
    %IDC_RichEdit = 500
    Global hDlg, hRichEdit As Dword
    
    Function PBMain()
       Dialog Default Font "Arial Bold", 32, 1
       Dialog New Pixels, 0, "Bleed Test",0,0,1920,1080, %WS_Popup Or %WS_ClipSiblings Or %WS_ClipChildren To hDlg
       LoadLibrary("msftedit.dll")
       Control Add "RichEdit50W", hDlg, %IDC_RichEdit, "Bleed Test",10,10,1900,1060, %MultiLineREStyle_Wrap, %WS_Ex_ClientEdge
       Dialog Show Modal hDlg Call DlgProc
    End Function
    
    CallBack Function DlgProc() As Long
       Select Case Cb.Msg
          Case %WM_ContextMenu : Dialog End hDlg
          Case %WM_Command     : If Cb.Ctl = %IdCancel Then Dialog End hDlg
       End Select
    End Function
Working...
X