Exemplo n.º 1
0
MediaRoutingView::MediaRoutingView(
	RouteAppNodeManager *nodeManager,
	BRect frame,
	const char *name,
	uint32 resizeMode)
	: DiagramView(frame, "MediaRoutingView", true, B_FOLLOW_ALL_SIDES),
	  manager(nodeManager),
	  m_layout(M_ICON_VIEW),
	  m_nextGroupNumber(1),
	  m_lastDroppedNode(0),
	  m_draggedWire(0)
{
	D_METHOD(("MediaRoutingView::MediaRoutingView()\n"));
	ASSERT(manager);

	setBackgroundColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
	setItemAlignment(5.0, 5.0);
	_initLayout();
}
Exemplo n.º 2
0
void FileTransferWidget::onFileTransferPaused(ToxFile file)
{
    if (fileInfo != file)
        return;

    fileInfo = file;

    ui->etaLabel->setText("");
    ui->progressLabel->setText(tr("Paused", "file transfer widget"));

    // reset mean
    meanIndex = 0;
    for (size_t i=0; i<TRANSFER_ROLLING_AVG_COUNT; ++i)
        meanData[i] = 0.0;

    setBackgroundColor(Style::getColor(Style::LightGrey), false);

    setupButtons();
}
Exemplo n.º 3
0
IUINodeMap::IUINodeMap (IFrontend *frontend, ServiceProvider& serviceProvider, CampaignManager& campaignManager, int x, int y, int width, int height, ClientMap& map) :
		UINode(frontend), _map(map), _campaignManager(campaignManager)
{
	Commands.registerCommand(CMD_CL_CONNECT, new CmdConnect(&_map, serviceProvider));
	Commands.registerCommand(CMD_CL_DISCONNECT, new CmdDisconnect(serviceProvider));
	Commands.registerCommand(CMD_MOVE_UP, new CmdMove(_map, DIRECTION_UP));
	Commands.registerCommand(CMD_MOVE_DOWN, new CmdMove(_map, DIRECTION_DOWN));
	Commands.registerCommand(CMD_ZOOM, new CmdZoom(_map));
	Commands.registerCommand(CMD_MOVE_LEFT, new CmdMove(_map, DIRECTION_LEFT));
	Commands.registerCommand(CMD_MOVE_RIGHT, new CmdMove(_map, DIRECTION_RIGHT));

	ProtocolHandlerRegistry& r = ProtocolHandlerRegistry::get();
	r.registerClientHandler(protocol::PROTO_CHANGEANIMATION, new ChangeAnimationHandler(_map));
	r.registerClientHandler(protocol::PROTO_MAPRESTART, new MapRestartHandler(_map));
	r.registerClientHandler(protocol::PROTO_PAUSE, new PauseHandler(_map));
	r.registerClientHandler(protocol::PROTO_UPDATEENTITY, new UpdateEntityHandler(_map));
	r.registerClientHandler(protocol::PROTO_REMOVEENTITY, new RemoveEntityHandler(_map));
	r.registerClientHandler(protocol::PROTO_SOUND, new SoundHandler());
	r.registerClientHandler(protocol::PROTO_BACKTOMAIN, new BackToMainHandler());
	r.registerClientHandler(protocol::PROTO_RUMBLE, new RumbleHandler(_map));
	r.registerClientHandler(protocol::PROTO_PLAYERLIST, new PlayerListHandler(this));
	r.registerClientHandler(protocol::PROTO_MESSAGE, new TextMessageHandler(this));
	r.registerClientHandler(protocol::PROTO_CLOSEMAP, new CloseMapHandler(_map));
	r.registerClientHandler(protocol::PROTO_LOADMAP, new HudLoadMapHandler(_map, serviceProvider));
	r.registerClientHandler(protocol::PROTO_MAPSETTINGS, new HudMapSettingsHandler(_map));
	r.registerClientHandler(protocol::PROTO_INITWAITING, new InitWaitingMapHandler(serviceProvider));
	r.registerClientHandler(protocol::PROTO_STARTMAP, new StartMapHandler());
	r.registerClientHandler(protocol::PROTO_UPDATEHITPOINTS, new UpdateHitpointsHandler());
	r.registerClientHandler(protocol::PROTO_UPDATELIVES, new UpdateLivesHandler(campaignManager));
	r.registerClientHandler(protocol::PROTO_UPDATEPOINTS, new UpdatePointsHandler());
	r.registerClientHandler(protocol::PROTO_TIMEREMAINING, new TimeRemainingHandler());
	r.registerClientHandler(protocol::PROTO_FINISHEDMAP, new FinishedMapHandler(_map));

	_campaignManager.addListener(this);

	setBackgroundColor(colorNull);

	const float w = static_cast<float>(_frontend->getWidth());
	const float h = static_cast<float>(_frontend->getHeight());
	setPos(_map.getX() / w, _map.getY() / h);
	setSize(_map.getWidth() / w, _map.getHeight() / h);
}
OpenGLPage::OpenGLPage()
{
    ProgramSettings* settings = new ProgramSettings();
    QGridLayout* openglConfigLayout = new QGridLayout();
    QLabel* shadingmodetitle = new QLabel(tr("Shading Mode (0-3)"));
    QSpinBox* shadingmode = new QSpinBox();

    shadingmode->setMaximum(3);
    shadingmode->setMinimum(0);
    shadingmode->setValue(settings->value("opengl/shadingmode").toInt());
    QObject::connect(shadingmode, SIGNAL(valueChanged(int)),
                     settings, SLOT(setShadingMode(int)));

    QLabel* ambientlighttitle = new QLabel(tr("Ambient Light Intensity"));
    QSpinBox* ambientlight = new QSpinBox();

    ambientlight->setMaximum(100);
    ambientlight->setMinimum(0);
    ambientlight->setValue(settings->value("opengl/ambientlight").toInt());
    QObject::connect(ambientlight, SIGNAL(valueChanged(int)),
                     settings, SLOT(setAmbientLight(int)));

    QLabel* backgroundcolortitle = new QLabel(tr("Background Color"));
    QComboBox* backgroundcolor = new QComboBox();

    backgroundcolor->addItem(tr("blue"));
    backgroundcolor->addItem(tr("red"));
    backgroundcolor->addItem(tr("green"));
    backgroundcolor->addItem(tr("brown"));
    backgroundcolor->setCurrentIndex(backgroundcolor->findText(settings->value("opengl/backgroundcolor").toString()));
    QObject::connect(backgroundcolor, SIGNAL(currentIndexChanged(QString)),
                     settings, SLOT(setBackgroundColor(QString)));

    openglConfigLayout->addWidget(shadingmodetitle, 1, 1);
    openglConfigLayout->addWidget(shadingmode, 1, 2);
    openglConfigLayout->addWidget(ambientlighttitle, 2, 1);
    openglConfigLayout->addWidget(ambientlight, 2, 2);
    openglConfigLayout->addWidget(backgroundcolortitle, 3, 1);
    openglConfigLayout->addWidget(backgroundcolor, 3, 2);

    setLayout(openglConfigLayout);
}
// Canvas functions
Canvas::Canvas( int width, int height, const char * windowTitle ) {
	
	// initialize openGL and everything
	glutWin initw(	height, width, 20, 20,
					GLUT_SINGLE | GLUT_RGB,
					windowTitle );
	
	// make sure the frustum is set up properly
	setWindow( 0.0f, (float)width, 0.0f, (float)height );
	setViewPort( 0, width, 0, height );
	
	// set turtle position
	currPos = Point2( 0.0f, 0.0f );
	currDir = 0.0f;

	// set initial colors
	setBackgroundColor( 0.0f, 0.0f, 0.0f );
	setColor( 1.0f, 0.0f, 0.0f );
	
}
Exemplo n.º 6
0
//==================================================================
KCharSelectTable::KCharSelectTable( QWidget *parent, const char *name, const QString &_font,
				    const QChar &_chr, int _tableNum )
    : QGridView( parent, name ), vFont( _font ), vChr( _chr ),
      vTableNum( _tableNum ), vPos( 0, 0 ), focusItem( _chr ), focusPos( 0, 0 ), d(0)
{
    setBackgroundColor( colorGroup().base() );

    setCellWidth( 20 );
    setCellHeight( 25 );

    setNumCols( 32 );
    setNumRows( 8 );

    repaintContents( false );
    
    setToolTips();

    setFocusPolicy( QWidget::StrongFocus );
    setBackgroundMode( QWidget::NoBackground );
}
Exemplo n.º 7
0
void LogLineBox::SetColor(QColor color)
{
  setBackgroundColor(color);
  line_cart_label->setBackgroundColor(color);
  line_cut_label->setBackgroundColor(color);
  line_group_label->setBackgroundColor(color);
  line_trans_label->setBackgroundColor(color);
  line_title_label->setBackgroundColor(color);
  line_description_label->setBackgroundColor(color);
  line_artist_label->setBackgroundColor(color);
  line_outcue_label->setBackgroundColor(color);
  line_time_label->setBackgroundColor(color);
  line_length_label->setBackgroundColor(color);
  line_talktime_label->setBackgroundColor(color);
  line_up_label->setBackgroundColor(color);
  line_position_bar->setBackgroundColor(QColor(lightGray));
  line_down_label->setBackgroundColor(color);
  line_comment_label->setBackgroundColor(color);
  line_icon_label->setBackgroundColor(color);
}
Exemplo n.º 8
0
QIMPenWidget::QIMPenWidget( QWidget *parent )
 : QWidget( parent )
{
    charSets.setAutoDelete( TRUE );
    inputStroke = 0;
    outputChar = 0;
    outputStroke = 0;
    mode = Waiting;
    currCharSet = 0;
    readOnly = FALSE;
    strokes.setAutoDelete( TRUE );

    timer = new QTimer(this);
    connect( timer, SIGNAL(timeout()), SLOT(timeout()));

    setBackgroundColor( qApp->palette().color( QPalette::Active,
                                               QColorGroup::Base ) );
    strokeColor = black;
    setFixedHeight( 75 );
}
Exemplo n.º 9
0
int eButton::setProperty(const eString &prop, const eString &value)
{
	if (prop=="foregroundColor")
	{
		normalF=eSkin::getActive()->queryColor(value);
		setForegroundColor(normalF);
	}
	else if (prop=="backgroundColor")
	{
		normalB=eSkin::getActive()->queryColor(value);
		setBackgroundColor(normalB);
	}
	if (prop=="activeForegroundColor")
		focusF=eSkin::getActive()->queryColor(value);
	else if (prop=="activeBackgroundColor")
		focusB=eSkin::getActive()->queryColor(value);
	else
		return eLabel::setProperty(prop, value);
	return 0;
}
Exemplo n.º 10
0
PortfolioView::PortfolioView(AtlanticCore *core, Player *player, QColor activeColor, QColor inactiveColor, QWidget *parent, const char *name) : QWidget(parent, name)
{
	m_atlanticCore = core;
	m_player = player;
	m_activeColor = activeColor;
	m_inactiveColor = inactiveColor;
	m_lastPE = 0;

	qpixmap = 0;
	b_recreate = true;

	m_portfolioEstates.setAutoDelete(true);
	setBackgroundColor(Qt::white);
	setMinimumHeight(ICONSIZE);

	// Init icon
	m_image = 0;
	m_imageName = "hamburger.png";
	loadIcon();
}
Exemplo n.º 11
0
    bool Label::setProperty(std::string property, const std::string& value)
    {
        property = toLower(property);

        if (property == "configfile")
        {
            load(value);
        }
        else if (property == "text")
        {
            std::string text;
            decodeString(value, text);
            setText(text);
        }
        else if (property == "textcolor")
        {
            setTextColor(extractColor(value));
        }
        else if (property == "textsize")
        {
            setTextSize(atoi(value.c_str()));
        }
        else if (property == "backgroundcolor")
        {
            setBackgroundColor(extractColor(value));
        }
        else if (property == "autosize")
        {
            if ((value == "true") || (value == "True"))
                setAutoSize(true);
            else if ((value == "false") || (value == "False"))
                setAutoSize(false);
            else
                TGUI_OUTPUT("TGUI error: Failed to parse 'AutoSize' property.");
        }
        else // The property didn't match
            return ClickableWidget::setProperty(property, value);

        // You pass here when one of the properties matched
        return true;
    }
