diff --git a/ruamoko/qwaq/ui/group.r b/ruamoko/qwaq/ui/group.r index adaa21958..8bbca6d9b 100644 --- a/ruamoko/qwaq/ui/group.r +++ b/ruamoko/qwaq/ui/group.r @@ -38,6 +38,8 @@ -setContext: (id) context { self.context = context; + [views makeObjectsPerformSelector:@selector(setContext:) + withObject:context]; return self; } diff --git a/ruamoko/qwaq/ui/scrollbar.h b/ruamoko/qwaq/ui/scrollbar.h index 7f710a25b..08d8ea6d6 100644 --- a/ruamoko/qwaq/ui/scrollbar.h +++ b/ruamoko/qwaq/ui/scrollbar.h @@ -4,6 +4,7 @@ #include "ui/view.h" @class Button; +@class DrawBuffer; @class Group; @class ListenerGroup; @@ -12,6 +13,7 @@ int vertical; int bgchar; Point mouseStart; + DrawBuffer *buffer; Button *backButton; Button *forwardButton; Button *thumbTab; diff --git a/ruamoko/qwaq/ui/scrollbar.r b/ruamoko/qwaq/ui/scrollbar.r index 78b8ab631..86b2a6071 100644 --- a/ruamoko/qwaq/ui/scrollbar.r +++ b/ruamoko/qwaq/ui/scrollbar.r @@ -10,7 +10,8 @@ if (!(self = [super initWithRect:rect])) { return nil; } - objects = [[Group withContext:textContext owner:self] retain]; + buffer = [[DrawBuffer buffer:size] retain]; + objects = [[Group withContext:buffer owner:self] retain]; onScroll = [[ListenerGroup listener] retain]; vertical = xlen == 1; DrawBuffer *icons[3] = { @@ -23,14 +24,14 @@ SEL thumbSel; growMode = gfGrowAll; if (vertical) { - [icons[0]addch:acs_char (ACS_UARROW)]; - [icons[1]addch:acs_char (ACS_DARROW)]; + [icons[0] addch:acs_char (ACS_UARROW)]; + [icons[1] addch:acs_char (ACS_DARROW)]; thumbPos = {0, 1}; thumbSel = @selector(verticalSlide); growMode &= ~gfGrowLoY; } else { - [icons[0]addch:acs_char (ACS_LARROW)]; - [icons[1]addch:acs_char (ACS_RARROW)]; + [icons[0] addch:acs_char (ACS_LARROW)]; + [icons[1] addch:acs_char (ACS_RARROW)]; thumbPos = {1, 0}; thumbSel = @selector(horizontalSlide); growMode &= ~gfGrowLoX; @@ -55,6 +56,13 @@ return self; } +-(void)dealloc +{ + [objects release]; + [buffer release]; + [onScroll release]; +} + +(ScrollBar *)horizontal:(unsigned)len at:(Point)pos { if (len == 1) { @@ -78,6 +86,7 @@ -draw { + syncprintf("scrollbar start"); if (vertical) { [self mvvline:pos, bgchar, ylen]; } else { @@ -85,6 +94,8 @@ } [super draw]; [objects draw]; + [textContext blitFromBuffer:buffer to:pos from:[buffer rect]]; + syncprintf("scrollbar end"); return self; }