1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 05:48:01 +01:00

added scrolled notifcation to scroller

added GetVisibleRect function to scrollview
This commit is contained in:
kojima
2000-10-11 16:21:50 +00:00
parent bdaacb6daa
commit 275a2a3782
5 changed files with 35 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ changes since wmaker 0.62.1:
subdirectories
- removed WMArrayBag and reorganized WMTreeBag to be WMBag.
- added WMArray class.
- added WMSetWindowUserPosition().
- added WMSetWindowUserPosition()
- added WMGetListSelectedItems()
- added WMSetListAllowMultipleSelection(), WMListAllowsMultipleSelection().
- added WMSetListAllowEmptySelection(), WMListAllowsEmptySelection().
@@ -40,6 +40,8 @@ changes since wmaker 0.62.1:
- Added WMGetBrowserPaths() to retrieve the paths for browsers that allow
multiple selections.
- WMDestroyWidget() now calls WMUnmapWidget() first
- added WMScrollerDidScrollNotification to scroller
- added WMGetScrollViewVisibleRect()
changes since wmaker 0.62.0:

View File

@@ -1219,6 +1219,7 @@ main(int argc, char **argv)
testScrollView(scr);
#if 0
testButton(scr);
testFrame(scr);

View File

@@ -1068,6 +1068,8 @@ void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
void WMSetScrollerArrowsPosition(WMScroller *sPtr,
WMScrollArrowPosition position);
extern char *WMScrollerDidScrollNotification;
/* ....................................................................... */
WMList *WMCreateList(WMWidget *parent);
@@ -1384,6 +1386,8 @@ void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);

View File

@@ -14,6 +14,10 @@
#define AUTOSCROLL_DELAY 40
char *WMScrollerDidScrollNotification = "WMScrollerDidScrollNotification";
typedef struct W_Scroller {
W_Class widgetClass;
W_View *view;
@@ -672,6 +676,8 @@ handlePush(Scroller *sPtr, int pushX, int pushY, int alternate)
if (doAction && sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr, NULL);
}
}
@@ -751,6 +757,8 @@ handleMotion(Scroller *sPtr, int mouseX, int mouseY)
WMSetScrollerParameters(sPtr, newFloatValue, sPtr->knobProportion);
if (sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr,
NULL);
}
} else {
int part;
@@ -780,6 +788,7 @@ autoScroll(void *clientData)
if (sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr, NULL);
}
sPtr->timerID= WMAddTimerHandler(AUTOSCROLL_DELAY, autoScroll, clientData);
}
@@ -825,6 +834,8 @@ handleActionEvents(XEvent *event, void *data)
}
if (sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr,
NULL);
}
}
else if (event->xbutton.button==WINGsConfiguration.mouseWheelDown) {
@@ -837,6 +848,8 @@ handleActionEvents(XEvent *event, void *data)
}
if (sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr,
NULL);
}
} else {
handlePush(sPtr, event->xbutton.x, event->xbutton.y,
@@ -855,6 +868,8 @@ handleActionEvents(XEvent *event, void *data)
if (sPtr->flags.draggingKnob) {
if (sPtr->action) {
(*sPtr->action)(sPtr, sPtr->clientData);
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr,
NULL);
}
}
if (sPtr->timerID) {

View File

@@ -236,6 +236,17 @@ WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount)
}
WMRect
WMGetScrollViewVisibleRect(WMScrollView *sPtr)
{
WMRect rect;
rect.pos = sPtr->contentView->pos;
rect.size = sPtr->viewport->size;
return rect;
}
static void
doScrolling(WMWidget *self, void *data)
{
@@ -522,7 +533,7 @@ handleEvents(XEvent *event, void *data)
static void
destroyScrollView(ScrollView *sPtr)
{
puts("destroyScrollView not implemented");
wfree(sPtr);
}