Esempio n. 1
0
int GvMField::set(const char* s)
{
	//delete contents 
	makeRoom(0);

	// TRACE("Parsing an MField from :%s\n",s);

	if (strcmp(s,"[]") == 0) {
		setDefault(TRUE);
		OnChanged();
  		return(1);
	} 


	// create a parser 
	GvInput in;

    in.setString(s);
	in.version = 2.0;
	in.vrml2 = 1;
	
	// read 
	int ret = this->readValue(&in);

	setDefault(FALSE);
	OnChanged();

	return ret;
}
Esempio n. 2
0
void Graphics::drawEllipse(float x, float y, float width, float height)
{
   x += width/2;
   y += height/2;
   float w = width*0.5;
   float w_ = w*SIN45;
   float cw_ = w*TAN22;
   float h = height*0.5;
   float h_ = h*SIN45;
   float ch_ = h*TAN22;

   Flush();

   mPathData->moveTo(x+w,y);
   mPathData->curveTo(x+w,  y+ch_, x+w_, y+h_);
   mPathData->curveTo(x+cw_,y+h,   x,    y+h);
   mPathData->curveTo(x-cw_,y+h,   x-w_, y+h_);
   mPathData->curveTo(x-w,  y+ch_, x-w,  y);
   mPathData->curveTo(x-w,  y-ch_, x-w_, y-h_);
   mPathData->curveTo(x-cw_,y-h,   x,    y-h);
   mPathData->curveTo(x+cw_,y-h,   x+w_, y-h_);
   mPathData->curveTo(x+w,  y-ch_, x+w,  y);

   Flush();
   OnChanged();
}
SVGTransform* SVGTransformListMutable::consolidate()
{
	if (m_p->m_items.GetSize() > 0)
	{
		SVGTransform* pTransform = new SVGTransform;
		pTransform->m_type = SVG_TRANSFORM_MATRIX;
		pTransform->m_matrix->GetM() = consolidateToMatrix2();
			//??? pTransform->m_matrix->m_pListener = pTransform;

		pTransform->m_owner = this;
//		pTransform->m_pListener = this;

		RemoveAll();

		m_p->m_items.Add(pTransform);

		OnChanged();
		/*
		if (m_pListener)
		{
			m_pListener->OnChanged(this);
		}
		*/

		return pTransform;
	}

	return NULL;
}
Esempio n. 4
0
void prefs_file::reset()
{
    CheckDlgButton(IDC_CHECK_FILE1, default_cfg_file1_enable);
    CheckDlgButton(IDC_CHECK_FILE2, default_cfg_file2_enable);
    CheckDlgButton(IDC_CHECK_FILE3, default_cfg_file3_enable);

    CheckDlgButton(IDC_CHECK_RESAMPLE1, default_cfg_file1_resample);
    CheckDlgButton(IDC_CHECK_RESAMPLE2, default_cfg_file2_resample);
    CheckDlgButton(IDC_CHECK_RESAMPLE3, default_cfg_file3_resample);

    m_slider_level1.SetPos(default_cfg_file1_level);
    m_slider_level2.SetPos(default_cfg_file2_level);
    m_slider_level3.SetPos(default_cfg_file3_level);

    SetDlgItemText(IDC_EDIT_FILE1, L"");
    SetDlgItemText(IDC_EDIT_FILE2, L"");
    SetDlgItemText(IDC_EDIT_FILE3, L"");

    SetDlgItemText(IDC_LABEL_INFO1, L"");
    SetDlgItemText(IDC_LABEL_INFO2, L"");
    SetDlgItemText(IDC_LABEL_INFO3, L"");

    RefreshFileLevelLabel();

    OnChanged();
}
Esempio n. 5
0
void CMyPreferences::reset() {
	int n, o;
	char temp[16];
	SendDlgItemMessage( IDC_INDEFINITE, BM_SETCHECK, default_cfg_indefinite );
	SendDlgItemMessage( IDC_WRITE, BM_SETCHECK, default_cfg_write );
	SendDlgItemMessage( IDC_WNSFE, BM_SETCHECK, default_cfg_write_nsfe );
	SendDlgItemMessage( IDC_NSFEPL, BM_SETCHECK, default_cfg_nsfe_ignore_playlists );
	SendDlgItemMessage( IDC_NSF4011, BM_SETCHECK, default_cfg_nsf_ignore_w4011 );
	SendDlgItemMessage( IDC_ANTISURROUND, BM_SETCHECK, default_cfg_spc_anti_surround );
	SendDlgItemMessage( IDC_GD3JAPANESE, BM_SETCHECK, default_cfg_vgm_gd3_prefers_japanese );
	SendDlgItemMessage( IDC_EFFECTS, BM_SETCHECK, default_cfg_effects_enable );
	for(n=IDC_FORMAT_NSF,o=0;n<=IDC_FORMAT_SFM;n++,o++)
	{
		SendDlgItemMessage( n, BM_SETCHECK, !! ( default_cfg_format_enable & ( 1 << o ) ) );
	}
	print_time_crap( default_cfg_default_length, (char *)&temp );
	uSetDlgItemText( m_hWnd, IDC_DLENGTH, (char *)&temp );
	print_time_crap( default_cfg_default_fade, (char *)&temp );
	uSetDlgItemText( m_hWnd, IDC_DFADE, (char *)&temp );
	SendDlgItemMessage( IDC_SLIDER_BASS, TBM_SETPOS, 1, default_cfg_effects_bass );
	SendDlgItemMessage( IDC_SLIDER_TREBLE, TBM_SETPOS, 1, default_cfg_effects_treble );
	SendDlgItemMessage( IDC_SLIDER_ECHO_DEPTH, TBM_SETPOS, 1, default_cfg_effects_echo_depth );
	SetDlgItemInt( IDC_SAMPLERATE, default_cfg_sample_rate, FALSE );
	SendDlgItemMessage( IDC_VGMLOOPCOUNT, CB_SETCURSEL, default_cfg_vgm_loop_count );
	enable_vgm_loop_count( !default_cfg_indefinite );
	SendDlgItemMessage( IDC_INTERPOLATION, CB_SETCURSEL, default_cfg_spc_interpolation + 2 );

	OnChanged();
}
Esempio n. 6
0
void Graphics::clear(bool inForceFreeHardware)
{
   mFillJob.clear();
   mLineJob.clear();
   mTileJob.clear();

   // clear jobs
   for(int i=0;i<mJobs.size();i++)
      mJobs[i].clear();
   mJobs.resize(0);

   if (mHardwareData)
   {
      if (inForceFreeHardware || mClearCount<4)
      {
         delete mHardwareData;
         mHardwareData = 0;
      }
      else
         mHardwareData->clear();
      if (!inForceFreeHardware)
         mClearCount++;
   }

   mPathData->clear();

   mExtent0 = Extent2DF();
   mRotation0 = 0;
   mBuiltHardware = 0;
   mMeasuredJobs = 0;
   mCursor = UserPoint(0,0);
   OnChanged();
}
Esempio n. 7
0
void Graphics::drawGraphicsDatum(IGraphicsData *inData)
{
   switch(inData->GetType())
   {
      case gdtUnknown: break;
      case gdtTrianglePath: break;
      case gdtPath:
         {
         GraphicsPath *path = inData->AsPath();
         drawPath(path->commands, path->data, path->winding);
         break;
         }
      case gdtEndFill:
         endFill();
         break;
      case gdtSolidFill:
      case gdtGradientFill:
      case gdtBitmapFill:
         {
         IGraphicsFill *fill = inData->AsIFill();
         if (fill->isSolidStyle())
         {
            Flush(false,true);
            endTiles();
            if (mFillJob.mFill)
               mFillJob.mFill->DecRef();
            mFillJob.mFill = fill;
            mFillJob.mFill->IncRef();
            if (mFillJob.mCommand0 == mPathData->commands.size())
               mPathData->initPosition(mCursor);
         }
         else if (mLineJob.mStroke)
         {
            Flush(true,false);
            mLineJob.mStroke = mLineJob.mStroke->CloneWithFill(fill);
         }
         }
         break;
      case gdtStroke:
         {
         Flush(true,false);
         if (mLineJob.mStroke)
         {
            mLineJob.mStroke->DecRef();
            mLineJob.mStroke = 0;
         }
         GraphicsStroke *stroke = inData->AsStroke();
         if (stroke->thickness>=0 && stroke->fill)
         {
            mLineJob.mStroke = stroke;
            mLineJob.mStroke->IncRef();
            if (mLineJob.mCommand0 == mPathData->commands.size())
               mPathData->initPosition(mCursor);
         }
         }
         break;

   }
   OnChanged();
}
Esempio n. 8
0
void Graphics::endTiles()
{
   if (mTileJob.mFill)
   {
      mTileJob.mFill->DecRef();
      mTileJob.mFill = 0;
      OnChanged();
   }
}
void FAnimLinkableElement::ChangeLinkMethod(EAnimLinkMethod::Type NewLinkMethod)
{
	if(NewLinkMethod != LinkMethod)
	{
		// Switch to the new link method and resolve it
		LinkMethod = NewLinkMethod;
		OnChanged(GetTime());
	}
}
Esempio n. 10
0
void Graphics::arcTo(float cx, float cy, float x, float y)
{
   if ( (mFillJob.mFill && mFillJob.mCommand0==mPathData->commands.size()) ||
        (mLineJob.mStroke && mLineJob.mCommand0==mPathData->commands.size()) )
     mPathData->initPosition(mCursor);

   mPathData->arcTo(cx,cy,x,y);
   mCursor = UserPoint(x,y);
   OnChanged();
}
Esempio n. 11
0
int GvMaterial::OnFieldChanged(GvField *field)
{
	isEmissiveColorOnly = -1;
	hasTransparency = -1;
	maxNumValues = -1;

	OnChanged(); // ??

	return(1);
}
ribi::QtDasWahreSchlagerfestCanvas::QtDasWahreSchlagerfestCanvas(
  const int width, const int height)
  : QtCanvas(CreateCanvas(width,height)),
    m_widget(CreateWidget(width,height))
{
  m_widget->m_signal_changed.connect(
    boost::bind(&ribi::QtDasWahreSchlagerfestCanvas::OnChanged,this));

  OnChanged();
}
Esempio n. 13
0
void Graphics::beginTiles(Surface *bitmapData,bool inSmooth,int inBlendMode, int inMode, int inCount)
{
   endFill();
   lineStyle(-1);
   Flush();
   if (mTileJob.mFill)
      mTileJob.mFill->DecRef();
   mTileJob.mFill = new GraphicsBitmapFill(bitmapData,Matrix(),false,inSmooth);
   mTileJob.mFill->IncRef();
   mTileJob.mBlendMode = inBlendMode;
   mTileJob.mTileCount = inCount;
   mTileJob.mTileMode = inMode;
   OnChanged();
}
Esempio n. 14
0
void SVGTransformListMutable::clear()
{
	if (m_p->m_items.GetSize() > 0)
	{
		RemoveAll();

		OnChanged();
		/*
		if (m_pListener)
		{
			m_pListener->OnChanged(this);
		}
		*/
	}
}
Esempio n. 15
0
void Graphics::curveTo(float cx, float cy, float x, float y)
{
   if ( (mFillJob.mFill && mFillJob.mCommand0==mPathData->commands.size()) ||
        (mLineJob.mStroke && mLineJob.mCommand0==mPathData->commands.size()) )
     mPathData->initPosition(mCursor);

   if ( (fabs(mCursor.x-cx)<EPSILON && fabs(mCursor.y-cy)<EPSILON) ||
        (fabs(x-cx)<EPSILON && fabs(y-cy)<EPSILON)  )
   {
      mPathData->lineTo(x,y);
   }
   else
      mPathData->curveTo(cx,cy,x,y);
   mCursor = UserPoint(x,y);
   OnChanged();
}
Esempio n. 16
0
SVGTransform* SVGTransformListMutable::insertItemBefore(SVGTransform* newItem, unsigned int index)
{
	if (newItem == NULL) THROW(std::exception("null pointer"));

	m_p->m_items.InsertAt(index, newItem);
//	newItem->m_pListener = this;
	newItem->m_owner = this;

	OnChanged();
/*	if (m_pListener)
	{
		m_pListener->OnChanged(this);
	}
*/

	return newItem;
}
Esempio n. 17
0
void CMyPreferences::apply() {
	char temp[16];
	int t = GetDlgItemInt( IDC_SAMPLERATE, NULL, FALSE );
	if ( t < 6000 ) t = 6000;
	else if ( t > 96000 ) t = 96000;
	SetDlgItemInt( IDC_SAMPLERATE, t, FALSE );
	itoa( t, temp, 10 );
	cfg_history_rate.add_item(temp);
	cfg_sample_rate = t;
	cfg_vgm_loop_count = SendDlgItemMessage( IDC_VGMLOOPCOUNT, CB_GETCURSEL );
	cfg_spc_interpolation = SendDlgItemMessage( IDC_INTERPOLATION, CB_GETCURSEL ) - 2;
	t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DLENGTH ) ) );
	if ( t != BORK_TIME ) cfg_default_length = t;
	else
	{
		print_time_crap( cfg_default_length, (char *)&temp );
		uSetDlgItemText( m_hWnd, IDC_DLENGTH, (char *)&temp );
	}
	t = parse_time_crap( string_utf8_from_window( GetDlgItem( IDC_DFADE ) ) );
	if ( t != BORK_TIME ) cfg_default_fade = t;
	else
	{
		print_time_crap( cfg_default_fade, (char *)&temp );
		uSetDlgItemText( m_hWnd, IDC_DFADE, (char *)&temp );
	}
	cfg_indefinite = SendDlgItemMessage( IDC_INDEFINITE, BM_GETCHECK );
	cfg_write = SendDlgItemMessage( IDC_WRITE, BM_GETCHECK );
	cfg_write_nsfe = SendDlgItemMessage( IDC_WNSFE, BM_GETCHECK );
	cfg_nsfe_ignore_playlists = SendDlgItemMessage( IDC_NSFEPL, BM_GETCHECK );
	cfg_nsf_ignore_w4011 = SendDlgItemMessage( IDC_NSF4011, BM_GETCHECK );
	cfg_spc_anti_surround = SendDlgItemMessage( IDC_ANTISURROUND, BM_GETCHECK );
	cfg_vgm_gd3_prefers_japanese = SendDlgItemMessage( IDC_GD3JAPANESE, BM_GETCHECK );
	cfg_effects_enable = SendDlgItemMessage( IDC_EFFECTS, BM_GETCHECK );
	cfg_format_enable = ~0;
	for (unsigned wp = IDC_FORMAT_NSF; wp <= IDC_FORMAT_SFM; wp++)
	{
		unsigned bit = 1 << ( wp - IDC_FORMAT_NSF );
		unsigned mask = ~0 ^ bit;
		cfg_format_enable = ( cfg_format_enable & mask ) | ( bit * SendDlgItemMessage( wp, BM_GETCHECK ) );
	}
	cfg_effects_bass = SendDlgItemMessage( IDC_SLIDER_BASS, TBM_GETPOS );
	cfg_effects_treble = SendDlgItemMessage( IDC_SLIDER_TREBLE, TBM_GETPOS );
	cfg_effects_echo_depth = SendDlgItemMessage( IDC_SLIDER_ECHO_DEPTH, TBM_GETPOS );
	
	OnChanged(); //our dialog content has not changed but the flags have - our currently shown values now match the settings so the apply button can be disabled
}
Esempio n. 18
0
SVGTransform* SVGTransformListMutable::appendItem(SVGTransform* newItem)
{
	if (newItem == NULL) THROW(std::exception("null pointer"));

	m_p->m_items.Add(newItem);
//	newItem->m_pListener = this;
	newItem->m_owner = this;

	OnChanged();
/*	if (m_pListener)
	{
		m_pListener->OnChanged(this);
	}
*/

	return newItem;
}
Esempio n. 19
0
void prefs_file::OnButtonClick(UINT, int id, CWindow)
{
    switch (id)
    {
    case IDC_BROWSE1:
        LoadFile(IDC_EDIT_FILE1, IDC_LABEL_INFO1, IDC_SLIDER_LEVEL1, IDC_CHECK_FILE1);
        break;
    case IDC_BROWSE2:
        LoadFile(IDC_EDIT_FILE2, IDC_LABEL_INFO2, IDC_SLIDER_LEVEL2, IDC_CHECK_FILE2);
        break;
    case IDC_BROWSE3:
        LoadFile(IDC_EDIT_FILE3, IDC_LABEL_INFO3, IDC_SLIDER_LEVEL3, IDC_CHECK_FILE3);
        break;
    default:
        break;
    }

    OnChanged();
}
Esempio n. 20
0
void Graphics::drawPath(const QuickVec<uint8> &inCommands, const QuickVec<float> &inData,
           WindingRule inWinding )
{
   int n = inCommands.size();
   if (n==0 || inData.size()<2)
      return;

   const UserPoint *point = (UserPoint *)&inData[0];
   const UserPoint *last =  point + inData.size()/2;

   if ( (mFillJob.mFill && mFillJob.mCommand0==mPathData->commands.size()) ||
        (mLineJob.mStroke && mLineJob.mCommand0==mPathData->commands.size()) )
     mPathData->initPosition(mCursor);

   for(int i=0;i<n && point<last;i++)
   {
      switch(inCommands[i])
      {
         case pcWideMoveTo:
            point++;
            if (point==last) break;
         case pcMoveTo:
            mPathData->moveTo(point->x,point->y);
            mCursor = *point++;
            break;

         case pcWideLineTo:
            point++;
            if (point==last) break;
         case pcLineTo:
            mPathData->lineTo(point->x,point->y);
            mCursor = *point++;
            break;

         case pcCurveTo:
            if (point+1==last) break;
            mPathData->curveTo(point->x,point->y,point[1].x,point[1].y);
            mCursor = point[1];
            point += 2;
      }
   }
   OnChanged();
}
//Återställer dialogvärdena
void CMyPreferences::reset() {
	SetDlgItemInt(IDC_COMPORT, default_cfg_ComPort, FALSE);
	SetDlgItemInt(IDC_BAUD, default_cfg_Baud, FALSE);
	SetDlgItemInt(IDC_SignAdress, default_cfg_SignAdress, FALSE);
	uSetDlgItemText(*this, IDC_PatternPlaying, default_cfg_PatternPlaying);
	uSetDlgItemText(*this, IDC_PatternPaused, default_cfg_PatternPaused);
	uSetDlgItemText(*this, IDC_PatternStopped, default_cfg_PatternStopped);

	HWND EB = GetDlgItem(IDC_Clock);
	SendMessage(EB, BM_SETCHECK, default_cfg_Clock ? BST_CHECKED : BST_UNCHECKED, 0); //? = inline if

	HWND CB1 = GetDlgItem(IDC_ModePlaying); 
	HWND CB2 = GetDlgItem(IDC_ModePaused);
	HWND CB3 = GetDlgItem(IDC_ModeStopped);
	SendMessage(CB1, CB_SETCURSEL, default_cfg_ModePlaying - 'A', 0); 
	SendMessage(CB2, CB_SETCURSEL, default_cfg_ModePaused - 'A', 0); 
	SendMessage(CB3, CB_SETCURSEL, default_cfg_ModeStopped - 'A', 0); 
	
	OnChanged();
}
//Värkställer dialogvärdena
void CMyPreferences::apply() {
	cfg_COMPort = GetDlgItemInt(IDC_COMPORT, NULL, FALSE);
	cfg_BaudRate = GetDlgItemInt(IDC_BAUD, NULL, FALSE);
	cfg_SignAdress =  GetDlgItemInt(IDC_SignAdress, NULL, FALSE);
	uGetDlgItemText(*this, IDC_PatternPlaying, cfg_PatternPlaying);
	uGetDlgItemText(*this, IDC_PatternPaused, cfg_PatternPaused);
	uGetDlgItemText(*this, IDC_PatternStopped, cfg_PatternStopped);

	HWND EB = GetDlgItem(IDC_Clock);
	cfg_UseClock = (SendMessage(EB, BM_GETCHECK,0 , 0) == BST_CHECKED);

	HWND CB1 = GetDlgItem(IDC_ModePlaying); 
	HWND CB2 = GetDlgItem(IDC_ModePaused);
	HWND CB3 = GetDlgItem(IDC_ModeStopped);
	cfg_ModePlaying = 'A' + SendMessage(CB1, CB_GETCURSEL, 0, 0); 
	cfg_ModePaused = 'A' + SendMessage(CB2, CB_GETCURSEL, 0, 0); 
	cfg_ModeStopped = 'A' + SendMessage(CB3, CB_GETCURSEL, 0, 0); 
	

	OnChanged(); //our dialog content has not changed but the flags have - our currently shown values now match the settings so the apply button can be disabled
}
Esempio n. 23
0
SVGTransform* SVGTransformListMutable::removeItem(unsigned int index)
{
	if (index < m_p->m_items.GetSize())
	{
		SVGTransform* old = m_p->m_items[index];
		m_p->m_items.RemoveAt(index);

		OnChanged();
/*		if (m_pListener)
		{
			m_pListener->OnChanged(this);
		}
*/
		return old;
	}
	else
	{
		ASSERT(0);
		return NULL;
	}
}
void CMyPreferences::OnEditChange(UINT, int, CWindow) {

	//Avaktiverar stoppat fältet när använd klocka checkas
	HWND EB = GetDlgItem(IDC_Clock);
	bool UseClock = (SendMessage(EB, BM_GETCHECK,0 , 0) == BST_CHECKED);

	HWND PAT = GetDlgItem(IDC_PatternStopped);
	HWND MODE = GetDlgItem(IDC_ModeStopped);

	if(UseClock)
	{
		::EnableWindow(PAT, FALSE);
		::EnableWindow(MODE, FALSE);
	}else
	{
		::EnableWindow(PAT, TRUE);
		::EnableWindow(MODE, TRUE);
	}

	OnChanged();
}
void CDialogPref::LoadProps(bool reset /*= false*/)
{
    if (reset)
        g_sci_prop_sets.reset();

    pfc::stringcvt::string_os_from_utf8_fast conv;
    t_sci_prop_set_list & prop_sets = g_sci_prop_sets.val();

    m_props.DeleteAllItems();

    for (t_size i = 0; i < prop_sets.get_count(); ++i)
    {
        conv.convert(prop_sets[i].key);
        m_props.AddItem(i, 0, conv);

        conv.convert(prop_sets[i].val);
        m_props.AddItem(i, 1, conv);
    }

    OnChanged();
}
Esempio n. 26
0
int GvField::set(const GvField *value)
{
	if (this == value) { // hg 20.04.99
		// already equal pointers !
		// had problems with this = this because array destroyed before copy
        OnChanged();
	    return TRUE;
	}
	// TBD: to do check type, no part of proper scene graph construction

   
	*this = *value;  // virtual

   /* already called by = operator
        setDefault(FALSE);
        return OnChanged();
    */
    // copy default flag ?? 
    // if (value->isDefault())   setDefault(TRUE);

   return TRUE;
}
Esempio n. 27
0
void prefs_file::apply()
{
    cfg_file1_enable = IsDlgButtonChecked(IDC_CHECK_FILE1);
    cfg_file2_enable = IsDlgButtonChecked(IDC_CHECK_FILE2);
    cfg_file3_enable = IsDlgButtonChecked(IDC_CHECK_FILE3);

    cfg_file1_resample = IsDlgButtonChecked(IDC_CHECK_RESAMPLE1);
    cfg_file2_resample = IsDlgButtonChecked(IDC_CHECK_RESAMPLE2);
    cfg_file3_resample = IsDlgButtonChecked(IDC_CHECK_RESAMPLE3);

    cfg_file1_level = m_slider_level1.GetPos();
    cfg_file2_level = m_slider_level2.GetPos();
    cfg_file3_level = m_slider_level3.GetPos();

    wchar_t wstr[1024];

    // convert filenames to char
    GetDlgItemText(IDC_EDIT_FILE1, (LPTSTR)wstr, sizeof(wstr));
    cfg_file1_filename.set_string((util::wstr2str(wstr)).c_str());

    GetDlgItemText(IDC_EDIT_FILE2, (LPTSTR)wstr, sizeof(wstr));
    cfg_file2_filename.set_string((util::wstr2str(wstr)).c_str());

    GetDlgItemText(IDC_EDIT_FILE3, (LPTSTR)wstr, sizeof(wstr));
    cfg_file3_filename.set_string((util::wstr2str(wstr)).c_str());

    // convert metadata string to char
    GetDlgItemText(IDC_LABEL_INFO1, (LPTSTR)wstr, sizeof(wstr));
    cfg_file1_metadata.set_string((util::wstr2str(wstr)).c_str());

    GetDlgItemText(IDC_LABEL_INFO2, (LPTSTR)wstr, sizeof(wstr));
    cfg_file2_metadata.set_string((util::wstr2str(wstr)).c_str());

    GetDlgItemText(IDC_LABEL_INFO3, (LPTSTR)wstr, sizeof(wstr));
    cfg_file3_metadata.set_string((util::wstr2str(wstr)).c_str());
    
    OnChanged(); //our dialog content has not changed but the flags have - our currently shown values now match the settings so the apply button can be disabled
}
ribi::QtTestDrawCanvasMainDialog::QtTestDrawCanvasMainDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestDrawCanvasMainDialog),
  m_canvas(CreateCanvas()),
  m_surface_plot(new ribi::QtSurfacePlotWidget)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);

  {
    assert(ui->verticalLayout);
    QtCanvas * const qtcanvas {
      new QtCanvas(m_canvas)
    };
    ui->verticalLayout->addWidget(qtcanvas);
    ui->verticalLayout->addWidget(m_surface_plot);
  }

  {
    const double w = m_canvas->GetWidth();
    const double h = m_canvas->GetHeight();
    ui->box_circle_x->setValue(0.5 * w);
    ui->box_circle_y->setValue(0.5 * h);
    ui->box_circle_r->setValue(0.4 * h);
    ui->box_dot_x->setValue(0.5 * w);
    ui->box_dot_y->setValue(0.5 * h);
    ui->box_line_x1->setValue(0.25 * w);
    ui->box_line_y1->setValue(0.25 * h);
    ui->box_line_x2->setValue(0.75 * w);
    ui->box_line_y2->setValue(0.75 * h);
  }

  OnChanged();
}
Esempio n. 29
0
void Graphics::drawRoundRect(float x,float  y,float  width,float  height,float  rx,float  ry)
{
   rx *= 0.5;
   ry *= 0.5;
   float w = width*0.5;
   x+=w;
   if (rx>w) rx = w;
   float lw = w - rx;
   float w_ = lw + rx*SIN45;
   float cw_ = lw + rx*TAN22;
   float h = height*0.5;
   y+=h;
   if (ry>h) ry = h;
   float lh = h - ry;
   float h_ = lh + ry*SIN45;
   float ch_ = lh + ry*TAN22;

   Flush();

   mPathData->moveTo(x+w,y+lh);
   mPathData->curveTo(x+w,  y+ch_, x+w_, y+h_);
   mPathData->curveTo(x+cw_,y+h,   x+lw,    y+h);
   mPathData->lineTo(x-lw,    y+h);
   mPathData->curveTo(x-cw_,y+h,   x-w_, y+h_);
   mPathData->curveTo(x-w,  y+ch_, x-w,  y+lh);
   mPathData->lineTo( x-w, y-lh);
   mPathData->curveTo(x-w,  y-ch_, x-w_, y-h_);
   mPathData->curveTo(x-cw_,y-h,   x-lw,    y-h);
   mPathData->lineTo(x+lw,    y-h);
   mPathData->curveTo(x+cw_,y-h,   x+w_, y-h_);
   mPathData->curveTo(x+w,  y-ch_, x+w,  y-lh);
   mPathData->lineTo(x+w,  y+lh);

   Flush();
   OnChanged();
}
void CDialogPref::reset()
{
    g_cfg_safe_mode = true;
    LoadProps(true);
    OnChanged();
}