Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef SEARCHEDIT_ZDEFIONIOWANY
  2. #define SEARCHEDIT_ZDEFIONIOWANY 1
  3.  
  4. #include <windows.h>
  5. #include <iostream>
  6. #include <conio.h>
  7. #include <cmath>
  8. #include <stdio.h>
  9. #include <string>
  10. #include <vector>
  11. #include <process.h>
  12. #include <map>
  13. #include <algorithm>
  14. #include "wh_operacje_na_uchwytach.h"
  15. #include "wh_grafika.h"
  16. #include "wh_ListScroll.h"
  17.  
  18. using namespace std;
  19.  
  20. #define SEID_RICHEDIT       1
  21. #define SEID_LISTSCROLL     2
  22.  
  23. #define SEID_VK_RETURN       2
  24. #define SEID_VK_ESCAPE       4
  25. #define SEID_VK_UP           8
  26. #define SEID_VK_DOWN         16
  27. #define SEID_VK_ANYKEY       32
  28.  
  29. #define SE_WAITTIME         2
  30. #define SE_LSCTIMER         1
  31.  
  32. typedef int( * GETSIZE_PROC_TYPE)(void);
  33. typedef void( * GETSTRING_PROC_TYPE)(int index, string &tekst, int &liczba);
  34.  
  35. BOOL RejestrujSearchEdit( HINSTANCE hInst );
  36. LRESULT CALLBACK SearchEditProc( HWND hwnd, UINT mesg, WPARAM wParam, LPARAM lParam );
  37. LRESULT CALLBACK SubClassRichEditProc( HWND hwnd, UINT mesg, WPARAM wParam, LPARAM lParam );
  38.  
  39. struct sSEARCHEDIT{
  40.     GETSIZE_PROC_TYPE myf_GetSize;
  41.     GETSTRING_PROC_TYPE myf_GetString;
  42.  
  43.     sVSCROLLBAR myVScrollBar;
  44.     LISTSCROLLDRAW myListScrollDraw;
  45.     COLORREF ColBackroundEdit;
  46. };
  47. class SEARCHEDIT{
  48.     public:
  49.         SEARCHEDIT(sSEARCHEDIT *wsk);
  50.         ~SEARCHEDIT();
  51.  
  52.         bool Create(int x, int y, int Width, int Height, int ID, HWND hParent);
  53.         bool Destroy();
  54.         bool Execute(UINT message, WPARAM wParam, LPARAM lParam);
  55.  
  56.         HWND hWindow();
  57.         void ActualizeWindowInfo(WINDOWINFO *wsk);
  58.         int GetX();
  59.         int GetY();
  60.         int GetWidth();
  61.         int GetHeight();
  62.         void SetPos(POINT newPos);
  63.         void SetSize(POINT newSize);
  64.         int GetID();
  65.     private:
  66.         HWND hwnd;
  67.         HINSTANCE hInstance;
  68.         WINDOWINFO WindowInfo;
  69.  
  70.         HWND hRichEdit;
  71.         LISTSCROLL *hListScroll;
  72.         map<string, int> Data;
  73.         struct sSEARCHEDIT sSearchStruct;
  74.         POINT StartSize;
  75.  
  76.         void f_Resize();
  77.         void f_Update();
  78.  
  79.         void f_LSB_FillMap();
  80.         void f_LSB_CreateLSB();
  81.         void f_LSB_DestroyLSB();
  82.  
  83.         void Proc_WM_PAINT(WPARAM wParam, LPARAM lParam);
  84.         void Proc_WM_DESTROY(WPARAM wParam, LPARAM lParam);
  85.         void Proc_WM_COMMAND(WPARAM wParam, LPARAM lParam);
  86.         void Proc_WM_MOUSEMOVE(WPARAM wParam, LPARAM lParam);
  87.         void Proc_WM_LBUTTONDOWN(WPARAM wParam, LPARAM lParam);
  88.  
  89. };
  90. struct sSUBPROCSTRUCT{
  91.     WNDPROC ParentProc;
  92.     WNDPROC oldProc;
  93.     SEARCHEDIT *wsk;
  94. };
  95. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement