Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created January 5, 2020 21:43
Show Gist options
  • Save lighth7015/320b0d3960f594748649bcbd3e0568fd to your computer and use it in GitHub Desktop.
Save lighth7015/320b0d3960f594748649bcbd3e0568fd to your computer and use it in GitHub Desktop.
SkinnedBtn
import "ecere"
import "ecere.gui"
class SkinnedBtn: Button {
void OnRedraw(Surface surface) {
int tw = 0, th = 0;
int ot = 0, ol = 0,
ob = size.h, or = size.w;
// Button::OnRedraw(surface);
surface.TextFont(this.fontObject);
surface.SetBackground(Color { 0, 107, 173 });
surface.Area(position.x, position.y, size.w, size.h);
if (this.text) {
surface.TextExtent(this.text, strlen(this.text),&tw, &th);
}
switch (buttonState) {
default:
case ecere::gui::controls::ButtonState::up:
ot --;
ol --;
ob --;
or --;
break;
case ecere::gui::controls::ButtonState::down:
break;
}
//surface.Rectangle(ot, ol, or, ob);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment