ScrollView help
-
I have a scroll view implemented in my app and have a question. Currently my scroll bars go from the top of the screen to the bottom of the screen. What I would like to do is have a spot at the top of the screen to be say a title section. I need to have this section not be repainted everytime a WM_PAINT message is sent, only the below it needs to be repainted. So the question is, how do I create such a non-client area inside this ScrollView? Thanks, -Eric
-
I have a scroll view implemented in my app and have a question. Currently my scroll bars go from the top of the screen to the bottom of the screen. What I would like to do is have a spot at the top of the screen to be say a title section. I need to have this section not be repainted everytime a WM_PAINT message is sent, only the below it needs to be repainted. So the question is, how do I create such a non-client area inside this ScrollView? Thanks, -Eric
My best bet would be to create a toolbar-like control where you only write the title. The toolbar will be a child of the frame window (sibling of the view), so you wouldn't have to change a single line of code in your view class. Let me prepare a simple example to post. Regards, João Paulo
-
I have a scroll view implemented in my app and have a question. Currently my scroll bars go from the top of the screen to the bottom of the screen. What I would like to do is have a spot at the top of the screen to be say a title section. I need to have this section not be repainted everytime a WM_PAINT message is sent, only the below it needs to be repainted. So the question is, how do I create such a non-client area inside this ScrollView? Thanks, -Eric
I have already sent the QA to www.pocketpcdn.com to be published. In any case, would you like to receive an email from me with the sample code? Regards, João Paulo
-
I have already sent the QA to www.pocketpcdn.com to be published. In any case, would you like to receive an email from me with the sample code? Regards, João Paulo
João, Thanks for the code sample. After looking at it a bit this morning I have a few additional questions. 1. In my app I have multiple views defined. Only one of the views is currently a CScrollView class. I have only included the CeTitelBar object inside this one class, but yet it appears as a title above all of the views in my app. How can I get it to only show up in the once class that it is defined in? When I created the CeTitleBar object I used GetParent(), should I have used something else? 2. I need to have more control over the placement of the text inside the title and I need to be able to change the size of the title bar. I think I can see where to change the code to make the changes to the height of the bar, but I need to have multiple lines inside the title bar, some with Bold text some with underlined text etc. 3. Last I would like the title bar to be the same color as my view. This may relate to the second question above. I am going to continue to play around with it this morning, but any help is appreciated. Again thanks for the initial help! -Eric
-
João, Thanks for the code sample. After looking at it a bit this morning I have a few additional questions. 1. In my app I have multiple views defined. Only one of the views is currently a CScrollView class. I have only included the CeTitelBar object inside this one class, but yet it appears as a title above all of the views in my app. How can I get it to only show up in the once class that it is defined in? When I created the CeTitleBar object I used GetParent(), should I have used something else? 2. I need to have more control over the placement of the text inside the title and I need to be able to change the size of the title bar. I think I can see where to change the code to make the changes to the height of the bar, but I need to have multiple lines inside the title bar, some with Bold text some with underlined text etc. 3. Last I would like the title bar to be the same color as my view. This may relate to the second question above. I am going to continue to play around with it this morning, but any help is appreciated. Again thanks for the initial help! -Eric
VanHlebar wrote: How can I get it to only show up in the once class that it is defined in? When the view is destroyed or hidden, you have to destroy / hide the title bar. VanHlebar wrote: When I created the CeTitleBar object I used GetParent(), should I have used something else? No. You are using the correct parent (the frame window). Remember that the title bar is a toolbar and toolbar have to be children of the main frame. VanHlebar wrote: I need to have more control over the placement of the text inside the title and I need to be able to change the size of the title bar. This class serves a very simple purpose: shows a single line of text. I'm sure you can create your own title bar class by redefining the drawing code and height (you may use
m_nHeight
). You have the basic mechanisms. Now, have some fun experimenting with it! ;) Regards, João Paulo -
VanHlebar wrote: How can I get it to only show up in the once class that it is defined in? When the view is destroyed or hidden, you have to destroy / hide the title bar. VanHlebar wrote: When I created the CeTitleBar object I used GetParent(), should I have used something else? No. You are using the correct parent (the frame window). Remember that the title bar is a toolbar and toolbar have to be children of the main frame. VanHlebar wrote: I need to have more control over the placement of the text inside the title and I need to be able to change the size of the title bar. This class serves a very simple purpose: shows a single line of text. I'm sure you can create your own title bar class by redefining the drawing code and height (you may use
m_nHeight
). You have the basic mechanisms. Now, have some fun experimenting with it! ;) Regards, João PauloJoão, Thanks again for all the help. I added a few features to your base class to allow the users to change the height, text color and background color of the title bar on the fly. If you want to see those changes I can post them or email them to you. I ended up having to play around with the OnPaint() to get my multiple lines of text into the Title Bar. It works for my application, but would not be very handy for general use. If I figure out a way to fix it I will post it here. I am also looking into a way to allow the user to change the Font used on the fly also. Thanks again, -Eric
-
João, Thanks again for all the help. I added a few features to your base class to allow the users to change the height, text color and background color of the title bar on the fly. If you want to see those changes I can post them or email them to you. I ended up having to play around with the OnPaint() to get my multiple lines of text into the Title Bar. It works for my application, but would not be very handy for general use. If I figure out a way to fix it I will post it here. I am also looking into a way to allow the user to change the Font used on the fly also. Thanks again, -Eric
VanHlebar wrote: I am also looking into a way to allow the user to change the Font used on the fly also. If you want a font chooser, check this: A font chooser dialog for the Pocket PC[^] Regards, João Paulo
-
I have a scroll view implemented in my app and have a question. Currently my scroll bars go from the top of the screen to the bottom of the screen. What I would like to do is have a spot at the top of the screen to be say a title section. I need to have this section not be repainted everytime a WM_PAINT message is sent, only the below it needs to be repainted. So the question is, how do I create such a non-client area inside this ScrollView? Thanks, -Eric
Check the article here: QA: How do I add a title to a view?[^] Regards, João Paulo