How to scroll prompts horizontally?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
HGAutomator
Posts: 202
Joined: Thu Jul 16, 2020 5:42 pm
DBs Used: DBF

How to scroll prompts horizontally?

Post by HGAutomator »

Hi,

Note: this isn't referring to a grid. I'm just doing some @row, @col Prompt statements.

Specifically, using Grumpfish's Menuh (below), I'm trying to figure out how to scroll the prompts to the right, when the prompts get past the maxcol() on the screen.

This is the Menuh.prg snippet that displays the prompts, from a list of prompts & messages separated by a dollar sign $.

Code: Select all

if '$' $ cPrompts
   cPrompts := trim(cPrompts)
   cPrompts := cPrompts + ;
                if(substr(cPrompts, len(cPrompts), 1) == '$', '', '$')
   do while ptr1 < len(cPrompts)
      cPrompt := NextItem(cPrompts)
      @ nRow, nCol prompt cPrompt message NextItem(cMessages)
      cPrompts := Truncate(cPrompts)
      cMessages := Truncate(cMessages)
      nCol += len(cPrompt) + nSpacing
   enddo
   #ifdef MOUSE
      menu to nChoice initial nChoice
   #else
      menu to nChoice
   #endif
endif
This is my code that calls MenuH

Code: Select all

Function HorzMenu
// SET WRAP ON                                                           
// SET MESSAGE TO 2 CENTER                                              
SET MESSAGE TO 2
SETCOLOR( "W+/B,B/W,,W+/B")
cls(23, chr(177))
sel = MENUH(1, 0, 1, 'Data Entry$Reports$Previous Menu$Analysis$Fifth Selection$Sixth Selection$Seventh Selection$Eight Selection$Ninth Selection$Tenth Selection$','Data Entry starts here$Test the Report Writer$Go to the Previous Menu$Do some Analysis$Fifth Selection$Sixth Selection$Seventh Selection$Eight Selection$Ninth Selection$Tenth Selection$','W+/B,B/W,,W+/B')
DO CASE                                                               
   CASE sel = 1                                                       
      QOut( "Number 1 selected" )
      wait
   CASE sel = 2                                                       
      QOut( "Number 2 selected" )
      wait
   CASE sel = 3
      QOut( "Number 3 selected" )
      wait
   CASE sel = 4                                                       
      QOut( "Number 4 selected" )
      wait
   CASE sel = 5                                                       
      QOut( "Number 5 selected" )
      wait
   CASE sel = 6                                                       
      QOut( "Number 6 selected" )
      wait
   CASE sel = 7                                                       
      QOut( "Number 7 selected" )
      wait
   CASE sel = 8                                                       
      QOut( "Number 8 selected" )
      wait
   CASE sel = 9                                                       
      QOut( "Number 9 selected" )
      wait
   CASE sel = 10                                                       
      QOut( "Number 10 selected" )
      wait
   OTHERWISE                                                          
      RETURN                                                          
ENDCASE                                                               

Return Nil

I'm adapting it to Harbour of course, and surprisingly it doesn't require the Grump library.

In the attached images, there are Ten Prompts total.
The Ninth Prompt - mostly - fits on the screen, with just a few characters off to the right.

But the Tenth Prompt is all the way past the MaxCol(). Note that the Message corresponding to the Prompt, does fit on the screen, because it's justified to the Left.

How do we use Scroll() or another function to shift the prompts to the left, so that the Tenth Prompt is visible, while the first Prompt is not visible?

I played with Scroll() a bit, but it's having no effect.


MenuH_NinthSelection.jpg
MenuH_NinthSelection.jpg (228.97 KiB) Viewed 679 times
MenuH_TenthSelection.jpg
MenuH_TenthSelection.jpg (247.89 KiB) Viewed 679 times
User avatar
tonton2
Posts: 484
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: How to scroll prompts horizontally?

Post by tonton2 »

pouvez vous mettre la librairie de Grump en zip sur ce forum Merci d'avance
L'Algerie vous salut
Y.TABET
WatsApp :+213770943143
HGAutomator
Posts: 202
Joined: Thu Jul 16, 2020 5:42 pm
DBs Used: DBF

Re: How to scroll prompts horizontally?

Post by HGAutomator »

Tonton,

Sorry, I didn't receive an email notification. I didn't know that anyone replied.

You can find most of the legacy Clipper public domain code, here:

https://github.com/harbour/the-oasis/tr ... es/library

Grump specifically can be found here:

https://github.com/harbour/the-oasis/bl ... ump406.zip


Also, anyone who doesn't mind buying it can find LOTS of free and shareware code, including Clipper and other Xbase languages, here:

http://www.emsps.com/index2.htm

However, you have to order and receive it on a CD-Rom. I found lots of helpful modules, in this package.


Regards,


tonton2 wrote: Tue Oct 26, 2021 8:32 pm pouvez vous mettre la librairie de Grump en zip sur ce forum Merci d'avance
User avatar
tonton2
Posts: 484
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: How to scroll prompts horizontally?

Post by tonton2 »

Merci beaucoup mon ami , très utiles
L'Algerie vous salut
Y.TABET
WatsApp :+213770943143
Post Reply