Ejemplo n.º 1
0
void TextDialog::initValues() {
  char* title = StrOp.fmt( "%s %s", (const char*)wxGetApp().getMsg("text").mb_str(wxConvUTF8), wText.getid( m_Props ) );
  SetTitle( wxString(title,wxConvUTF8) );
  StrOp.free( title );

  // General
  m_ID->SetValue( wxString(wText.getid( m_Props ),wxConvUTF8) );
  m_Text->SetValue( wxString(wText.gettext( m_Props ),wxConvUTF8) );
  m_Tip->SetValue( wxString(wText.getdesc( m_Props ),wxConvUTF8) );
  char* str = StrOp.fmt( "%d", wText.getpointsize( m_Props ) );
  m_Pointsize->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );


  m_Bold->SetValue( wText.isbold( m_Props) );
  m_Underlined->SetValue( wText.isunderlined( m_Props) );
  m_Border->SetValue( wText.isborder( m_Props) );
  m_Italic->SetValue( wText.isitalic( m_Props ) );
  m_Transparent->SetValue( wText.istransparent( m_Props ) );
  m_Input->SetValue( wText.ismanualinput( m_Props ) );
  m_Reset->SetValue( wText.isreset( m_Props ) );
  m_Clock->SetValue(wText.isclock( m_Props )?true:false);

  wxColour color( wText.getred(m_Props), wText.getgreen(m_Props), wText.getblue(m_Props) );
  m_Color->SetBackgroundColour(color);
  wxColour bcolor( wText.getbackred(m_Props), wText.getbackgreen(m_Props), wText.getbackblue(m_Props) );
  m_Background->SetBackgroundColour(bcolor);

  if( StrOp.equals( wText.getori(m_Props), wItem.north ) )
    m_Ori->SetSelection(1);
  else if( StrOp.equals( wText.getori(m_Props), wItem.south ) )
    m_Ori->SetSelection(2);
  else
    m_Ori->SetSelection(0);

  // Interface
  m_IID->SetValue( wxString(wText.getiid( m_Props ),wxConvUTF8) );
  m_Bus->SetValue( wxString::Format(wxT("%d"), wText.getbus( m_Props )) );
  m_Address->SetValue( wText.getaddr( m_Props ) );
  m_Display->SetValue( wText.getdisplay( m_Props ) );

  // Location
  str = StrOp.fmt( "%d", wText.getx( m_Props ) );
  m_x->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );
  str = StrOp.fmt( "%d", wText.gety( m_Props ) );
  m_y->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );
  str = StrOp.fmt( "%d", wText.getz( m_Props ) );
  m_z->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );
  str = StrOp.fmt( "%d", wText.getcx( m_Props ) );
  m_Cx->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );
  str = StrOp.fmt( "%d", wText.getcy( m_Props ) );
  m_Cy->SetValue( wxString(str,wxConvUTF8) ); StrOp.free( str );

}
Ejemplo n.º 2
0
void cfill(char *s){
	int k=bcolor(s);
	if(k>=0) e1->backgr=k;
}
Ejemplo n.º 3
0
void color(char *s){
	e1->foregr=bcolor(s);
}
Ejemplo n.º 4
0
PixelColor makeColor(HumdrumFile& infile, int line, int spine, int style,
      Array<int>& rhylev, int track) {
   PixelColor output;
   int trackCount;
   PerlRegularExpression pre;
   const char* instrument = "";

   PixelColor purple     (225, 121, 255);
   PixelColor yellowgreen(150, 200,   0);

   switch (toupper(style)) {
      case 'M':    // color by metric position
         if (rhylev[line] >= 2) {
            output.setColor("red");
         } else if (rhylev[line] == 1) {
            output.setColor("lightorange");
         } else if (rhylev[line] == 0) {
            output.setColor("yellow");
         } else if (rhylev[line] == -1) {
            output.setColor("green");
         } else if (rhylev[line] == -2) {
            output.setColor("blue");
         } else if (rhylev[line] <= -3) {
            output.setColor("violet");
         } else {
            output.setColor("silver");
         }
         break;

      case 'V':    // color spines by voice
         instrument = getInstrument(infile, track);
         if (pre.search(instrument, "Bassus", "i")) {
            output.setColor("red");
         } else if (pre.search(instrument, "Contra", "i")) {
            output.setColor("darkorange");
         } else if (pre.search(instrument, "Tenor", "i")) {
            output.setColor("blue");
         } else if (pre.search(instrument, "Altus", "i")) {
            output = purple;
         } else if (pre.search(instrument, "Superius", "i")) {
            output.setColor("limegreen");
         } else if (pre.search(instrument, "Cantus", "i")) {
            output.setColor("limegreen");
         } else if (pre.search(instrument, "Discantus", "i")) {
            output = yellowgreen;
         } else {
            output.setColor("black");
         }
         break;
         
      case 'H':    // color spines by hue
      default:
         trackCount = infile.getMaxTracks();
         output.setHue(((int)infile[line].getTrack(spine))/(double)trackCount);
   }

   PixelColor bcolor(bgcolor);
   double csum = (bcolor.Red + bcolor.Green + bcolor.Blue)/(255*3);
   if (csum > 0.5) {
      output.Red = output.Red / 2;
      output.Green = output.Green / 2;
      output.Blue = output.Blue / 2;
   }

   return output;
}