Page 1 of 2

RTF Based Help Composer and Viewer

Posted: Wed Jan 16, 2019 8:13 pm
by blueb
One of the things "I've always wanted" in PureBaisic is a way to create Help files
that show users how to use the programs I've written.

I created a 'Builder' for the programmer and a 'Viewer' for your users.

Because it has Icons, etc. I've zipped it all together, and placed it in my DropBox account:

NOTE: Windows only at the moment.
https://www.dropbox.com/s/pspw2iibpiwki ... m.zip?dl=0

Total Freeware... All EXE's, source code and images are included. :)

Re: RTF Based Help Composer and Viewer

Posted: Thu Jan 17, 2019 7:35 pm
by kvitaliy
Unpleasant effect when scrolling text:
Image
Win7 x64

Re: RTF Based Help Composer and Viewer

Posted: Fri Jan 18, 2019 11:55 am
by blueb
:(
Works well on my system (Win 10). I spent some time looking in the Event Loop, but

I'm not familiar enough with the Win API SendMessge function to spot the differences between Win 10 and Win 7.

Perhaps an API guru could take a look at the source and spot the problem in the event loop?

Re: RTF Based Help Composer and Viewer

Posted: Fri Jan 18, 2019 1:18 pm
by chi
kvitaliy wrote:Unpleasant effect when scrolling text
Works well on my Win7... (also tested on VirtualBox, both with or without desktop composition)
What sets your Win7 apart from a vanilla installation? I recognized the sharp corners on Min/Max/Close, that do not meet the standard.

Re: RTF Based Help Composer and Viewer

Posted: Fri Jan 18, 2019 7:49 pm
by Kwai chang caine
Works very well on W10 X64, no problem scrolling :wink:
Thanks for sharing your nice software and his source 8)

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 12:44 pm
by srod
The editor gadget can behave very poorly I'm afraid. Bugs that have been reported in the past are still not fixed.

Your help viewer suffers with a similar problem that you can see with the following :

Code: Select all

If OpenWindow(0, 0, 0, 400, 400, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget)
  EditorGadget(0, 10, 10, 380, 380)
  For a = 0 To 30
    AddGadgetItem(0, a, "Line "+Str(a))
  Next
  Repeat
    event = WaitWindowEvent()
    Select event
      Case #PB_Event_SizeWindow
        ResizeGadget(0, #PB_Ignore, #PB_Ignore, WindowWidth(0) - 20, WindowHeight(0) - 20)
    EndSelect
  Until event = #PB_Event_CloseWindow
EndIf
Scroll down a bit in the editor gadget and then maximize the window. On my system (Win 7x64) the scrollbar has not been properly erased. Only happens if the maximised window is large enough to remove the need for a scrollbar.
You can get around this with some strategically placed HideGadget() calls, but it makes for some very flickery resizing!

If it were me, I would abandon the editor gadget in favour of either a canvas gadget or a web gadget.

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 2:39 pm
by blueb
srod wrote:The editor gadget can behave very poorly I'm afraid.

...Scroll down a bit in the editor gadget and then maximize the window. On my system (Win 7x64) the scrollbar has not been properly erased. Only happens if the maximised window is large enough to remove the need for a scrollbar.
Thanks for the info srod.

I tried your sample and my Win 10 system behaved like it should (unlike Fangbeast in a flock of sheep) :mrgreen:

But I will keep your suggestions in mind.

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 3:00 pm
by srod
blueb wrote:I tried your sample and my Win 10 system behaved like it should (unlike Fangbeast in a flock of sheep) :mrgreen
Any kind of flock or herd really. He just can't help himself I'm afraid... though not as afraid as any flock of sheep should be who happened to be wandering by his neighbourhood!

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 3:01 pm
by blueb
:mrgreen:

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 3:35 pm
by RASHAD
Hi blueb
- Avoiding what srod mentioned
- Eliminate flickering

Code: Select all

Procedure SizeCB(windowID, Message, wParam, lParam) 
     Define *SizeTracking.MINMAXINFO
     
     If Message = #WM_GETMINMAXINFO       ; To limit the smallest dimension
          *SizeTracking = lParam 
          *SizeTracking\ptMinTrackSize\x = 750 
          *SizeTracking\ptMinTrackSize\y = 550 
          *SizeTracking\ptMaxTrackSize\x = GetSystemMetrics_(#SM_CXSCREEN) 
          *SizeTracking\ptMaxTrackSize\y = GetSystemMetrics_(#SM_CYSCREEN)
          ResizeGadget(#RichEdit, 270, 40, WindowWidth(#MainWindow)-280, WindowHeight(#MainWindow)-85)
          ResizeGadget(#ListGadget, 10, 40, 250, WindowHeight(#MainWindow)-85)
     ElseIf Message = #WM_SIZE
          HideGadget(#RichEdit,1)
          Protected p.POINT
          SendMessage_(GadgetID(#RichEdit), #EM_SETSCROLLPOS, 0, @p)
          ResizeGadget(#RichEdit, 270, 40, WindowWidth(#MainWindow)-280, WindowHeight(#MainWindow)-85)
          ResizeGadget(#ListGadget, 10, 40, 250, WindowHeight(#MainWindow)-85)          
          HideGadget(#RichEdit,0)
     ElseIf Message = #WM_ENTERSIZEMOVE
          SendMessage_(GadgetID(#RichEdit),#WM_SETREDRAW,0,0)
     ElseIf Message = #WM_EXITSIZEMOVE
          SendMessage_(GadgetID(#RichEdit),#WM_SETREDRAW,1,0)
          ;RedrawWindow_(GadgetID(#RichEdit), 0, 0, #RDW_ERASE | #RDW_FRAME | #RDW_INVALIDATE | #RDW_ALLCHILDREN)          
     EndIf      
     
     ProcedureReturn #PB_ProcessPureBasicEvents 
EndProcedure 


Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 3:59 pm
by blueb
RASHAD wrote:Hi blueb
- Avoiding what srod mentioned
- Eliminate flickering
I tried your changes on my Win 10 system with no visible differences that I could tell.

So I made the changes to the source, rezipped the files to my DropBox account. (use first post)

I would appreciate Win 7 Users retrying the program.

Thanks Rashad... much appreciated. :D

Re: RTF Based Help Composer and Viewer

Posted: Sat Jan 19, 2019 7:49 pm
by srod
Yep, Rashad's workaround works fine here and eliminates the problems I saw with Win 7.

Re: RTF Based Help Composer and Viewer

Posted: Sun Jan 20, 2019 6:39 am
by Fangbeast
I tried your sample and my Win 10 system behaved like it should (unlike Fangbeast in a flock of sheep) :mrgreen:
You utter, umitigated, conscienceless bastard!!! I just saw this post!!

If it hadn't been for the fact that they were wearing srod's unwashed, steaming, fetid, rancid underpants, I would have have stayed true to form and gone with goats but well, I thought they were goats!!

I know you stole Idle's sheep and put srods shameful underpants on them to trick me, I just know it!

Oh, the humiliation, I will be known as a closet sheep shagger in the forums now (My goat mayleen will never forgive me!! Sob, sob, sob)

Re: RTF Based Help Composer and Viewer

Posted: Fri Jan 25, 2019 4:14 pm
by Jan2004
RTF Based Help Composer and Viewer - it is interesting idea. However, the program does not behave properly. I'm using Windows XP. If I move the program window out of the screen area of the monitor the EditorGadget window is decreasing - only re-clicking the window restores the proper size. Please check if the program behaves the same in other versions of Windows. Here is an illustration of the problem.
http://www.lokus.com.pl/pr1.jpg
http://www.lokus.com.pl/pr2.jpg

Re: RTF Based Help Composer and Viewer

Posted: Fri Jan 25, 2019 4:25 pm
by srod
That doesn't happen on my Win 7 system. However, the entire contents of the editor gadget sometimes disappears!