Ejemplo n.º 1
0
LRESULT CALLBACK cg_container_win32_proc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	widget_t *w;
	container_widget_t *sw;
	native_container_widget_t *nw;
	//bounds_t b;
	
	w = cg_find_by_native( hWnd );
	
	if ( w == 0 )
		return DefWindowProc( hWnd, uMsg, wParam, lParam );
	
	sw = (container_widget_t *)w;
	nw = (native_container_widget_t *)w->ndata;
	
	switch ( uMsg )
	{
		case WM_MOVE:
			widget_set_position( w, LOWORD(lParam), HIWORD(lParam), 1 );
			break;
		case WM_SIZE:
			widget_set_size( w, LOWORD(lParam), HIWORD(lParam), 1 );
			widget_set_content_size( w, LOWORD(lParam), HIWORD(lParam), 1 );
			widget_resized_handle( OBJECT(w), 0 );
			break;
		case WM_COMMAND:
		case WM_NOTIFY:
			return cg_win32_proc( hWnd, uMsg, wParam, lParam );
	}
	
	return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
Ejemplo n.º 2
0
Archivo: gtk.c Proyecto: Airr/Claro
/* resize handler */
gint cgraphics_resized_handler( GtkWidget *widget, GdkEventConfigure *event, widget_t *w )
{
	widget_set_size( OBJECT(w), event->width, event->height, 1 );
	widget_set_content_size( OBJECT(w), event->width, event->height, 1 );
	widget_set_position( OBJECT(w), event->x, event->y, 1 );
	
	return 0;
}
Ejemplo n.º 3
0
Archivo: gtk.c Proyecto: Airr/Claro
gint cgraphics_resized2_handler( GtkWidget *widget, GtkAllocation *event, widget_t *w )
{
	if ( !strcmp( w->object.type, "claro.graphics.widgets.container" ) ||
		 !strcmp( w->object.type, "claro.graphics.widgets.frame" ) ||
		 !strcmp( w->object.type, "claro.graphics.widgets.workspace.window" ) ||
		 !strcmp( w->object.type, "claro.graphics.widgets.window" )	)
	{
		if ( event->x == w->size.x && event->y == w->size.y &&
			 event->width == w->size.w && event->height == w->size.h )
			return 0;
		
		widget_set_size( OBJECT(w), event->width, event->height, 1 );
		widget_set_content_size( OBJECT(w), event->width, event->height, 1 );
		widget_set_position( OBJECT(w), event->x, event->y, 1 );
		
		widget_resized_handle( OBJECT(w), 0 );
	}
	
	return 0;
}