Patch level :10.0 252
Files correlati : Ricompilazione Demo : [ ] Commento :piccole modifiche per migliorare la gestione immagini sui bottoni git-svn-id: svn://10.65.10.50/trunk@18430 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									b45bc8a0e8
								
							
						
					
					
						commit
						09bcf1c189
					
				@ -1667,7 +1667,7 @@ void TButton_control::set_icon(unsigned int icon_up, unsigned int icon_dn)
 | 
			
		||||
TPushbutton_control::TPushbutton_control(WINDOW win, short cid,
 | 
			
		||||
                                         short left, short top, short width, short height,
 | 
			
		||||
                                         const char* flags, const char* text,
 | 
			
		||||
                                         short bmp_up, short bmp_dn)
 | 
			
		||||
                                         int bmp_up, int bmp_dn)
 | 
			
		||||
                   : _bmp_up(bmp_up), _bmp_dn(bmp_dn)
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
@ -1695,7 +1695,7 @@ void TPushbutton_control::set_caption(const char* c)
 | 
			
		||||
  {       
 | 
			
		||||
    TControl::set_caption(cap);
 | 
			
		||||
    set_icon(0);
 | 
			
		||||
    set_bmp(short(0), short(0));
 | 
			
		||||
    set_bmp(0, 0);
 | 
			
		||||
    _obj->v.btn->drawable = false;
 | 
			
		||||
    _obj->v.btn->fore_color = color;
 | 
			
		||||
		xi_set_obj_font_id(_obj, xvtil_default_font(bold, big));
 | 
			
		||||
@ -1719,9 +1719,9 @@ void TPushbutton_control::set_bmp(int bmp_up, int bmp_dn)
 | 
			
		||||
 | 
			
		||||
    XVT_IMAGE img_up = NULL, img_dn = NULL;
 | 
			
		||||
    if (bmp_up > 0)
 | 
			
		||||
      img_up = _picture->image(bmp_up).xvt_image();
 | 
			
		||||
      img_up = _picture->image(_bmp_up).xvt_image();
 | 
			
		||||
    if (bmp_dn > 0)
 | 
			
		||||
      img_dn = _picture->image(bmp_dn).xvt_image();
 | 
			
		||||
      img_dn = _picture->image(_bmp_dn).xvt_image();
 | 
			
		||||
    xvt_btn_set_images((WINDOW)_obj->v.btn->btnctl, img_up, img_dn);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
@ -1781,7 +1781,7 @@ void TPushbutton_control::update()
 | 
			
		||||
      xvt_dwin_set_std_cpen(win, TL_PEN_HOLLOW);
 | 
			
		||||
      xi_draw_rect((XinWindow)win, &rct);
 | 
			
		||||
       
 | 
			
		||||
      const short bmp = (_bmp_dn > 0 && _obj->v.btn->down) ? _bmp_dn : _bmp_up;
 | 
			
		||||
      const int bmp = (_bmp_dn > 0 && _obj->v.btn->down) ? _bmp_dn : _bmp_up;
 | 
			
		||||
      if (bmp > 0)
 | 
			
		||||
      {
 | 
			
		||||
        const TImage& i = attrib & XI_ATR_ENABLED ? _picture->image(bmp) : _picture->disabled_image(bmp);
 | 
			
		||||
 | 
			
		||||
@ -237,7 +237,7 @@ public:
 | 
			
		||||
  TPushbutton_control(WINDOW win, short cid, 
 | 
			
		||||
                      short left, short top, short width, short height,
 | 
			
		||||
                      const char* flags, const char* text,
 | 
			
		||||
                      short bmp_up = 0, short _bmp_dn = 0);
 | 
			
		||||
                      int bmp_up = 0, int _bmp_dn = 0);
 | 
			
		||||
  virtual ~TPushbutton_control();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -94,8 +94,8 @@ protected:
 | 
			
		||||
    short _decimals;       // Precision
 | 
			
		||||
    TString _prompt;       // Prompt
 | 
			
		||||
    TString _flags;        // Flags
 | 
			
		||||
    short _bmp_up;         // Bitmap up
 | 
			
		||||
    short _bmp_dn;         // Bitmap down
 | 
			
		||||
    int _bmp_up;         // Bitmap up
 | 
			
		||||
    int _bmp_dn;         // Bitmap down
 | 
			
		||||
    TToken_string _park;   // Work string
 | 
			
		||||
    void reset();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -17,7 +17,7 @@ static wxBitmap Image2Bitmap(XVT_IMAGE image, int maxx, int maxy, BOOLEAN trans)
 | 
			
		||||
  if (image == NULL)
 | 
			
		||||
    return wxNullBitmap;
 | 
			
		||||
 | 
			
		||||
  wxImage& img = *(wxImage*)image;
 | 
			
		||||
  wxImage img = *(wxImage*)image;
 | 
			
		||||
 | 
			
		||||
  int w = img.GetWidth(), h = img.GetHeight();
 | 
			
		||||
  if (w > maxx || h > maxy)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user