Example #1
0
 PeakWPK10s()
 {
     setSecs(10);
     setSymbol("10s_peak_wpk");
     setName(tr("10 sec Peak WPK"));
 }
Example #2
0
void LLParcel::unpackMessage(LLMessageSystem* msg)
{
	std::string buffer;
	
    msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, buffer );
    setName(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, buffer );
    setDesc(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, buffer );
    setMusicURL(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
    setMediaURL(buffer);
    
    // non-optimized version
    msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );
    
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID );
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice );
    msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours );
    U8 category;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_Category, category);
    mCategory = (ECategory)category;
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID);
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt);
    U8 landing_type;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_LandingType, landing_type);
    mLandingType = (ELandingType)landing_type;

	// New Media Data
	// Note: the message has been converted to TCP
	if(msg->has("MediaData"))
	{
		msg->getString("MediaData", "MediaDesc", buffer);
		setMediaDesc(buffer);
		msg->getString("MediaData", "MediaType", buffer);
		setMediaType(buffer);
		msg->getS32("MediaData", "MediaWidth", mMediaWidth);
		msg->getS32("MediaData", "MediaHeight", mMediaHeight);
		msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
	}
	else
	{
		setMediaType(std::string("")); 	//having mMediaType empty causes autodetect,
						// thats what we want -- AW
		setMediaDesc(std::string("No Description available without Server Upgrade"));
		mMediaLoop = true;
	}

	if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
	{
		msg->getString("MediaLinkSharing", "MediaCurrentURL", buffer);
		setMediaCurrentURL(buffer);
		msg->getU8 ( "MediaLinkSharing", "MediaAllowNavigate", mMediaAllowNavigate );
		msg->getU8 ( "MediaLinkSharing", "MediaURLFilterEnable", mMediaURLFilterEnable );
		msg->getU8 ( "MediaLinkSharing", "MediaPreventCameraZoom", mMediaPreventCameraZoom );
		msg->getF32( "MediaLinkSharing", "MediaURLTimeout", mMediaURLTimeout);
	}
	else
	{
		setMediaCurrentURL(LLStringUtil::null);
	}
	
}
Example #3
0
    //==============================================================================
    FontsAndTextDemo()
        : boldButton ("Bold"),
          italicButton ("Italic"),
          sizeLabel (String::empty, "Size"),
          kerningLabel (String::empty, "Kerning"),
          horizontalScaleLabel (String::empty, "Scale")
    {
        setName ("Fonts");

        Font::findFonts (fonts);

        addAndMakeVisible (listBox = new ListBox ("fonts", this));
        listBox->setRowHeight (28);

        addAndMakeVisible (&textBox);

        textBox.setColour (TextEditor::backgroundColourId, Colours::white);
        textBox.setColour (TextEditor::outlineColourId, Colours::black.withAlpha (0.5f));

        textBox.setMultiLine (true, true);
        textBox.setReturnKeyStartsNewLine (true);
        textBox.setText ("The Quick Brown Fox Jumps Over The Lazy Dog\n\nAa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz 0123456789");

        addAndMakeVisible (&boldButton);
        boldButton.addListener (this);

        addAndMakeVisible (&italicButton);
        italicButton.addListener (this);

        addAndMakeVisible (&sizeSlider);
        sizeSlider.setRange (3.0, 150.0, 0.1);
        sizeSlider.setValue (20.0);
        sizeSlider.addListener (this);
        sizeLabel.attachToComponent (&sizeSlider, true);

        addAndMakeVisible (&kerningSlider);
        kerningSlider.setRange (-1.0, 1.0, 0.01);
        kerningSlider.setValue (0.0);
        kerningSlider.addListener (this);
        kerningLabel.attachToComponent (&kerningSlider, true);

        addAndMakeVisible (&horizontalScaleSlider);
        horizontalScaleSlider.setRange (0.1, 4.0, 0.01);
        horizontalScaleSlider.setValue (1.0);
        horizontalScaleSlider.addListener (this);
        horizontalScaleLabel.attachToComponent (&horizontalScaleSlider, true);

        listBox->setColour (ListBox::outlineColourId, Colours::black.withAlpha (0.5f));
        listBox->setOutlineThickness (1);
        listBox->selectRow (Random::getSystemRandom().nextInt (fonts.size()));

        // set up the layout and resizer bars..

        verticalLayout.setItemLayout (0, -0.2, -0.8, -0.5);  // width of the font list must be
                                                             // between 20% and 80%, preferably 50%
        verticalLayout.setItemLayout (1, 8, 8, 8);           // the vertical divider drag-bar thing is always 8 pixels wide
        verticalLayout.setItemLayout (2, 150, -1.0, -0.5);   // the components on the right must be
                                                             // at least 150 pixels wide, preferably 50% of the total width

        verticalDividerBar = new StretchableLayoutResizerBar (&verticalLayout, 1, true);
        addAndMakeVisible (verticalDividerBar);
    }
