💾 Archived View for mirrors.apple2.org.za › archive › apple.cabi.net › FAQs.and.INFO › VIDEO.MISC.IN… captured on 2023-01-29 at 07:55:14.

View Raw

More Information

-=-=-=-=-=-=-

Newsgroups: comp.sys.apple2.programmer
Path: news.weeg.uiowa.edu!news.uiowa.edu!hobbes.physics.uiowa.edu!newsrelay.iastate.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!pipex!uunet!zib-berlin.de!netmbx.de!news.netmbx.de!zelator!tooly
From: tooly@zelator.de (Theo Schneider)
Subject: Re: how to get info from Window Record?, Text Edit help
Organization: Public-Access-Unix-System
Date: Wed, 02 Feb 1994 09:23:09 GMT
Message-ID: <OCMLBJYF@zelator.de>
References: <2iakd0$btp@TAMUTS.TAMU.EDU> <2iaqf3$ruk@paris.ics.uci.edu> <2iboro$7tm@TAMUTS.TAMU.EDU> <2iel0r$1ka@paris.ics.uci.edu> <2ijq5p$qnh@TAMUTS.TAMU.EDU>
Lines: 69

In <2ijq5p$qnh@TAMUTS.TAMU.EDU> j0p7771@TAMUTS.TAMU.EDU (Jason Perez) writes:

[some stuff deleted]
>to be able to manipulate the vertical scroll bar.  is it possible to change 
>the ctlAction procedure/ctlValue of a window scroll bar to my routine/value
>and not mess up the Window Manager?

>--

Hi Jason,

it's simple to set an own ctlAction Routine to Your ScrollBar.
Do this with '

{$databank+}
procedure myScrollProc (part : integer; ctlHndl : ctlRecHndl);
var
  val, oVal : integer;

begin
  val := GetCtlValue (ctlHndl);
  oVal := val;
  case part of 
	 upArrow   : val := val - 1;
	 downArrow : val := val + 1;
    pageUp    : val := val + TheSizeOfYourPage;	 
	 pageDown  : val := val + TheSizeOfYourPage;
    thump     : begin
						val := oVal;
						oVal := val - 1
                end;
    otherwise :;
  end;
  if val < 0 then val := 0;
  if val > maxLinesInDocument then val := maxLinesInDocument;
  if val <> oVal then SetCtlValue (val, ctlHndl);
  {here you can do some things to update your TE-Ctl}
end;
{$databank-}

ctlHndl := GetCtlHandleFromID (myWin, myScrollBar);
SetCtlAction (@myScrollProc, ctlHndl);


You can use the same procedure for Horz and Vert ScrollBars.
For Horz.Scroll Up/Down is left/right. If You want to use this
procedure for both ScrollBars you can insert the line
ScrollBarID := GetCtlID (ctlHndl);
and has now the ID for the selected ScrollBar.

I hope this will help You.

>Jason Perez                     | "Frodo Lives!"       "Gig 'em!"
>j0p7771@tamuts.tamu.edu         | Texas A&M Univ. - it's not just for 
>jperez@ee.tamu.edu              |                   farmers anymore!


mfg
	Theo

-- 
   
   +****************************************************************+
   *  Theo Schneider       |       Tom Tooly Software Berlin        * 
	*  Babelsberger Str. 40 | Internet : tooly@zelator.in-berlin.de  *
   *  10715 Berlin         | Zerberus : T.Schneider@TeleMail.Zer    *
   *  Germany              | Phone    : ++49 30 854 29 72           *
   +****************************************************************+