Exemplo n.º 12
0
Load::Load( QWidget *parent, const char *name, WFlags f )
    : QWidget( parent, name, f )
{
    setMinimumHeight( 30 );
    setBackgroundColor( black );
    points = 100;
    setMinimumWidth( points );
    userLoad = new double [points];
    systemLoad = new double [points];
    for ( int i = 0; i < points; i++ ) {
	userLoad[i] = 0.0;
	systemLoad[i] = 0.0;
    }
    maxLoad = 1.3;
    QTimer *timer = new QTimer( this );
    connect( timer, SIGNAL(timeout()), SLOT(timeout()) );
    timer->start( 2000 );
    gettimeofday( &last, 0 );
    first = TRUE;
    timeout();
}
Exemplo n.º 13
0
	Label::Label(int x, int y, int width, int height, Widget* parent) :
		Widget(x, y, width, height, parent), 
		mustCalcStrSize(true),
		caption(""),
		font(NULL),
		autoSizeX(false),
		autoSizeY(false),
		multiLine(false),
		horizontalAlignment(HA_LEFT),
		verticalAlignment(VA_TOP)
	{
		if(!font)
		{
			this->font = Engine::getSingleton().getDefaultFont();
		} else {
			this->font = font;
		}
		//calcStrSize();
		setDrawBackground();
		setBackgroundColor(0xffff00ff);
	}