Example #4
0
Setup_Joystick::Setup_Joystick(const Widget2 *const widget) :
    SetupTab(widget),
    mCalibrateLabel(new Label(this,
        // TRANSLATORS: joystick settings tab label
        _("Press the button to start calibration"))),
    // TRANSLATORS: joystick settings tab button
    mCalibrateButton(new Button(this, _("Calibrate"), "calibrate",
        BUTTON_SKIN, this)),
    // TRANSLATORS: joystick settings tab button
    mDetectButton(new Button(this, _("Detect joysticks"), "detect",
        BUTTON_SKIN, this)),
    // TRANSLATORS: joystick settings tab checkbox
    mJoystickEnabled(new CheckBox(this, _("Enable joystick"),
        false, nullptr, std::string())),
    mNamesModel(new NamesModel),
    mNamesDropDown(new DropDown(this, mNamesModel,
        false, Modal_false, nullptr, std::string())),
    mUseInactiveCheckBox(new CheckBox(this,
        // TRANSLATORS: joystick settings tab checkbox
        _("Use joystick if client window inactive"),
        config.getBoolValue("useInactiveJoystick"),
        nullptr, std::string())),
    mOriginalJoystickEnabled(config.getBoolValue("joystickEnabled"))
{
    // TRANSLATORS: joystick settings tab name
    setName(_("Joystick"));

    Joystick::getNames(mNamesModel->getNames());

    mJoystickEnabled->setSelected(mOriginalJoystickEnabled);
    mJoystickEnabled->setActionEventId("joystick");
    mJoystickEnabled->addActionListener(this);
    mCalibrateButton->setEnabled(mOriginalJoystickEnabled);

    mNamesDropDown->setActionEventId("name");
    mNamesDropDown->addActionListener(this);

    if (joystick != nullptr)
    {
        mNamesDropDown->setSelected(joystick->getNumber());
    }
    else
    {
        unsigned int sel = config.getIntValue("selectedJoystick");
        if (sel >= CAST_U32(mNamesModel->size()))
            sel = 0;
        mNamesDropDown->setSelected(sel);
    }

    // Do the layout
    LayoutHelper h(this);
    ContainerPlacer place = h.getPlacer(0, 0);

    place(0, 0, mJoystickEnabled, 1, 1);
    place(0, 1, mNamesDropDown, 1, 1);
    place(0, 2, mUseInactiveCheckBox, 1, 1);
    place(0, 3, mDetectButton, 1, 1);
    place(0, 4, mCalibrateLabel, 1, 1);
    place(0, 5, mCalibrateButton, 1, 1);

    setDimension(Rect(0, 0, 365, 75));
}
Example #5
0
OutputData::OutputData(const char* szName) : Node(OUTPUTD) 
{
    modOwner = NULL;
    setName(szName);
}
Example #6
0
Style::Style(const std::string& name, const std::string& style):
_style(style) {
    setName(name);
}
Example #7
0
void finalSpectra(
		 const char* inCentral=
		 "links/P01hi.central.2000.hist/finish_cut88778999_iter3.hist.root",
		 const char* inMinbias=
		 "links/P01hi.minbias.2000.hist/finish_cut97778999_iter3.hist.root",
		 const char* inPeripheral=
		 "links/P01hi.minbias.2000.hist/finish_cut57778999_iter3.hist.root",
		 const char* psDir="psFinal"
		 )
{
  gSystem->Clear();

  TFile* rCentral=new TFile(inCentral);
  TFile* rMinbias=new TFile(inMinbias);
  TFile* rPeripheral=new TFile(inPeripheral);
  
  int DOKLUDGE=1;

 
  //
  // get the graphs
  //
  char name[200],title[200],txt[500];
  char* sign=0; // "Minus"
  int bin=0;

  setName(name,"gSpecCorrected",bin,sign);

  TGraphAsymmErrors* gCentralX=(TGraphAsymmErrors*)rCentral->Get(name);
  TGraphAsymmErrors* gMinbiasX=(TGraphAsymmErrors*)rMinbias->Get(name);
  TGraphAsymmErrors* gPeripheralX=(TGraphAsymmErrors*)rPeripheral->Get(name);
  
  //
  // kludges
  //
  if(DOKLUDGE){
    cout << ">>>>WARNING DOING KLUDGE" << endl;
    cout << ">>>>WARNING DOING KLUDGE" << endl;
    cout << ">>>>WARNING DOING KLUDGE" << endl;

    kludgeBackground(gCentralX,0.08);
    kludgeBackground(gMinbiasX,0.08);
    kludgeBackground(gPeripheralX,0.05);

    kludgeSystematics(gCentralX);
    kludgeSystematics(gMinbiasX);
    kludgeSystematics(gPeripheralX);

  }

  
  // low pt stuff
  TGraphAsymmErrors* gCentralLowPt=makeHMinus(2);
  TGraphAsymmErrors* gMinbiasLowPt=makeHMinus(0);
  TGraphAsymmErrors* gPeripheralLowPt=makeHMinus(1);

  // ua1
  float sigmaUA1_200=42;
  float ua1Scale200 = 2.*3.14159/sigmaUA1_200;

  float sigmaUA1_130=40.5;
  float ua1Scale130= 2.*3.14159/sigmaUA1_130;

  TGraphErrors* gUA1Data200=ua1Data200();
  scale(gUA1Data200,ua1Scale200);

  TF1* fUA1Fit130 = ua1Fit130(ua1Scale130);


  // remove some error bars

  gCentralLowPt=removeXErrors(gCentralLowPt);
  gMinbiasLowPt=removeXErrors(gMinbiasLowPt);
  gPeripheralLowPt=removeXErrors(gPeripheralLowPt);


  //  gStyles
  gStyle->SetOptStat(0); gStyle->SetOptTitle(0);
  gStyle->SetPadTickX(1); 
  gStyle->SetPadTickY(1);
  
  // follow manuel in the fonts
  int font = 42;
  gStyle->SetTextFont(font); gStyle->SetTitleFont(font);
  gStyle->SetLabelFont(font,"x"); gStyle->SetLabelFont(font,"y");
  
  // TLatex
  TLatex* ltx=new TLatex;

  TCanvas* c1=new TCanvas("c1","c1",400,500);

  // draw the spectra
  double xMin=0,xMax=6;
  double yMin=1e-7,yMax=10000;
  double textSize=0.03;
  double titleSize=0.04;
  double markerSize=1;
  double labelSize=0.03;
  double yTitleOffset=1.2;
  double xTitleOffset=0.8;
  double tickSize=9990;
  
  TAxis* axis;

  c1->cd(); gPad->SetLogy(); 

  int centralMarker=29;
  int minbiasMarker=8;
  int peripheralMarker=22;
  int hMinusMarker=21;
  int ua1Marker=4;


  // central
  //
  gCentral=removeXErrors(gCentralX);

  gCentral->SetMinimum(yMin); gCentral->SetMaximum(yMax);
  gCentral->SetMarkerStyle(centralMarker); 
  gCentral->SetMarkerSize(markerSize+.2);
  gCentral->Draw("ap");


  strcpy(txt,"1/p_{T} d^{2}N^{(h^{-}+h^{+})/2}/dp_{T}d#eta #cbar_{|#eta|<0.5}(GeV/c)^{-2}");

  // yaxis
  axis=gCentral->GetYaxis();
  axis->SetTitle(txt);
  axis->SetTitleSize(titleSize);
  axis->SetTitleOffset(yTitleOffset);
  axis->SetLabelSize(labelSize);

  // xaxis
  axis=gCentral->GetXaxis();
  axis->SetTitle("p_{T} (GeV/c)");
  axis->SetTitleSize(titleSize);
  axis->SetTitleOffset(xTitleOffset);
  axis->SetLabelOffset(0.003);
  axis->SetLabelSize(labelSize);
  axis->SetLimits(xMin,xMax);

  
  // low pt central
  gCentralLowPt->SetMarkerStyle(centralMarker);
  gCentralLowPt->SetMarkerSize(markerSize);
  gCentralLowPt->Draw("p");


  // draw bin widths
  // drawAxisBins(gCentralX,tickSize,yMax);
  //  TLine* line=new TLine;
  // line->DrawLineNDC((2/6)*(1./.8)+.1,.8,2/6*(1./.8)+.1 ,.9);


  // minbias
  //
  // remove x errors
  gMinbias=removeXErrors(gMinbiasX);

  gMinbias->SetMarkerStyle(minbiasMarker); 
  gMinbias->SetMarkerSize(markerSize);
  gMinbias->Draw("p");

  gMinbiasLowPt->SetMarkerStyle(minbiasMarker);
  gMinbiasLowPt->SetMarkerSize(markerSize);
  gMinbiasLowPt->Draw("p");

  // peripheral
  //
  // remove x errors
  gPeripheral=removeXErrors(gPeripheralX);

  gPeripheral->SetMarkerStyle(peripheralMarker); 
  gPeripheral->SetMarkerSize(markerSize);
  gPeripheral->Draw("p");

  gPeripheralLowPt->SetMarkerStyle(peripheralMarker);
  gPeripheralLowPt->SetMarkerSize(markerSize);
  gPeripheralLowPt->Draw("p");
  
  // ua1
  //
  

  gUA1Data200->SetMarkerStyle(ua1Marker);
  gUA1Data200->SetMarkerSize(markerSize);

  //fUA1Fit130->SetLineColor();

  gUA1Data200->Draw("p");
  fUA1Fit130->SetRange(.1,6);
  fUA1Fit130->Draw("same");


  //
  // legend
  //
  TLegend* l=new TLegend(0.5,0.7,0.8,0.8);
  l->SetTextSize(textSize);
  l->SetBorderSize(0); l->SetFillColor(4000); // transparent
  l->AddEntry(gCentral,"central 0-5%","p");
  l->AddEntry(gPeripheral,"periperhal 60-80%","p");
  l->AddEntry(gMinbias,"minimum bias","p");  
  l->AddEntry(gUA1Data200,"ua1 200 GeV data","p");
  l->AddEntry(fUA1Fit130,"ua1 130 GeV fit","l");
  l->Draw();

  Print(c1,psDir,"spectra");

}
Example #8
0
 PeakWPK20m()
 {
     setSecs(1200);
     setSymbol("20m_peak_wpk");
     setName(tr("20 min Peak WPK"));
 }
Example #9
0
 PeakWPK30m()
 {
     setSecs(1800);
     setSymbol("30m_peak_wpk");
     setName(tr("30 min Peak WPK"));
 }
Example #10
0
 PeakWPK5m()
 {
     setSecs(300);
     setSymbol("5m_peak_wpk");
     setName(tr("5 min Peak WPK"));
 }
Example #11
0
 PeakWPK10m()
 {
     setSecs(600);
     setSymbol("10m_peak_wpk");
     setName(tr("10 min Peak WPK"));
 }
Example #12
0
 PeakWPK30s()
 {
     setSecs(30);
     setSymbol("30s_peak_wpk");
     setName(tr("30 sec Peak WPK"));
 }
Example #13
0
 PeakWPK20s()
 {
     setSecs(20);
     setSymbol("20s_peak_wpk");
     setName(tr("20 sec Peak WPK"));
 }
Example #14
0
 PeakWPK15s()
 {
     setSecs(15);
     setSymbol("15s_peak_wpk");
     setName(tr("15 sec Peak WPK"));
 }
Example #15
0
Component::Component(const String& name)
: _parent(0), _name(name) {
    setParent(0);
    setName(name);
}
Example #16
0
/*
 *  Constructs a CAdesDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
CAdesDlg::CAdesDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "CAdesDlg" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 20, 20, sizePolicy().hasHeightForWidth() ) );
    setMaximumSize( QSize( 32767, 32767 ) );
    QFont f( font() );
    f.setFamily( "Liberation Mono Track" );
    f.setPointSize( 11 );
    setFont( f ); 
    setSizeGripEnabled( FALSE );

    pAlt1 = new QPushButton( this, "pAlt1" );
    pAlt1->setEnabled( FALSE );
    pAlt1->setGeometry( QRect( 6, 28, 86, 25 ) );
    QFont pAlt1_font(  pAlt1->font() );
    pAlt1_font.setFamily( "Liberation Mono Track" );
    pAlt1_font.setPointSize( 10 );
    pAlt1->setFont( pAlt1_font ); 
    pAlt1->setAutoDefault( TRUE );

    pAlt2 = new QPushButton( this, "pAlt2" );
    pAlt2->setEnabled( FALSE );
    pAlt2->setGeometry( QRect( 6, 58, 86, 25 ) );
    QFont pAlt2_font(  pAlt2->font() );
    pAlt2_font.setFamily( "Liberation Mono Track" );
    pAlt2_font.setPointSize( 10 );
    pAlt2->setFont( pAlt2_font ); 

    pArcid = new QLabel( this, "pArcid" );
    pArcid->setGeometry( QRect( 6, 5, 86, 18 ) );
    QFont pArcid_font(  pArcid->font() );
    pArcid_font.setFamily( "Liberation Mono Track" );
    pArcid_font.setPointSize( 10 );
    pArcid_font.setBold( TRUE );
    pArcid->setFont( pArcid_font ); 
    pArcid->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
    pArcid->setIndent( -1 );

    pListAdes = new QListBox( this, "pListAdes" );
    pListAdes->setGeometry( QRect( 6, 88, 86, 171 ) );
    pListAdes->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, pListAdes->sizePolicy().hasHeightForWidth() ) );
    QFont pListAdes_font(  pListAdes->font() );
    pListAdes_font.setFamily( "Liberation Mono Track" );
    pListAdes_font.setPointSize( 10 );
    pListAdes->setFont( pListAdes_font ); 
    pListAdes->setDragAutoScroll( FALSE );
    pListAdes->setColumnMode( QListBox::FixedNumber );
    pListAdes->setVariableHeight( FALSE );
    languageChange();
    resize( QSize(120, 264).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( pAlt1, SIGNAL( clicked() ), this, SLOT( pAlt1Clicked() ) );
    connect( pAlt2, SIGNAL( clicked() ), this, SLOT( pAlt2Clicked() ) );
    connect( pListAdes, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( pListAdesClicked(QListBoxItem*) ) );
    connect( pListAdes, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( pListAdesClicked(QListBoxItem*) ) );

    // tab order
    setTabOrder( pAlt1, pAlt2 );
    setTabOrder( pAlt2, pListAdes );
}
Example #17
0
Component::Component(Component* p, const String& n)
: _parent(p), _name(n) {
    setParent(p);
    setName(n);
}
Example #18
0
File: cfont.cpp Project: EQ4/vstgui
//-----------------------------------------------------------------------------
CFontDesc::~CFontDesc ()
{
	freePlatformFont ();
	setName (0);
}
Example #19
0
Material::Material() : _normalMap(0)
{
    setName("Material");
}
Example #20
0
bool MailWritePopUpView::initWithSendHeart()
{
    if(!PopupBaseView::init()) {
        return false;
    }
    setIsHDPanel(true);
    mPropID = ITEM_SEND_HEART;
    m_isSendHeartMail = true;
    //    auto cf = CCLoadSprite::getSF("Mail_diban.png");
    auto cf = CCLoadSprite::getSF("Mail_BG1.png");
    if (cf==NULL) {
        CCLoadSprite::doResourceByCommonIndex(11, true);
        CCLoadSprite::doResourceByCommonIndex(6, true);
        setCleanFunction([]() {
            CCLoadSprite::doResourceByCommonIndex(11, false);
            CCLoadSprite::doResourceByCommonIndex(6, false);
        });
    }
    else {
        CCLoadSprite::doResourceByCommonIndex(11, true);
        setCleanFunction([]() {
            CCLoadSprite::doResourceByCommonIndex(11, false);
        });
    }

    auto bg = CCBLoadFile("NEWMailWriteView", this, this);
    if (CCCommonUtils::isIosAndroidPad()) {
        this->setContentSize(CCDirector::sharedDirector()->getWinSize());
    }
    else
        this->setContentSize(bg->getContentSize());
    //    setTitleName(_lang("105513"));
    m_titleText->setString(_lang("150535"));
    if (CCCommonUtils::isIosAndroidPad()) {
        int extH = getExtendHeight();
        this->m_listNode->setContentSize(CCSize(m_listNode->getContentSize().width, m_listNode->getContentSize().height + extH));
        m_downNode->setPositionY(m_downNode->getPositionY() - extH);
        m_bgNode->setPositionY(m_bgNode->getPositionY() - extH);
        //        m_nodeContent->setPositionY(m_nodeContent->getPositionY() - extH);
        auto tbg = CCLoadSprite::loadResource("Mail_diban.png");
        auto tBatchNode = CCSpriteBatchNode::createWithTexture(tbg->getTexture());
        auto picBg1 = CCLoadSprite::createSprite("Mail_diban.png");
        picBg1->setAnchorPoint(ccp(0, 0));
        picBg1->setPosition(ccp(0, 0));
        picBg1->setScaleX(2.4);
        tBatchNode->addChild(picBg1);
        int maxHeight = CCDirector::sharedDirector()->getWinSize().height;
        int curHeight = picBg1->getContentSize().height;
        while(curHeight < maxHeight)
        {
            auto picBg2 = CCLoadSprite::createSprite("Mail_diban.png");
            picBg2->setAnchorPoint(ccp(0, 0));
            picBg2->setPosition(ccp(0, curHeight));
            picBg2->setScaleX(2.4);
            tBatchNode->addChild(picBg2);
            curHeight += picBg2->getContentSize().height;
        }
        m_bgNode->addChild(tBatchNode);
    }
    else {
        int extH = getExtendHeight();
        this->m_listNode->setContentSize(CCSize(m_listNode->getContentSize().width, m_listNode->getContentSize().height + extH));
        m_downNode->setPositionY(m_downNode->getPositionY() - extH);
        m_bgNode->setPositionY(m_bgNode->getPositionY() - extH);
        //        m_nodeContent->setPositionY(m_nodeContent->getPositionY() - extH);
        auto tbg = CCLoadSprite::loadResource("Mail_diban.png");
        auto tBatchNode = CCSpriteBatchNode::createWithTexture(tbg->getTexture());
        auto picBg1 = CCLoadSprite::createSprite("Mail_diban.png");
        picBg1->setAnchorPoint(ccp(0, 0));
        picBg1->setPosition(ccp(0, 0));
        tBatchNode->addChild(picBg1);
        int maxHeight = CCDirector::sharedDirector()->getWinSize().height;
        int curHeight = picBg1->getContentSize().height;
        while(curHeight < maxHeight)
        {
            auto picBg2 = CCLoadSprite::createSprite("Mail_diban.png");
            picBg2->setAnchorPoint(ccp(0, 0));
            picBg2->setPosition(ccp(0, curHeight));
            tBatchNode->addChild(picBg2);
            curHeight += picBg2->getContentSize().height;
        }
        m_bgNode->addChild(tBatchNode);
    }
    //    CCSize wNodeSize = this->m_waitingNode->getContentSize();
    //    m_waitingNode->setContentSize(CCSize(wNodeSize.width,wNodeSize.height + dh));
    //    m_waitingNode->setPositionY(m_waitingNode->getPositionY() - dh*0.5);

    //    this->m_nameText->setString(_lang("105505").c_str());
    //    this->m_titleText->setString(_lang("105503").c_str());
    //    this->m_contentText->setString(_lang("105504").c_str());

    CCNode *searchnode = CCNode::create();
    auto spr1 = CCLoadSprite::createScale9Sprite("button_dark.png");
    CCControlButton *shareBtn = CCControlButton::create(spr1);
    searchnode->addChild(shareBtn);
    shareBtn->addTargetWithActionForControlEvents(this, cccontrol_selector(MailWritePopUpView::onChooseName), CCControlEventTouchUpInside);
    CCSprite* sprIcon = CCLoadSprite::createSprite("search_icon.png");
    CCSize sprSize = sprIcon->getContentSize();
    searchnode->addChild(sprIcon);
    CCCommonUtils::setSpriteMaxSize(sprIcon, 40);
    shareBtn->setPreferredSize(CCSize(60, 60));
    this->m_nameContainer->addChild(searchnode);
    searchnode->setPosition(440, 0);

//    CCScrollView *scrollView = CCScrollView::create(m_listNode->getContentSize());
//    scrollView->setTouchPriority(Touch_Popup_Item);
//    scrollView->setDirection(kCCScrollViewDirectionVertical);
//    m_nodeContent->removeFromParentAndCleanup(false);
//    scrollView->addChild(m_nodeContent);
//    scrollView->setTag(10000);
    m_nameEditBox = InputFieldMultiLine::create(CCSizeMake(380,40),"Mail_write.png",24);
    //    m_nameEditBox->setTouchPriority(Touch_Default);
    m_nameEditBox->setMaxChars(30);
    m_nameEditBox->setPosition(ccp(0, -20));
    m_nameEditBox->setLineNumber(1);
    m_nameEditBox->setFontColor({63,44,27});
    this->m_nameContainer->addChild(m_nameEditBox);
    m_nameEditBox->setEnabled(false);
    m_contentEditBox = InputFieldMultiLine::create(m_contentContainer->getContentSize(),"Mail_write.png",24);
    m_contentEditBox->setTouchPriority(Touch_Default);
    m_contentEditBox->setMaxChars(300);
    m_contentEditBox->setLineNumber(5);
    m_contentEditBox->setPosition(ccp(0, 0));
    m_contentEditBox->setFontColor({63,44,27});
    this->m_contentContainer->addChild(m_contentEditBox);
    m_contentEditBox->setText(_lang("150536"));
    m_contentEditBox->setEnabled(false);
    CCSize liseNodeSize = this->m_listNode->getContentSize() * m_listNode->getScale();
//    MailGiftCell *mailGiftCell = MailGiftCell::create(CCSize(liseNodeSize.width, liseNodeSize.height - 110),mPropID,giftID);
//    scrollView->addChild(mailGiftCell);
//    mailGiftCell->setTag(10000);
//    CCSize cellSize = mailGiftCell->getContentSize();
//    int needH = ceil(cellSize.height + 400);
//    int nowH = m_listNode->getContentSize().height;
//    m_nodeContent->setPosition(ccp(300,cellSize.height + 100));
//    mailGiftCell->setPosition(ccp(0,0));
//    m_listNode->addChild(scrollView);
//    scrollView->setContentSize(CCSize(600,400 + cellSize.height));
//    scrollView->setContentOffset(ccp(0, nowH - needH));

//    if(needH>nowH){
//        scrollView->setTouchEnabled(true);
//    }else{
//        scrollView->setTouchEnabled(false);
//    }

//    if(!m_toName.empty()){
//        m_nameEditBox->setText(m_toName.c_str());
//        m_nameEditBox->setEnabled(false);
//    }

    m_sprMailIcon->setVisible(false);
    auto nodeicon = Node::create();
    nodeicon->setName("nodeicon");
    m_sendBtn->getParent()->addChild(nodeicon);
    nodeicon->setPosition(m_sendBtn->getPosition());
    ActivityController::getInstance()->createGoodsIcon(nodeicon, CC_ITOA(ITEM_SEND_HEART), 40);
    updateBtnStatus();
    return true;
}
Example #21
0
UpcomingEventsWidget::UpcomingEventsWidget( const LastFmEventPtr &event,
                                            QGraphicsItem *parent,
                                            Qt::WindowFlags wFlags )
    : QGraphicsWidget( parent, wFlags )
    , m_mapButton( 0 )
    , m_urlButton( 0 )
    , m_image( new QLabel )
    , m_event( event )
{
    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );

    m_image->setText( i18n("Loading picture...") );
    m_image->setAttribute( Qt::WA_NoSystemBackground );
    m_image->setAlignment( Qt::AlignCenter );
    m_image->setFixedSize( 128, 128 );
    QGraphicsProxyWidget *imageProxy = new QGraphicsProxyWidget( this );
    imageProxy->setWidget( m_image );

    m_attendance   = createLabel();
    m_date         = createLabel();
    m_location     = createLabel();
    m_name         = createLabel();
    m_participants = createLabel();
    m_tags         = createLabel();
    m_venue        = createLabel();

    QGraphicsLinearLayout *buttonsLayout = new QGraphicsLinearLayout( Qt::Horizontal );
    buttonsLayout->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
    if( event && event->venue() && event->venue()->location )
    {
        QPointF geo( event->venue()->location->longitude, event->venue()->location->latitude );
        if( !geo.isNull() )
        {
            m_mapButton = new Plasma::PushButton( this );
            m_mapButton->setMaximumSize( QSizeF( 22, 22 ) );
            m_mapButton->setIcon( KIcon("edit-find") ); // TODO: a map icon would be nice
            m_mapButton->setToolTip( i18n( "View map" ) );
            buttonsLayout->addItem( m_mapButton );
        }
    }

    if( event && event->url().isValid() )
    {
        m_urlButton = new Plasma::PushButton( this );
        m_urlButton->setMaximumSize( QSizeF( 22, 22 ) );
        m_urlButton->setIcon( KIcon("applications-internet") );
        m_urlButton->setToolTip( i18n( "Open Last.fm webpage for this event" ) );
        connect( m_urlButton, SIGNAL(clicked()), this, SLOT(openUrl()) );
        buttonsLayout->addItem( m_urlButton );
    }

    QSizePolicy::Policy minPol = QSizePolicy::Minimum;
    QGraphicsWidget *supportLabel, *venueLabel, *locationLabel, *dateLabel, *attendLabel, *tagsLabel;
    supportLabel  = createLabel( i18nc("@label:textbox Supporing acts for an event", "Supporting:"), minPol );
    venueLabel    = createLabel( i18nc("@label:textbox", "Venue:"), minPol );
    locationLabel = createLabel( i18nc("@label:textbox", "Location:"), minPol );
    dateLabel     = createLabel( i18nc("@label:textbox", "Date:"), minPol );
    attendLabel   = createLabel( i18nc("@label:textbox", "Attending:"), minPol );
    tagsLabel     = createLabel( i18nc("@label:textbox", "Tags:"), minPol );

    QGraphicsGridLayout *infoLayout = new QGraphicsGridLayout;
    infoLayout->addItem( supportLabel, 0, 0 );
    infoLayout->addItem( venueLabel, 1, 0 );
    infoLayout->addItem( locationLabel, 2, 0 );
    infoLayout->addItem( dateLabel, 3, 0 );
    infoLayout->addItem( attendLabel, 4, 0 );
    infoLayout->addItem( tagsLabel, 5, 0 );
    infoLayout->addItem( m_participants, 0, 1 );
    infoLayout->addItem( m_venue, 1, 1 );
    infoLayout->addItem( m_location, 2, 1 );
    infoLayout->addItem( m_date, 3, 1 );
    infoLayout->addItem( m_attendance, 4, 1 );
    infoLayout->addItem( m_tags, 5, 1 );

    QGraphicsGridLayout *layout = new QGraphicsGridLayout;
    layout->addItem( imageProxy, 0, 0, 2, 1, Qt::AlignCenter );
    layout->addItem( m_name, 0, 1 );
    layout->addItem( buttonsLayout, 0, 2, Qt::AlignRight );
    layout->addItem( infoLayout, 1, 1, 1, 2 );
    setLayout( layout );

    QString name = event->name();
    if( event->isCancelled() )
        name = i18nc( "@label:textbox Title for a canceled upcoming event", "<s>%1</s> (Canceled)", name );
    setName( name );
    setDate( event->date() );
    setLocation( event->venue()->location );
    setVenue( event->venue() );
    setAttendance( event->attendance() );
    setParticipants( event->participants() );
    setTags( event->tags() );
    setImage( event->imageUrl(LastFmEvent::Large) );
}
Example #22
0
 // ########## Delegated Constructor ##########
 Person::Person(const char *n, int a) : age (a)  { setName(n); info(); }
Example #23
0
void clientRegister() {
    printf("Please enter your name: ");
    char str[20];
    scanf("%s", str);
    setName(str);
}
Example #24
0
void *HistoryWindow::processEvent(Event *e)
{
    if (e->type() == EventContactDeleted){
        Contact *contact = (Contact*)(e->param());
        if (contact->id() == m_id)
            QTimer::singleShot(0, this, SLOT(close()));
    }
    if (e->type() == EventContactChanged){
        Contact *contact = (Contact*)(e->param());
        if (contact->id() == m_id)
            setName();
    }
    if (e->type() == EventCheckState){
        CommandDef *cmd = (CommandDef*)(e->param());
        if ((cmd->id == CmdHistoryDirection) && ((unsigned)(cmd->param) == m_id)){
            cmd->flags &= ~COMMAND_CHECKED;
            if (m_bDirection)
                cmd->flags |= COMMAND_CHECKED;
            return e->param();
        }
        if (((cmd->id == CmdDeleteMessage) || (cmd->id == CmdCutHistory)) &&
                (cmd->param == m_view) && m_view->currentMessage()){
            cmd->flags &= ~COMMAND_CHECKED;
            return e->param();
        }
        return NULL;
    }
    if (e->type() == EventCommandExec){
        CommandDef *cmd = (CommandDef*)(e->param());
        if ((unsigned)(cmd->param) != m_id)
            return NULL;
        if (cmd->id == CmdHistoryDirection){
            bool bDirection = ((cmd->flags & COMMAND_CHECKED) != 0);
            CorePlugin::m_plugin->setHistoryDirection(bDirection);
            if (bDirection != m_bDirection){
                m_bDirection = bDirection;
                m_page = 0;
                m_states.clear();
                fill();
            }
            return e->param();
        }
        if (cmd->id == CmdHistoryNext){
            if (m_page + 1 < m_states.size()){
                m_page++;
                fill();
            }
            return e->param();
        }
        if (cmd->id == CmdHistoryPrev){
            if (m_page > 0){
                m_page--;
                fill();
            }
            return e->param();
        }
        if (cmd->id == CmdHistoryFind){
            m_filter = "";
            if (cmd->flags & COMMAND_CHECKED){
                Command cmd;
                cmd->id		= CmdHistoryFind;
                cmd->param	= (void*)m_id;
                Event eWidget(EventCommandWidget, cmd);
                CToolCombo *cmbFind = (CToolCombo*)(eWidget.process());
                if (cmbFind){
                    QString text = cmbFind->lineEdit()->text();
                    if (!text.isEmpty()){
                        addHistory(text);
                        m_filter = text;
                    }
                }
            }
            m_page = 0;
            m_states.clear();
            m_view->setSelect(m_filter);
            fill();
            return e->param();
        }
    }
    return NULL;
}
Example #25
0
void LLParcel::init(const LLUUID &owner_id,
                    BOOL modify, BOOL terraform, BOOL damage,
                    time_t claim_date, S32 claim_price_per_meter,
                    S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus,
                    BOOL is_group_owned)
{
	mID.setNull();
	mOwnerID			= owner_id;
	mGroupOwned			= is_group_owned;
	mClaimDate			= claim_date;
	mClaimPricePerMeter	= claim_price_per_meter;
	mRentPricePerMeter	= rent_price_per_meter;
	mArea				= area;
	mDiscountRate		= 1.0f;
	mDrawDistance		= 512.f;

	mUserLookAt.setVec(0.0f, 0.f, 0.f);
	// Default to using the parcel's landing point, if any.
	mLandingType = L_LANDING_POINT;

	// *FIX: if owner_id != null, should be owned or sale pending,
	// investigate init callers.
	mStatus = OS_NONE;
	mCategory = C_NONE;
	mAuthBuyerID.setNull();
	//mBuyerID.setNull();
	//mJoinNeighbors = 0x0;
	mSaleTimerExpires.setTimerExpirySec(0);
	mSaleTimerExpires.stop();
	mGraceExtension = 0;
	//mExpireAction = STEA_REVERT;
	mRecordTransaction = FALSE;

	mAuctionID = 0;
	mInEscrow = false;

	mParcelFlags = PF_DEFAULT;
	setParcelFlag(PF_CREATE_OBJECTS,  modify);
	setParcelFlag(PF_ALLOW_TERRAFORM, terraform);
	setParcelFlag(PF_ALLOW_DAMAGE,    damage);

	mSalePrice			= 10000;
	setName(LLStringUtil::null);
	setDesc(LLStringUtil::null);
	setMusicURL(LLStringUtil::null);
	setMediaURL(LLStringUtil::null);
	setMediaDesc(LLStringUtil::null);
	setMediaType(LLStringUtil::null);
	mMediaID.setNull();
	mMediaAutoScale = 0;
	mMediaLoop = TRUE;
	mMediaWidth = 0;
	mMediaHeight = 0;
	setMediaCurrentURL(LLStringUtil::null);
	mMediaURLFilterEnable = FALSE;
	mMediaURLFilterList = LLSD::emptyArray();
	mMediaAllowNavigate = TRUE;
	mMediaURLTimeout = 0.0f;
	mMediaPreventCameraZoom = FALSE;

	mGroupID.setNull();

	mPassPrice = PARCEL_PASS_PRICE_DEFAULT;
	mPassHours = PARCEL_PASS_HOURS_DEFAULT;

	mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER);
	mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER);

	mLocalID = 0;

	//mSimWidePrimCorrection = 0;
	setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS)));
	setSimWideMaxPrimCapacity(0);
	setSimWidePrimCount(0);
	setOwnerPrimCount(0);
	setGroupPrimCount(0);
	setOtherPrimCount(0);
	setSelectedPrimCount(0);
	setTempPrimCount(0);
	setCleanOtherTime(0);
    setRegionPushOverride(FALSE);
    setRegionDenyAnonymousOverride(FALSE);
    setRegionDenyAgeUnverifiedOverride(FALSE);
	setParcelPrimBonus(parcel_object_bonus);

	setPreviousOwnerID(LLUUID::null);
	setPreviouslyGroupOwned(FALSE);
}
Example #26
0
MedianBlur::MedianBlur()
{
    setName("Median");
    setDesc(QObject::tr("Smoothes an image using median filter"));
    setGroup("image/smoothing");
}
Example #27
0
GR_CocoaImage::GR_CocoaImage(const char * szName)
  : m_surface(NULL),
    m_grtype(GRT_Raster) // Probably the safest default.
{
	setName (szName ? szName : "CocoaImage");
}
Example #28
0
Component::Component(const Component& o)
: _parent(o._parent), _name(o._name) {
    setParent(o.parent());
    setName(o.name());
}
Example #29
0
 FilePath& FilePath::operator=(const std::string& pName)
 {
   setName(pName);
   return *this;
 }
Example #30
0
 PeakWPK5s()
 {
     setSecs(5);
     setSymbol("5s_peak_wpk");
     setName(tr("5 sec Peak WPK"));
 }