Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

  1. //
  2. // mxToolKit (c) 1999 by Mete Ciragan
  3. //
  4. // file: mxButton.cpp
  5. // implementation: Win32 API
  6. // last modified: Apr 12 1999, Mete Ciragan
  7. // copyright: The programs and associated files contained in this
  8. // distribution were developed by Mete Ciragan. The programs
  9. // are not in the public domain, but they are freely
  10. // distributable without licensing fees. These programs are
  11. // provided without guarantee or warrantee expressed or
  12. // implied.
  13. //
  14. #include "mxtk/mxButton.h"
  15. #include <windows.h>
  16. class mxButton_i
  17. {
  18. public:
  19. int dummy;
  20. };
  21. mxButton::mxButton (mxWindow *parent, int x, int y, int w, int h, const char *label, int id)
  22. : mxWidget (parent, x, y, w, h, label)
  23. {
  24. if (!parent)
  25. return;
  26. DWORD dwStyle = WS_VISIBLE | WS_CHILD;
  27. HWND hwndParent = (HWND) ((mxWidget *) parent)->getHandle ();
  28. void *handle = (void *) CreateWindowEx (0, "BUTTON", label, dwStyle,
  29. x, y, w, h, hwndParent,
  30. (HMENU) id, (HINSTANCE) GetModuleHandle (NULL), NULL);
  31. SendMessage ((HWND) handle, WM_SETFONT, (WPARAM) (HFONT) GetStockObject (ANSI_VAR_FONT), MAKELPARAM (TRUE, 0));
  32. SetWindowLong ((HWND) handle, GWL_USERDATA, (LONG) this);
  33. setType (MX_BUTTON);
  34. setHandle (handle);
  35. setParent (parent);
  36. setId (id);
  37. }
  38. mxButton::~mxButton ()
  39. {
  40. }