how to define scroll bar's page size value?

Hi all,

I have a confusion about calculating scroll bar's page size.

In my application, I am drawing an image according to scroll bar
position.

m_iGeneratedImgWidth - Width size of the image (this value is always
bigger)
rect.right                      - Width of the drawing area.

how to define scroll bar's page size value?

   SCROLLINFO info;
   info.cbSize = sizeof(SCROLLINFO);
   info.fMask = SIF_RANGE|SIF_PAGE|SIF_POS;
   info.nPos = 0;
   info.nMin = 0;
   info.nMax = m_iGeneratedImgWidth - rect.right;
   info.nPage = ?

In my OnHScrollBar() function, for SB_PAGELEFT / SB_PAGERIGHT codes, I
subtract/add 10 for displaying image.

I want to set correct value, because this is the only way to change
size of the tracking thumb of scroll bar control.

:)
Purusothaman A

0
1/10/2007 8:33:43 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1635 Views

Similar Articles

[PageSpeed] 57

A page size value is whatever you want it to be.  In your WM_HSCROLL or WM_VSCROLL
handlers you increment or decrement the value by whatever you feel like.  For example, for
a "page" you might increment or decrement by the GetClientRect() values Width() or
Height() values appropriately.  Or half of them.  Or 3/4 of them.  Or whatever.

The thumb size, which is the thumb size, has nothing to do with the amount of space you
will scroll on a page-up/down or page-left/right operation. Instead, it is the amount of
the range that is visible.

So if you have a window 200 pixels high, and you have an image 800 pixels high, you might
set the scroll range to be 0..600 (that's 0..(picture size - client height)).  You would
set the nPage value to 200.  This would give a wide thumb position.  It would *not* change
the amount you scroll in a WM_HSCROLL/WM_VSCROLL handler when a page request comes in.  It
just shows the amount of the image being shown.
					joe

On 10 Jan 2007 00:33:43 -0800, "Purusothaman A" <Purusothaman.A@gmail.com> wrote:

>Hi all,
>
>I have a confusion about calculating scroll bar's page size.
>
>In my application, I am drawing an image according to scroll bar
>position.
>
>m_iGeneratedImgWidth - Width size of the image (this value is always
>bigger)
>rect.right                      - Width of the drawing area.
>
>how to define scroll bar's page size value?
>
>   SCROLLINFO info;
>   info.cbSize = sizeof(SCROLLINFO);
>   info.fMask = SIF_RANGE|SIF_PAGE|SIF_POS;
>   info.nPos = 0;
>   info.nMin = 0;
>   info.nMax = m_iGeneratedImgWidth - rect.right;
>   info.nPage = ?
>
>In my OnHScrollBar() function, for SB_PAGELEFT / SB_PAGERIGHT codes, I
>subtract/add 10 for displaying image.
>
>I want to set correct value, because this is the only way to change
>size of the tracking thumb of scroll bar control.
>
>:)
>Purusothaman A
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
1/10/2007 2:56:16 PM
Thanks Joseph M.Newcomer for your nice reply.

:)
Purusothaman A

"Joseph M. Newcomer" wrote:

> A page size value is whatever you want it to be.  In your WM_HSCROLL or WM_VSCROLL
> handlers you increment or decrement the value by whatever you feel like.  For example, for
> a "page" you might increment or decrement by the GetClientRect() values Width() or
> Height() values appropriately.  Or half of them.  Or 3/4 of them.  Or whatever.
> 
> The thumb size, which is the thumb size, has nothing to do with the amount of space you
> will scroll on a page-up/down or page-left/right operation. Instead, it is the amount of
> the range that is visible.
> 
> So if you have a window 200 pixels high, and you have an image 800 pixels high, you might
> set the scroll range to be 0..600 (that's 0..(picture size - client height)).  You would
> set the nPage value to 200.  This would give a wide thumb position.  It would *not* change
> the amount you scroll in a WM_HSCROLL/WM_VSCROLL handler when a page request comes in.  It
> just shows the amount of the image being shown.
> 					joe
> 
> On 10 Jan 2007 00:33:43 -0800, "Purusothaman A" <Purusothaman.A@gmail.com> wrote:
> 
> >Hi all,
> >
> >I have a confusion about calculating scroll bar's page size.
> >
> >In my application, I am drawing an image according to scroll bar
> >position.
> >
> >m_iGeneratedImgWidth - Width size of the image (this value is always
> >bigger)
> >rect.right                      - Width of the drawing area.
> >
> >how to define scroll bar's page size value?
> >
> >   SCROLLINFO info;
> >   info.cbSize = sizeof(SCROLLINFO);
> >   info.fMask = SIF_RANGE|SIF_PAGE|SIF_POS;
> >   info.nPos = 0;
> >   info.nMin = 0;
> >   info.nMax = m_iGeneratedImgWidth - rect.right;
> >   info.nPage = ?
> >
> >In my OnHScrollBar() function, for SB_PAGELEFT / SB_PAGERIGHT codes, I
> >subtract/add 10 for displaying image.
> >
> >I want to set correct value, because this is the only way to change
> >size of the tracking thumb of scroll bar control.
> >
> >:)
> >Purusothaman A
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
> 
0
a9969 (81)
1/11/2007 4:51:00 AM
Reply:

Similar Artilces:

bar chart #11
I have made a bar chart but the axis descriptors are not aligned with the bar. What I mean to say is they are not in the middle of the tick marks How can i align them? afd EXCEL 2007 I have just checked one of my bar charts where they are lined up properly. Try the following:- - click in the Vertical Axis to highlight it - right click and select Format Axis (window of same name should pop up) - Axis Options should be highlighted on left hand side. In here make sure that:- 1. Interval between tick marks: is set to 1 2. Interval between labels: try setting to Aut...

Bar Graph Question #2
Hi, Is it possible to plot a horizontal bar graph where the Y axis represents a category, the X axis is Time, and where the height of the bar is related to an additional numervial variable? Thanks and happy to clarify, Kevin I know of no way to do this (I assume you want the third variable to change the bar's width) But post this to the charting newsgroup and see if Jon Peltier has a VBA answer. -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "kmatch" <kmatch@discussions.microsoft.com> wrote in message news:DE51BB2B-4D04-4980-8CC3-11A986A5...

HTML output with multiple pages
I am using the DoCmd.OutputTo command and outputting a report to an HTML file. If my report is multiple pages I am getting a seperate HTML file for each page. Is there any way to combine all the pages into one HTML file? Many thanks. Jeff ...

Problem with register scrolling
I just started having this problem with Money 2004 Deluxe. When I try to scroll to the last entry of my register the scroll bar reaches the bottom, but I am not at the bottom of the register. I must click on the down arrow at the bottom of the scroll bar to get the register to scroll to the last entry. bdog Are you using a scroll mouse button? Sometimes the button gets stuck and what you describe happens in Bills & Deposits. If so then move your scroll button a slight amount. Mark Fields "bdog" <bd@op.net> wrote in message news:Xns9469EF048AE96bdopnet@24.50.78.38...

Drop-down font size
How do you change the font size in a drop down selection list? I can change the font size on the actual list of data, but it doesn't affect the font size in the drop down selection list. Thanks for any feedback!! If this is a Data Validation dropdown list, you can't change the font size. However, you can use programming to adjust the zoom setting when the cell is selected. There's some sample code here: http://www.contextures.com/xlDataVal08.html#Larger John wrote: > How do you change the font size in a drop down selection > list? I can change the font size ...

smooth scrolling lag
I have searched high and low for this. It is actually an issue that affects Excel, Word, even Notepad. Pulling down on the vertical scroll bar - the bar lags behind the mouse at some slow acceleration. When the mouse stops the scroll bar eventually catches up. If you scroll back and forth quickly with the mouse, then the scroll bar actually goes the opposite direction as it catches up to the first movement. It seems like a really slow smooth scrolling that is quite painful to use. How can I disable this "feature?" Thanks, David David, I don't have an answer for you...

File size #10
Has anyone ever noticed that if you had a really big spreadsheet at on time, but reduced it to a smaller one since then, the file size ca still seem really huge. And that if you were to copy and paste wha data you did have into a brand new spreadsheet than you would end u having a much smaller file size? Any explanations? Solutions? I hav also noticed this in PPT -- Message posted from http://www.ExcelForum.com "Scottmk >" <<Scottmk.1c121g@excelforum-nospam.com> wrote in message news:Scottmk.1c121g@excelforum-nospam.com... > Has anyone ever noticed that if you ha...

Calculating average discarding lowest value
How can I calculate an average automatically dropping the lowest value--I am requested to use SUM, MIN and Count functions. Thanks I think it would be =(SUM(range)-MIN(range)) / (count(range)-1)) replace the word range with your actual range A1:A5 eg, http://www.excel-ant.co.uk inspiredtoo wrote: > How can I calculate an average automatically dropping the lowest value--I am > requested to use SUM, MIN and Count functions. > Thanks Thanks, that is a great help and it did work, however it only requires one bracket after the -1, or at least that is what the "formula fixer...

Data validation with a cell value linked to the same cell.
I Think that my post name is very confusing but I'll explain. I�m doing a data validation in cell f1 usig the data validation option the value entered in cell f1 need to be equal or greatter than th value in cell b2 and cell b2 is calculated with the formula =a2+c4-f1. What I'm trying to do is to prevent to enter a value in cell f1 tha I'll make cell b2 negative. But its not working, any suggetsions??? Thanks. Rodolf -- Message posted from http://www.ExcelForum.com Change your CF criterion to Formula is = F1 <= (A2+C4) In article <rodolform.161w07@excelforum-n...

How add value to new attribute created in Active directory
I have created one new attribute in active directory schema as "Bdate", to store users birthdate data in AD Database. Added this attribute to User Class & it is showing active in schema attribute. I checked the same is available in User Class. ACTIVE DIRECTORY SCHEMA > Classes > user. Now how to add birthdate data in this attribure field for the users. My Server Details are as under in AD Explorer. ==== Attribute: mayContain Object: CN=User,CN=Schema,CN=Configuration,DC=CPL,DC=LOCAL,172.25.52.254 [mytest.CPL.LOCAL] Syntex: OID Schema: CN=May-Cont...

"eco" option to reduce paper (1st page only, max margin, font, re.
People are lazy, so they don't think on the best option before printing, i suggest creating an option to use printers on a more "eco" way by default. for example more and more people reply on each other mail, and we don´t print, but when we do, generally we only need the last message and we get all the mail (7, 8 pages to waste if we manage to stop before the 20 get out), if an "eco" option could be select, only the 1st page would came out, (or the one on the screen), with maybe other setings like using margins to the max, a smaller font with readabi...

automatically calculate table values via formulas in sheet
Hi, I am stuck with a challenge, maybe someone can help. I am creating a table with the outcomes of various calculations. I got a worksheet with 2 variable inputs (A1 and A2) and the outcome presented in A7. Now I need to create a table with the possible A1 values above and the possible A2 values on the left. As there are over 100 options for A1 and over 300 for a2 you can imagine I don't want to type all these values in A1 and A2. So I am wondering, there must be a function to calculate the outcomes A7 in this table using the formula's existing in my sheet. Does anybody know how th...

Excel find and replace within a range of values?
I've basically got a data set, that I need to convert to values for a neural net. My problem is I can replace standard entries such as 'male' to the corresponding numeric value but for fields such as age, where say a range between 25 and 35 is 0.5, it has to find every age within that range and convert them all to 0.5. Is there an easy way of doing this without having to do it manually? Si -- Bumble "I'm flat out, you're so beautiful to look at when you cry. Freeze don't move, you've been chosen as an extra in the movie adaptation of the sequel to your life...

Values imported from QIF files into MS Money are multiplied by 100
After successfully using Money 2004 for two years I had to reinstall my PC from scratch. Now, after reinstalling Money, every time I import a QIF file (the same QIF file I imported last week) all figures are multiplied by 100. I'm using Money on a PC with Italian Regional Settings The QIF files contains lines like the following D06/10/06 T-1.112,80 N LEXPENSE M NOTES ^ Please note that this is an Italian file, so comma and dots are swapped The number 1112,80 is imported as 111280,00 I don't understand what might have changed, the import has always worked smoothly I noticed that if...

Calendar as web page
I'm using Outlook 2002. When I save a calendar as a web page, it looks just fine in my local website when viewing in the browser. But when I publish it to my website, at the top where the days of the week should be, and at the bottom where the date the calendar was made should be, it says, "The page not found." Everything else looks fine. I have checked to see if I have not published a file related to the calendar, but can't find one. Help! ...

Bills Summary Page crash
When on the Bills Summary page in MS Money 2006 Premium and I Attempt to sort the list of bills by the payee column, Money quits without an error message. In microsoft.public.money, Brewster wrote: >When on the Bills Summary page in MS Money 2006 Premium and I Attempt to sort >the list of bills by the payee column, Money quits without an error message. http://support.microsoft.com/kb/900969/en-us symptoms are not the same, but perhaps similar enough. My problem does not appear to be the same as the one described in kb 900969. The KB article 900969 descibes a problem when clicking ...

restore the title bar in excel? #2
the title bar has gone missing in one excel file. there does not seem to be an option in the *view, tool bar, customize* feature. how do i restore the title bar? thanks dennis sorry for the second posting "twodogsdennis" wrote: > the title bar has gone missing in one excel file. there does not seem to be > an option in the *view, tool bar, customize* feature. how do i restore the > title bar? > thanks > dennis ...

How do I use a single cell value to chart a horizontal line in Exc
Background: I am making a chart where monthly expenses are represented by vertical bars and the monthly budget is a constant, for the entire year, which is represented by a horizontal line. If a vertical bar for a particular month rises above the horizontal budget line then I have exceeded my budget for that month. What I can do: I can create this chart if I use a monthly budget row where each cell in the row has the same value. What I want to do: To keep my spreadsheet manageable, I want to have the monthly budget specified by a single cell, rather than an entire row, because it is a...

Why doesn't "Replace" function find value I know exists?
Using Excel 2003, I normally have no problem with the "REPLACE" function, i.e. replacing year 2009 with 2010; however when I try to replace a value, i.e. 1000.00 with 2000.00, even though I know 1000.00 is entered many times in the worksheet, it cannot find it. I use the Format option and select "Use Format From Cell" and it still does not work. What am I doing wrong? Thanks. Hi, are you importing the values?, sometimes there are blank spaces that you cannot see, assuming numbers are in column B in another column enter =trim(B1) copy formula down and t...

Min value excluding 0 and another criteria
Hi I am trying to exclude zero plus add another criteria in calculating the min value of a column. I want the other criteria to be the text value of a different column. For instance column A has dog, cat, fish, etc (up to 16 category types) and column B has age. I am trying to find min age for each category and not include zero. I know this will find the min age of everything =MIN(IF($G$5:$G$40>0, $G$5:$G$40)) but i am at a lost for how to incoporate the other criteria any suggestions would greatly be appreciated On Apr 24, 10:41=A0pm, calebmich...@gmail.com wrote: > Hi > >...

Eliminate #Value! in fields
Hi, I have a weekly report for all of 2004. There are two main columns. The first is weekly sales and the second is forecasted sales. I have a formula in a third column that divides weekly sales by forecasted sales. For future weeks, the numerator which is weekly sales is blank. The demoniator contains a value for all 52 weeks. My values that appear in the third column with the formula has a value of #VALUE!. Once the actual sales are filled in, the the #VALUE! dissapears and a percentage appears. How do I make is so the #VALUE! does not appear at all and the formula column is ...

GDI+ Image sizing
In my view's OnDraw handler I have the following code to display my images. It works but the images need to be scaled to fit inside the view window. How is this done? // ------- CPicViewDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); CRect cr; GetClientRect(&cr); Graphics graphics(pDC->m_hDC); BSTR bstrFile = pDoc->GetPathName().AllocSysString(); Image image( bstrFile ); ::SysFreeString( bstrFile ); int iWidth = image.GetWidth(); int iHeight = image.GetHeight(); Rect rect( cr.left+10, cr.top+10, cr.Width(), cr.Height() ); grap...

page numbers #14
I am writing a series of booklets for use in eastern Europe. I am in the process of setting up a template but running into some complications (first time I have used any version of Publisher; version 2007 is version I'm using). It is in metric (105 x 148.5cm), consists of 32 pages and after the first page, facing pages (last page is also single to keep publication with 4 page set up). I want the first and last pages of the template to be blank; the second and third pages in the template just to contain at bottom "TEI © 2008" but starting at page 4 (with facing page 5)...

center text on page
I need to do something simple: have text appear in the center of the page (vertically) for one page in the document. Word's help has been remarkably unhelpful. The directions are: Click the object that you want to align. On the View menu, click Formatting Palette. Under Size, Rotation, and Ordering, click Align , click Align to Page. Click Align again, and then click the alignment that you want. However, (1) Under Formatting Palette, there is no heading "Size, Rotation, and Ordering" and (2) Under "Alignment and Spacing", I can choose horizontal, line spacing, or...

e-mail history increases the font size
I have an issue where certain e-mails will continually increase the font size of e-mail as the message gets sent back and forth. I have a word document with the text in it if anyone would like to see. Basically, with each reply, the history part of the message increases in size. By the time you bounce a message back and forth a few times, the font at the bottom is HUGE. Has anyone seen this before? Outlook 2002/Exchange system Thanks, Rich ...