Waitrud Weber’s blog

things and reminders for memories

3d: WindowsAPI: Windows-make: How do we face memories problem:

We could call kickSomethingEvent as we are confident of event calling like button action:

---

---
.\wButton.cpp  Mon Jun 01 15:45:02 2020

210 ://
211 ://( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
212 ://
213 :// added 20190118
214 ://
215 ://
216 :void wButton::kickEventDisplayThreeD( HDC hdc, UINT uMsg, WPARAM wParam, LPARAM lParam ) {
217 :	RECT rect_001;
218 :
219 :	int xx = this->x + 300;
220 :	int yy = this->y + 300;
221 :	int right = xx + this->width;
222 :	int bottom = yy + this->height;
223 :	SetRect(&rect_001, xx, yy, right, bottom);
224 :
225 :	Rectangle(hdc, rect_001.left, rect_001.top, rect_001.right, rect_001.bottom);
226 :
227 :	SetTextColor(hdc, RGB(0, 0, 0));
228 :	// kick event
229 :	DrawTextA(hdc, this->button_name, array_count(this->button_name), &rect_001, DT_TOP);
230 :
231 :	this->kick_event->kickSomethingEvent();
232 :}
233 :
---
.\wKickEventDisplayThreeD.cpp  Mon Jun 01 15:48:24 2020

  1 :#include 
  2 :#include 
  3 :
  4 :#include "wKickEvent.h"
  5 :#include "wKickEventDisplayThreeD.h"
  6 ://#include "wKickEventDisplayThreeD.h"
  7 ://#include "wKickEventDisplayThreeD.h"
  8 :
  9 :void wKickEventDisplayThreeD::setPid ( int id ) {
 10 :	this->pid =id;
 11 :}
 12 :
 13 :// : https://stackoverflow.com/questions/357307/how-to-call-a-parent-class-function-from-derived-class-function
 14 ://
 15 :void wKickEventDisplayThreeD::kickSomethingEvent()
 16 :{
 17 :	// Parent as super: call parent's same function:
 18 :	wKickEvent::kickSomethingEvent();
 19 :
 20 :	return;
 21 :}
 22 :
---