else surface->drawText(text, x, y, colour.rgba());
}
+void Boxx::drawText(const char* text, int x, int y, int width, Colour& colour)
+{
+ if (parent) parent->drawText(text, area.x + x, area.y + y, width, colour);
+ else surface->drawText(text, x, y, width, colour.rgba());
+}
+
void Boxx::drawTextRJ(const char* text, int x, int y, Colour& colour)
{
if (parent) parent->drawTextRJ(text, area.x + x, area.y + y, colour);
void rectangle(Region& region, Colour& colour);
void drawText(const char* text, int x, int y, Colour& colour);
+ void drawText(const char* text, int x, int y, int width, Colour& colour);
void drawTextRJ(const char* text, int x, int y, Colour& colour);
void drawTextCentre(const char* text, int x, int y, Colour& colour);
void drawPixel(UINT x, UINT y, Colour& colour);
}
int Surface::drawText(const char* text, int x, int y, ULONG rgba)
+{
+ return drawText(text, x, y, 2000, rgba);
+}
+
+int Surface::drawText(const char* text, int x, int y, int width, ULONG rgba)
{
int h, n, i;
int Y, X, cx;
int w = font->width[c];
int pixels = 0;
- for (X=0; X<w; X++)
+ for (X=0; (X<w) && (X + cx < width); X++)
{
for (Y=0; Y<h; Y++)
{
int getCharWidth(char c);
int drawText(const char* text, int x, int y, ULONG rgba);
+ int drawText(const char* text, int x, int y, int width, ULONG rgba);
int drawTextRJ(const char* text, int x, int y, ULONG rgba);
int drawTextCentre(const char* text, int x, int y, ULONG rgba);
clocksRegion.h = surface->getFontHeight();
- barBlue.set(0, 0, 150, 150);
+// barBlue.set(0, 0, 150, 150);
+ barBlue.set(0, 0, 0, 128);
barShowing = false;
barGenHold = false;
if (i == selectedOption && showseloption)
{
rectangle(0, ypos, area.w, fontHeight, Colour::SELECTHIGHLIGHT);
- drawOptionLine(options[i].text, 5, ypos, Colour::DARKTEXT);
+ drawOptionLine(options[i].text, 5, ypos, area.w - 5, Colour::DARKTEXT);
}
else
{
- drawOptionLine(options[i].text, 5, ypos, Colour::LIGHTTEXT);
+ drawOptionLine(options[i].text, 5, ypos, area.w - 5, Colour::LIGHTTEXT);
}
ypos += ySeperation;
}
columns[numColumns++] = x;
}
-void WSelectList::drawOptionLine(char* text, int xpos, int ypos, Colour& colour)
+void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, Colour& colour)
{
if (!numColumns)
{
- drawText(text, xpos, ypos, colour);
+ drawText(text, xpos, ypos, width, colour);
}
else
{
pointer = strtok(buffer, "\t");
while(pointer)
{
- drawText(pointer, xpos + columns[currentColumn], ypos, colour);
+ drawText(pointer, xpos + columns[currentColumn], ypos, width - columns[currentColumn], colour);
currentColumn++;
if (currentColumn == 10) return;
pointer = strtok(NULL, "\t");
virtual bool mouseLBDOWN(int x, int y);
private:
- void drawOptionLine(char* text, int xpos, int ypos, Colour& colour);
+ void drawOptionLine(char* text, int xpos, int ypos, int width, Colour& colour);
int getMouseLine(int x, int y);
vector<wsloption> options;