Exemplo n.º 1
0
    /*pdf_document * pdoc =  pdf_specifics(doc);
	//pdf_page * pg = pdf_load_page(pdoc,0);
    pdf_obj * form,*field;
    form = pdf_dict_getp(pdf_trailer(pdoc), "Root/AcroForm/Fields");
    field = pdf_lookup_field(form,"name");
    pdf_field_set_value(pdoc,field,"DDDD");
    char * mes = pdf_field_value(pdoc,field);
    pdf_update_page(pdoc, (pdf_page *)page);
    wxMessageBox(mes);
  //  pdf_close_document(pdoc);
	// Calculate a transform to use when rendering. This transform
	// contains the scale and rotation. Convert zoom percentage to a
	// scaling factor. Without scaling the resolution is 72 dpi.

	fz_matrix transform,tran;
	fz_rotate(&transform, rotation);
	fz_pre_scale(&transform, zoom / 100.0f, zoom / 100.0f);
    fz_translate(&tran,100,350);

   // pdf_field_set_display(pdoc,wid->obj,3);
	// Take the page bounds and transform them by the same matrix that
	// we will use to render the page.

	fz_rect bounds;
	fz_bound_page(doc, page, &bounds);
//	pdf_bound_widget((pdf_widget*)wid1,&bounds);
	fz_transform_rect(&bounds, &transform);
    pdf_text_widget_set_text(pdoc,(pdf_widget*)wid1,"FFFFFFFFFFFFFFFFFFFFFFFFFF");
    pdf_update_appearance(pdoc,wid1);
	// Create a blank pixmap to hold the result of rendering. The
	// pixmap bounds used here are the same as the transformed page
	// bounds, so it will contain the entire page. The page coordinate
	// space has the origin at the top left corner and the x axis
	// extends to the right and the y axis extends down.

	fz_irect bbox;
	fz_round_rect(&bbox, &bounds);
	fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), &bbox);
	fz_clear_pixmap_with_value(ctx, pix, 0xff);

	// A page consists of a series of objects (text, line art, images,
	// gradients). These objects are passed to a device when the
	// interpreter runs the page. There are several devices, used for
	// different purposes:
	//
	//	draw device -- renders objects to a target pixmap.
	//
	//	text device -- extracts the text in reading order with styling
	//	information. This text can be used to provide text search.
	//
	//	list device -- records the graphic objects in a list that can
	//	be played back through another device. This is useful if you
	//	need to run the same page through multiple devices, without
	//	the overhead of parsing the page each time.

	// Create a draw device with the pixmap as its target.
	// Run the page with the transform.
	fz_device *dev = fz_new_draw_device(ctx, pix);
	pdf_run_annot(pdoc,(pdf_page*)page,wid1,dev,&tran,NULL);
	fz_run_page(doc, page, dev, &transform, NULL);
	fz_free_device(dev);
    unsigned char * data;
    bitmap = RGBAtoBitmap(pix->samples,pix->w,pix->h);
    w = bitmap->GetWidth();
    h = bitmap->GetHeight();
    SetScrollbars(1,1,w,h,0,0);
//bitmap = wxBitmap((const char*)data,pix->w,pix->h,32);
	// Clean up.
    pdf_page_write(pdoc,(pdf_page*)page);
	fz_drop_pixmap(ctx, pix);
	fz_free_page(doc, page);
	fz_close_document(doc);
	fz_free_context(ctx);
	Refresh();
}
*/
void PDFPanel::OnClick(wxMouseEvent &event)
{
    //Selected Fields cannot be more than 50 at a page
    if(selectedItems.size() > 50)
    {
        wxMessageBox(wxT("No more fields can be selected"));
        return;
    }
    wxPoint pt1,pt;
    pt1 = CalcUnscrolledPosition(event.GetPosition());
    pt1.x *= scale;
    pt1.y *= scale;
    Field f = doc32->SelectField(pt1);
    it = selectedItems.begin();
    while(it!=selectedItems.end())
    {
        if(it->id == f.id)
            return;
        it++;
    }
    if(strcmp(f.name,"empty"))
    {
        int x0 = f.xPos/scale;
        int y0 = f.yPos/scale;
        int width = f.width/scale;
        int height = f.height/scale;
        selectedItems.push_back(SelectedItem(wxRect(x0,y0,width,height),f.id));
    }
    else
    {
        selectedItems.clear();

    }
    Refresh();
}
Exemplo n.º 2
0
void LightEditor::handleTypeComboSelectionChanged(ComboBoxSelectionEventDetails* const details)
{
    boost::any SelectedItem(_TypeComboBox->getSelectedItem());
    if(SelectedItem.empty() ||
        _EditingLight->getType() != *boost::any_cast<FieldContainerType*>(SelectedItem))
    {
        const FieldContainerType* LightType(boost::any_cast<FieldContainerType*>(SelectedItem));
        
        LightRecPtr NewLight = dynamic_pointer_cast<Light>(LightType->createContainer());
        NewLight->setBeacon(_EditingLight->getBeacon());
        NewLight->setOn(_EditingLight->getOn());
        NewLight->setAmbient(_EditingLight->getAmbient());
        NewLight->setDiffuse(_EditingLight->getDiffuse());
        NewLight->setSpecular(_EditingLight->getSpecular());
        NewLight->setConstantAttenuation(_EditingLight->getConstantAttenuation());
        NewLight->setLinearAttenuation(_EditingLight->getLinearAttenuation());
        NewLight->setQuadraticAttenuation(_EditingLight->getQuadraticAttenuation());
        NewLight->setLightEngine(_EditingLight->getLightEngine());
        NewLight->setShadowIntensity(_EditingLight->getShadowIntensity());
        NewLight->setShadowMode(_EditingLight->getShadowMode());

        dynamic_cast<Node*>(_EditingLight->getParents().front())->setCore(NewLight);

        dettachLight();

        attachLight(NewLight);

        //CommandPtr OpenProjectItemCommand = OpenProjectCommand::create();
        //_TheCommandManager->executeCommand(OpenProjectItemCommand);
    }
}
Exemplo n.º 3
0
void
JobListView::CancelJob()
{
	JobItem* item = SelectedItem();
	if (item && item->GetJob()->Status() != kProcessing) {
		item->GetJob()->SetStatus(kFailed);
		item->GetJob()->Remove();
	}
}
Exemplo n.º 4
0
void
JobListView::RestartJob()
{
	JobItem* item = SelectedItem();
	if (item && item->GetJob()->Status() == kFailed) {
		// setting the state changes the file attribute and
		// we will receive a notification from SpoolFolder
		item->GetJob()->SetStatus(kWaiting);
	}
}
SelectableResource::SelectableResource(QWidget *parent, QString name) :
    QDialog(parent),
    ui(new Ui::SelectableResource)
{
    ui->setupUi(this);

    connect(ui->search,    SIGNAL(textChanged(QString)), this, SLOT(SearchList()));
    connect(ui->buttonBox, SIGNAL(accepted()),           this, SLOT(SelectedItem()));
    connect(ui->buttonBox, SIGNAL(rejected()),           this, SLOT(hide()));
    setModal(true);
    setWindowTitle("Select " + name);
}
Exemplo n.º 6
0
CmpackChannel CExpressDlg::SelectedChannel(void)
{
	if (m_ChannelCombo)
		return (CmpackChannel)SelectedItem(GTK_COMBO_BOX(m_ChannelCombo), CMPACK_CHANNEL_DEFAULT);
	return CMPACK_CHANNEL_DEFAULT;
}
Exemplo n.º 7
0
int CExpressDlg::SelectedRefFrame(void)
{
	if (m_RefFrameCombo)
		return SelectedItem(GTK_COMBO_BOX(m_RefFrameCombo), -1);
	return -1;
}