Advertisement
WeltEnSTurm

Untitled

Mar 16th, 2011
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1.  
  2. //  ##### main.cpp on Mar 13, 2011
  3. //  ##### Used for X11 01
  4. //  ##### Created by WeltEnSTurm
  5.  
  6. #include "include/window.hpp"
  7.  
  8. class DerivedWindow : public wm::window {
  9. public:
  10.     DerivedWindow(int x, int y, int w, int h, std::string name) : window(x,y,w,h,name){}
  11.     void OnMouseButton(MOUSE_BUTTON button, bool state){
  12.         std::cout<<"Mouse Button "<<button<<" in window number "<<mIdentifier<<" has been "<<(state?"pressed":"released")<<"!"<<std::endl;
  13.     }
  14.     void OnClose(){
  15.         Hide();
  16.     }
  17.     void KeyboardPress(KEYBOARD_KEY key, bool pressed){
  18.         std::cout<<"Key "<<(char)key<<" ("<<key<<") has been "<<(pressed?"pressed":"released")<<"!"<<std::endl;
  19.     }
  20. };
  21.  
  22. int main(int argc, char ** argv){
  23.     DerivedWindow Window(50,50,200,200,"The Cake Is A Lie!");
  24.     DerivedWindow Window2(50,300,250,250,"YOU ARE A LIE!");
  25.     return wm::Main();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement