RTF Based Help Composer and Viewer

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

RTF Based Help Composer and Viewer

Post 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. :)
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
kvitaliy
Enthusiast
Enthusiast
Posts: 162
Joined: Mon May 10, 2010 4:02 pm

Re: RTF Based Help Composer and Viewer

Post by kvitaliy »

Unpleasant effect when scrolling text:
Image
Win7 x64
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: RTF Based Help Composer and Viewer

Post 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?
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: RTF Based Help Composer and Viewer

Post 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.
Et cetera is my worst enemy
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RTF Based Help Composer and Viewer

Post by Kwai chang caine »

Works very well on W10 X64, no problem scrolling :wink:
Thanks for sharing your nice software and his source 8)
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: RTF Based Help Composer and Viewer

Post 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.
I may look like a mule, but I'm not a complete ass.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: RTF Based Help Composer and Viewer

Post 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.
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: RTF Based Help Composer and Viewer

Post 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!
I may look like a mule, but I'm not a complete ass.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: RTF Based Help Composer and Viewer

Post by blueb »

:mrgreen:
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: RTF Based Help Composer and Viewer

Post 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 

Egypt my love
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: RTF Based Help Composer and Viewer

Post 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
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: RTF Based Help Composer and Viewer

Post by srod »

Yep, Rashad's workaround works fine here and eliminates the problems I saw with Win 7.
I may look like a mule, but I'm not a complete ass.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: RTF Based Help Composer and Viewer

Post 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)
Amateur Radio, D-STAR/VK3HAF
Jan2004
Enthusiast
Enthusiast
Posts: 154
Joined: Fri Jan 07, 2005 7:17 pm

Re: RTF Based Help Composer and Viewer

Post 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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: RTF Based Help Composer and Viewer

Post by srod »

That doesn't happen on my Win 7 system. However, the entire contents of the editor gadget sometimes disappears!
I may look like a mule, but I'm not a complete ass.
Post Reply