GeUserArea drawing breaks when sliding

On 24/08/2015 at 03:10, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   15+ 
Platform:   Windows  ;   
Language(s) :     C++  ;

when there is a slide "vertical or horizontal" , the drawing breaks, I need to know when the slide happens "may be via a function or a message".

On 25/08/2015 at 03:00, xxxxxxxx wrote:

Hi Mohamed,

can you please give some more details? What do you mean by sliding? Moving the dialog around? Resizing the dialog?

On 25/08/2015 at 04:14, xxxxxxxx wrote:

in AM or MM, when you have many descriptions that can be larger than the UI "many pages" , so the sliders appear to scroll the UI.

On 25/08/2015 at 04:33, xxxxxxxx wrote:

Ok, got it. But I have no idea.
I guess, you correctly overrode GetMinSize() and Sized() member functions in GeUserArea?
I checked in my own plugin's code and I'm not aware, I'm doing anything special for this situation. The scroll bars appear as soon as available space is below minimum size. But you don't have to care for this at all. You simply continue drawing with the size given in Sized().
You will have to post some relevant code (probably GetMinSize(), Sized() and DrawMsg()) to get further.

On 25/08/2015 at 06:37, xxxxxxxx wrote:

I override GetMinSize(), tried overriding Sized(), nothing changed.
here is an image, after doing a drag with the horizontal slider.

On 25/08/2015 at 06:41, xxxxxxxx wrote:

Looks like a redraw is missing.
Unfortunately you didn't post any code.
There is also an example, I guess you know it already. Perhaps you can explain, what you are doing differently.

On 25/08/2015 at 07:07, xxxxxxxx wrote:

the redraw needs to be done for the AM or MM, not for the GeUserArea "so I can open the user area in 5 different places, and it will only glitch in the place where it slides" , so how to redraw the AM or MM? "the parent"

On 25/08/2015 at 07:31, xxxxxxxx wrote:

Please have a look at the example I linked to. It does not seem to have such problems. Nor does my own plugin have such a problem. So either you post some code for me to work with or you check for differences to the example yourself.

On 25/08/2015 at 07:46, xxxxxxxx wrote:

void SNodeUserArea::DrawMsg(Int32 x1, Int32 y1, Int32 x2, Int32 y2, const BaseContainer& msg)
	//Int32 gridMax = 10000;
	//Int32 gridHalfSub = 100;
	AutoAlloc<GeClipMap> cm;
	if(!cm) return;	
	//Int32 w, h;
	//GetMinSize(w, h);
	cm->Init(x2 - x1, y2 - y1, 32);
	// draw background
	cm->SetDrawMode(GE_CM_DRAWMODE_COPY, 255);
	cm->SetColor(110, 110, 110, 255);
	cm->FillRect(x1, y1, x2, y2);
	//draw grids
	drawGrid(x1, y1, x2 - x1, y2 - y1, *cm);
	//draw wires
		drawSWireT(tempWire, *cm);
	for(int i = 0; i < wires.size(); ++i)
		drawSWire(wires[i], *cm);
	cm->SetDrawMode(GE_CM_DRAWMODE_BLEND, 180);
	//draw nodes
	for(int i = 0; i < nodes.size(); ++i)
		if(nodes[i].isSelected() == SEVENPHOTONS_NODE_NULL)
			drawSNode(nodes[i], *cm);
	for(int i = 0; i < nodes.size(); ++i)
		if(nodes[i].isSelected() != SEVENPHOTONS_NODE_NULL)
			drawSNode(nodes[i], *cm);
	cm->SetDrawMode(GE_CM_DRAWMODE_COPY, 255);
		cm->SetColor(0, 0, 0, 255);
		Int32 xMin = Min(rsStart.x , rsEnd.x);
		Int32 xMax = Max(rsStart.x , rsEnd.x);
		Int32 yMin = Min(rsStart.y , rsEnd.y);
		Int32 yMax = Max(rsStart.y , rsEnd.y);
		cm->Rect(xMin, yMin,xMax, yMax);
	BaseBitmap *mBitmap = cm->GetBitmap();	
	Int32 mw = cm->GetBw();
	Int32 mh = cm->GetBh();