Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

28 rader
888 B

  1. #include "containers.h"
  2. Scrollbar_Container* Scrollbar_Container_Constructor(int x, int y, int width, int height, int blockheight) {
  3. Scrollbar_Container* sb = malloc(sizeof(Scrollbar_Container));
  4. sb->super.dimensions.x = x;
  5. sb->super.dimensions.y = y;
  6. sb->super.dimensions.w = width;
  7. sb->super.dimensions.h = height;
  8. sb->super.isdown = false;
  9. sb->super.clickFunc = NULL;
  10. sb->super.releaseFunc = NULL;
  11. sb->super.drawFunc = NULL;
  12. sb->bar.super.dimensions.x = x;
  13. sb->bar.super.dimensions.y = y;
  14. sb->bar.super.dimensions.w = width;
  15. sb->bar.super.dimensions.h = blockheight;
  16. sb->bar.super.isdown = false;
  17. sb->bar.super.clickFunc = Dragable_ClickFunc;
  18. sb->bar.super.releaseFunc = Dragable_ReleaseFunc;
  19. sb->bar.super.drawFunc = NULL;
  20. sb->bar.boundaries = &(sb->super.dimensions);
  21. sb->bar.coordinatesToDrag = &(sb->bar.super.dimensions);
  22. return sb;
  23. }