Exemplo n.º 14
0
DiagramCanvas::DiagramCanvas( QWidget *parent, const char *name, bool r )
    : QWidget( parent, name ), buffer( width(), height() )
{
	readOnly = r;

	initialize_colors();
	setBackgroundColor( CANVAS );
	buffer.resize( 600, 600 );
	buffer.fill( CANVAS );
	setBackgroundMode( QWidget::NoBackground );
	setMouseTracking( TRUE );
	edge_creation_in_progress = FALSE;
	vertex_drag_in_progress = FALSE;
	proximity_tolerance = 3;
	num_arcs = 0;
	num_links = 0;
	num_cuffs = 0;
	untouched = TRUE;
	drill_on = FALSE;

}
Exemplo n.º 15
0
UINodeServerSelector::UINodeServerSelector (IFrontend *frontend, int rows) :
		Super(frontend, 1, rows)
{
	_headlineFont = getFont(HUGE_FONT);
	_headlineHeight = _headlineFont->getCharHeight();
	setBackgroundColor(backgroundColor);
	setSize(0.8f, 0.6f);
	setScrollingEnabled(true);
	setPageVisible(false);
	setAlignment(NODE_ALIGN_CENTER | NODE_ALIGN_MIDDLE);
	setId("server-selector");
	setFont(HUGE_FONT);
	setRowHeight(getFontHeight() / static_cast<float>(_frontend->getHeight()));
	_mouseWheelScrollAmount = _rowHeight * _frontend->getHeight() * 5;
	Vector4Set(colorWhite, _fontColor);
	reset();
	setRowSpacing(2);
	_entryOffsetY = _headlineHeight;
	_colWidth = _size.x;
	setAutoColsRows();
}
Exemplo n.º 16
0
GlassViewer::GlassViewer() : gcn::Widget(), GlassWidget(this) {
	model = (residx_t)-1;
	world = false;
	SET_VEC3(camPos, 0, 0, 0);
	SET_VEC3(position, 0, 0, 0);
	SET_VEC3(target, 0, 1, 0);
	angle = 0;
	dAngle = 1;
	distance = 20;
	fov = 90;
	animState = "";
	mAutoRotate = false;
	mOpaque = true;
	mMousePressed = false;
	setBackgroundColor(gcn::Color(128,128,128));
	
	setFocusable(true);
	
	addMouseListener((GlassWidget*)this);
	addKeyListener((GlassWidget*)this);
}
Exemplo n.º 17
0
WinnerMenu::WinnerMenu(AWidget *parent) :
  AMenu(parent)
{
	_newGame = new Button(this);
	_winner = new Text(this);

	_newGame->setSize(sf::Vector2f(250, 50));
	_newGame->setPosition(sf::Vector2f(125, 225));
	_newGame->setBackgroundTexture("../Assets/button_select.png");
	_newGame->setFont("../Assets/fontBambo.ttf");
	_newGame->setFontSize(30);
	_newGame->setText("Nouvelle partie");
	_newGame->setAction([this](){_gameInstance->restart();});
	_winner->setPosition(sf::Vector2f(300, 300));
	_winner->setFont("../Assets/fontBambo.ttf");
	_winner->setColor(sf::Color::Red);
	_winner->setFontSize(42);
  setPosition(sf::Vector2f(149, 249));
  setSize(sf::Vector2f(500, 300));
  setBackgroundColor(sf::Color(0, 0, 0, 127));
}
Exemplo n.º 18
0
GlassWindow::GlassWindow() : gcn::Window(), GlassWidget(this), wmhandler() {
	titleBar = gcn::Image::load("/gui/standard/bar_gradient.png");
	mTitleBarHeight = titleBar->getHeight()+3;
	titleBarContainer._setParent(this);
	setAlignment(gcn::Graphics::LEFT);
	shadeState = SH_OPEN;
	titleVisible = true;
	mGradient = false;
	frame = NULL;
	mBorder = 0;
	
	setBackgroundColor(gcn::Color(213,213,213));
	
	wmhandler.setWindow(this);
	
	buildTitleBar(WT_ALL);
	
	//for GlassWidget
	addActionListener(this);
	addFocusListener(this);
	gui->addGlobalKeyListener(this);
}
Exemplo n.º 19
0
void eButton::lostFocus()
{
#ifndef DISABLE_LCD
	if (parent && parent->LCDElement)
	{
		if (LCDTmp)
		{
			delete LCDTmp;
			LCDTmp = 0;
			if (tmpDescr)
			{
				delete tmpDescr;
				tmpDescr=0;
			}
		}
		else
			parent->LCDElement->setText("");	
	}
#endif
	setForegroundColor(normalF,false);
	setBackgroundColor(normalB);
}
Exemplo n.º 20
0
LedMeter::LedMeter(QWidget *parent, bool blueState) : ACLevelMeter(parent) {
	setBackgroundColor(black);
	QBoxLayout * l = new QVBoxLayout( this );
	l->setAutoAdd(TRUE);
	for(int i=0;i<12;i++) {
		QColor c;
		if(blueState)
			c = blue;
		else {
			c = red;
			if(i>=2) c = yellow;
			if(i>=5) c = green;
		}

		// put each led in its own frame, since it seems to be broken
		QFrame *lframe = new QFrame(this);
		QBoxLayout *lfl = new QVBoxLayout( lframe );
		lfl->setAutoAdd(TRUE);
		leds[i] =
			new KLed(c,KLed::Off, KLed::Sunken, KLed::Circular,lframe);
	}
}
Exemplo n.º 21
0
BEGIN_NAMESPACE_MW



/**********************************************************************
 *                  StimulusDisplay Methods
 **********************************************************************/
StimulusDisplay::StimulusDisplay(bool drawEveryFrame, bool announceIndividualStimuli) :
    current_context_index(-1),
    mainDisplayRefreshRate(0.0),
    currentOutputTimeUS(-1),
    announceIndividualStimuli(announceIndividualStimuli),
    announceStimuliOnImplicitUpdates(true),
    drawEveryFrame(drawEveryFrame)
{
    // defer creation of the display chain until after the stimulus display has been created
    display_stack = shared_ptr< LinkedList<StimulusNode> >(new LinkedList<StimulusNode>());
    
	setDisplayBounds();
    setBackgroundColor(0.5, 0.5, 0.5);

    opengl_context_manager = OpenGLContextManager::instance();
    clock = Clock::instance();

    waitingForRefresh = false;
    needDraw = false;
    
    if (kCVReturnSuccess != CVDisplayLinkCreateWithActiveCGDisplays(&displayLink) ||
        kCVReturnSuccess != CVDisplayLinkSetOutputCallback(displayLink,
                                                           &StimulusDisplay::displayLinkCallback,
                                                           this))
    {
        throw SimpleException("Unable to create display link");
    }
        
    stateSystemNotification = shared_ptr<VariableCallbackNotification>(new VariableCallbackNotification(boost::bind(&StimulusDisplay::stateSystemCallback, this, _1, _2)));
    state_system_mode->addNotification(stateSystemNotification);
}
Exemplo n.º 22
0
// Customize a few OPenGL states to fit the application's needs
void Application::customizeStates() {
    // Puts the window top-left corner at the following coordinates
    // Resizing doesn't impact so it is not very usefull
    //putenv("SDL_VIDEO_WINDOW_POS=100,0");

    // Glew initialisation : to register all available extentions
    GLenum glewError = glewInit();
    if (glewError != GLEW_OK)
        cerr << "GLEW Error : " << glewGetErrorString(glewError) << endl;

    // Mouse motion will not generate events
    // Instead we will check the position ourselves when we need them
    SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);

    // Initialization of the m_bShowMouse position in the middle of the window

    // WarpMouse changes the mouse position and
    // generates motion events which we need to ignore.
    SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
    SDL_WarpMouse(m_width / 2, m_height / 2);
    // After, we can reactivate the m_bShowMouse motion events
    // But we instead choose to check directly the position
    // ourselves when we need it (in the camera update)
    // It is better then to disable the unused events
    SDL_EventState(SDL_MOUSEMOTION, SDL_ENABLE);

    // Depth test
    glEnable(GL_DEPTH_TEST);
    
    // Decides the background color used after this call
    setBackgroundColor(Color::BLACK);
    
    // Sets the with of the lines
    glLineWidth(2);
    
    // Disables culling
    //glDisable(GL_CULL_FACE);
}
Exemplo n.º 23
0
MenuColumn::MenuColumn( QWidget* parent,
                        const QString& name,
                        const QColor& bg,
                        const QColor& hl )
    : QFrame( parent, name ? name : "GenericMenuColumn" ), m_name( name )
{
    setFrameStyle( QFrame::Plain | QFrame::MenuBarPanel );
    m_mainLay = new QVBoxLayout( this );
    m_compLay = new QVBoxLayout();
    m_mainLay->addLayout( m_compLay );

    if( !m_name.isNull() )
        loadItems();

    // override color
    if( bg.isValid() )
        setBackgroundColor( bg );
    if( hl.isValid() )
        setHighlightColor( hl );


    setPaletteBackgroundColor( backgroundColor() );
}
Exemplo n.º 24
0
KstViewLegend::KstViewLegend()
: KstBorderedViewObject("Legend") {
  _fallThroughTransparency = false;
  _container = false;
  _rotation = 0;
  _vertical = true;
  _fontName = KstApp::inst()->defaultFont();
  _isResizable = false;
  setForegroundColor(KstSettings::globalSettings()->foregroundColor);
  setBorderColor(KstSettings::globalSettings()->foregroundColor);
  setBackgroundColor(KstSettings::globalSettings()->backgroundColor);
  setBorderWidth(2);
  _legendMargin = 5;
  _fontSize = -1;  
  setFontSize(0);
  _layoutActions &= ~(MoveTo | Copy | CopyTo);
  _standardActions |= Delete | Edit;
  _parsedTitle = 0L;
  _trackContents = true;
  reparseTitle();
  computeTextSize();
  setDirty(false);
}
LLInventoryPanel::LLInventoryPanel(const std::string& name,
								    const std::string& sort_order_setting,
									const LLRect& rect,
									LLInventoryModel* inventory,
									BOOL allow_multi_select,
									LLView *parent_view) :
	LLPanel(name, rect, TRUE),
	mInventoryObserver(NULL),
	mCompletionObserver(NULL),
	mFolderRoot(NULL),
	mScroller(NULL),
	mSortOrderSetting(sort_order_setting),
	mInventory(inventory),
	mAllowMultiSelect(allow_multi_select),
	mViewsInitialized(false),
	mInvFVBridgeBuilder(NULL)
{
	mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;

	setBackgroundColor(gColors.getColor("InventoryBackgroundColor"));
	setBackgroundVisible(TRUE);
	setBackgroundOpaque(TRUE);
}
Exemplo n.º 26
0
SelectBox::SelectBox( const CRect& rcSize, CControlListener* listener, long tag ) :
    CControl (rcSize, listener, tag ),
    scrollbar_( NULL ),
    state_( 0 ),
    dropDir_( Dropdown ),
	font_( kSystemFont ),
    index_( 0 ), 
    indexSel_( 0 ),
    indexSaved_( 0 ),
    maxVisible_( 3 ),
    scrollOffset_( 0 )
{
    calcMetrics();

    CRect rcScrollbar( size.right-WidthButton, size.bottom, size.right, size.bottom+150 );
    scrollbar_ = new CScrollbar( rcScrollbar, this, 0, CScrollbar::kVertical, CRect( 0,0,0,0 ));

    setWantsFocus( true );
    setBackgroundColor( kWhiteCColor );
    setFrameColor( kBlackCColor );
    setTextColor( kBlackCColor );
    setSelectionColor( colOrange );
}
void
QDBase::cleanAnno(bool allow_redraw)
{
   anno=0;

      // Is required to get rid of highlighted areas from annotations
      // and keep areas from URL or EMBED flags
   createMapAreas(false);

      // Restore background color
   if (back_color!=0xffffff)
      setBackgroundColor(0xffffff, false);

      // Switch zoom and mode back, if necessary
   if (zoom_src==SRC_ANT) 
     setZoom(prefs.nDefaultZoom, 0, SRC_ANT);
   if (mode_src==SRC_ANT) 
     setMode(IDC_DISPLAY_COLOR, 0, SRC_ANT);

      // Alignment will be picked up by layout() automatically.
   
   if (allow_redraw) redraw();
}
Exemplo n.º 28
0
void DropSite::dragEnterEvent( QDragEnterEvent *e )
{
    // Check if you want the drag...
    if ( SecretDrag::canDecode( e )
      || QTextDrag::canDecode( e )
      || QImageDrag::canDecode( e ) )
    {
	e->accept();
    }


    // Give the user some feedback...
    QString t;
    for( int i=0; e->format( i ); i++ ) {
	if ( *(e->format( i )) ) {
	    if ( !t.isEmpty() )
		t += "\n";
	    t += e->format( i );
	}
    }
    emit message( t );
    setBackgroundColor(white);
}
Exemplo n.º 29
0
KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name )
    : QWidget( parent, name )
{
    int i;

    curRow = curCol = 0;
    setFocusPolicy( NoFocus );
    setBackgroundColor( gray );
    setCellWidth( CELLW );		// set width of cell in pixels
    setCellHeight( CELLH );		// set height of cell in pixels
    setMouseTracking( FALSE );

    pix = p;
    if (pix == NULL) pixScaled = NULL;
    else {
        pixScaled = new QPixmap * [NROFTYPES];
        for (i = 0; i < NROFTYPES; i++) {
            pixScaled[i] = new QPixmap;
        }
    }
    graphicBoard = NULL;
    drawBuffer = NULL;
}
Exemplo n.º 30
0
// Constructor
PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboard)
    : QWidget(parent, name)
{
  topLevel = parent;

  textsLayout = objectsLayout = 0;
  textsList = soundsList = 0;
  draggedCursor = 0;

  toDraw.setAutoDelete(true);
  history.setAutoDelete(true);

  setBackgroundColor(white);

  QDomDocument layoutsDocument;
  bool ok = topLevel->loadLayout(layoutsDocument);
  if (ok) ok = registerPlayGrounds(layoutsDocument);
  if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard);
  if (!ok) loadFailure();

  currentAction = 0;
  setupGeometry();
}