Patch level : 12.0 1204
Files correlati : cg2.exe ve0.exe xvaga.dll Commento: aggiunti campi per memorizzare documenti generici e documenti cartacei da archiviare Aggiunte xvt_toolbar_toggle_control xvt_toolbar_set_image
This commit is contained in:
		
							parent
							
								
									aec7d0d669
								
							
						
					
					
						commit
						393bb40547
					
				| @ -49,6 +49,8 @@ XVTDLL void    xvt_toolbar_realize(WINDOW win); | |||||||
| XVTDLL BOOLEAN xvt_toolbar_remove_control(WINDOW win, int cid); | XVTDLL BOOLEAN xvt_toolbar_remove_control(WINDOW win, int cid); | ||||||
| XVTDLL BOOLEAN xvt_toolbar_set_last_tool(WINDOW win, int cid); | XVTDLL BOOLEAN xvt_toolbar_set_last_tool(WINDOW win, int cid); | ||||||
| XVTDLL void    xvt_toolbar_show_control(WINDOW win, int cid, BOOLEAN on); | XVTDLL void    xvt_toolbar_show_control(WINDOW win, int cid, BOOLEAN on); | ||||||
|  | XVTDLL BOOLEAN xvt_toolbar_toggle_control(WINDOW win, int cid, BOOLEAN on); | ||||||
|  | XVTDLL BOOLEAN xvt_toolbar_set_image(WINDOW win, int cid, int ico); | ||||||
| 
 | 
 | ||||||
| #if defined(_cplusplus) || defined(__cplusplus) | #if defined(_cplusplus) || defined(__cplusplus) | ||||||
| }				/* extern "C" */ | }				/* extern "C" */ | ||||||
|  | |||||||
| @ -2470,6 +2470,7 @@ public: | |||||||
|   int ico() const { return _ico; } |   int ico() const { return _ico; } | ||||||
| 
 | 
 | ||||||
|   void set_pos(short pos) { _pos = pos; } |   void set_pos(short pos) { _pos = pos; } | ||||||
|  | 	void set_ico(short ico) { _ico = ico; } | ||||||
| 
 | 
 | ||||||
|   wxToolData(int ico, short pos = -1) : _pos(pos), _ico(ico) {} |   wxToolData(int ico, short pos = -1) : _pos(pos), _ico(ico) {} | ||||||
| }; | }; | ||||||
| @ -2641,6 +2642,7 @@ BOOLEAN xvt_toolbar_add_control(WINDOW win, int cid, TOOL_TYPE type, const char | |||||||
|       const wxBitmap bmp = xvtart_GetToolResource(ico, tb.GetToolBitmapSize().y); |       const wxBitmap bmp = xvtart_GetToolResource(ico, tb.GetToolBitmapSize().y); | ||||||
|       wxString cap, tip; |       wxString cap, tip; | ||||||
|       wxChar acc = 0; |       wxChar acc = 0; | ||||||
|  | 
 | ||||||
|       for (const char* t = title; *t; t++) |       for (const char* t = title; *t; t++) | ||||||
|       { |       { | ||||||
|         if (*t == '~' || *t == '&') |         if (*t == '~' || *t == '&') | ||||||
| @ -2876,10 +2878,54 @@ BOOLEAN xvt_toolbar_remove_control(WINDOW win, int cid) | |||||||
|   return ok; |   return ok; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | BOOLEAN xvt_toolbar_toggle_control(WINDOW win, int cid, BOOLEAN on) | ||||||
|  | { | ||||||
|  | 	TwxToolBar* ptb = Win2Bar(win); | ||||||
|  | 	bool ok = ptb != nullptr; | ||||||
|  | 
 | ||||||
|  | 	if (ok) | ||||||
|  | 	{ | ||||||
|  | 		TwxToolBar& tb = *ptb; | ||||||
|  | 		int size = tb.GetToolBitmapSize().y; | ||||||
|  | 		int idx = tb.GetToolPos(cid); | ||||||
|  | 
 | ||||||
|  | 		tb.ToggleTool(cid, on); | ||||||
|  | 		xvt_toolbar_realize(win); | ||||||
|  | 		tb.Refresh(); | ||||||
|  | 	} | ||||||
|  | 	return ok; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | BOOLEAN xvt_toolbar_set_image(WINDOW win, int cid, int ico) | ||||||
|  | { | ||||||
|  | 	TwxToolBar* ptb = Win2Bar(win); | ||||||
|  | 	bool ok = ptb != nullptr; | ||||||
|  | 
 | ||||||
|  | 	if (ok)  // non si capisce perchè non debba aggiornare le bitmap
 | ||||||
|  | 	{ | ||||||
|  | 		TwxToolBar& tb = *ptb; | ||||||
|  | 		int size = tb.GetToolBitmapSize().y; | ||||||
|  |   	int idx = ptb->GetToolPos(cid); | ||||||
|  | 		wxToolBarToolBase* tool = tb.RemoveTool(cid); | ||||||
|  | 
 | ||||||
|  | 		ok = tool != nullptr; | ||||||
|  | 		if (ok) | ||||||
|  | 		{ | ||||||
|  | 			wxString label = tool->GetLabel(); | ||||||
|  | 
 | ||||||
|  | 			delete tool; | ||||||
|  | 			ok = xvt_toolbar_add_control(win, cid, TOOL_BUTTON, label.c_str(), ico, size, idx); | ||||||
|  | 		} | ||||||
|  | 		if (ok) | ||||||
|  | 			xvt_toolbar_realize(win); | ||||||
|  | 	} | ||||||
|  | 	return ok; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| void xvt_dwin_draw_tool(WINDOW win, int x, int y, int rid, int size) | void xvt_dwin_draw_tool(WINDOW win, int x, int y, int rid, int size) | ||||||
| { | { | ||||||
|   const wxBitmap bmp = xvtart_GetToolResource(rid, size); |   const wxBitmap bmp = xvtart_GetToolResource(rid, size); | ||||||
|  | 
 | ||||||
|   if (bmp.IsOk()) |   if (bmp.IsOk()) | ||||||
|   { |   { | ||||||
|   	wxDC& dc = GetTDCMapper().GetDC(win); |   	wxDC& dc = GetTDCMapper().GetDC(win); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user