The attached project demonstrates how to create a simple custom control in Pelles C (simple as in not drawing everything from scratch). I wanted an editable list view and threw in some other customizations as a bonus. The header file contains macroes for each custom message that demonstrate the usage of the messages. Also many ListView related messages can be used with this control (all list view messages are forwarded to the list view component.)
That is really useful 8)
Thanks for sharing ;D
I get an error when compiling
---------------
DataGridView.c(1354): error #3114: [asm] Invalid combination of opcode and operands.
*** Error code: 1 ***
---------------
Any ideas on how to correct that?
edit:
OOPS, I didn't have the latest PellesC.
Anyway, nice contribution, thanks.
John
Stephan,
Glad you find this useful.
John,
Surprisingly, most of the time I spent on this was getting the scrolling to work right. I ended up having to store scroll info in my struct instead of using GetScrollInfo() it seems that once the scroll bars disappear the control's scroll info is cleared.
DMac
Quote from: DMac on October 25, 2007, 06:28:47 PM
John,
Surprisingly, most of the time I spent on this was getting the scrolling to work right. I ended up having to store scroll info in my struct instead of using GetScrollInfo() it seems that once the scroll bars disappear the control's scroll info is cleared.
DMac
I've used GetScrollInfo a few times but I don't know what you mean by 'scroll bars disappear'. However you seem to have managed it fine.
John
QuoteI've used GetScrollInfo a few times but I don't know what you mean by 'scroll bars disappear'.
Here's the scenario,
1. User scrolls the control to the last collumn.
2. User then chooses to stretch window to see all grid.
3. Scroll bars go away because the window size is greater than the page size.
Unfortunately the window might not be aligned with the Grid.
At this point I want to pan the view so that the top left of the grid is the top left of the control but unfortunately GetScrollInfo() returns an empty structure.
The solution was to store the scroll info independent of the Control's window.
Ok I see now. I guess the best way is to scroll the window as the user is stretching so that when the scroll bar finally disappears the window is in the right place.
Btw, I had to adjust MainDlg_OnSize() as the buttons were encroaching on the grid, I use 120 DPI screen setting.
John