Exemple #1
0
AxisUI *create_axis_ui(ExplorerUI *eui)
{
    AxisUI *ui;
    Widget rc, fr;

    ui = xmalloc(sizeof(AxisUI));

    ui->top = CreateVContainer(eui->scrolled_window);
    AddHelpCB(ui->top, "doc/UsersGuide.html#axis-properties");

    fr = CreateFrame(ui->top, "Position");
    rc = CreateHContainer(fr);
    ui->position = CreateLabelOptionChoiceVA(rc, "Placement:",
        "Normal",   AXIS_POS_NORMAL,
        "Opposite", AXIS_POS_OPPOSITE,
        "Zero",     AXIS_POS_ZERO,
        NULL);
    AddOptionChoiceCB(ui->position, oc_explorer_cb, eui);

    ui->offset = CreateSpinChoice(rc, "Offset:",
        4, SPIN_TYPE_FLOAT, -1.0, 1.0, 0.01);
    AddSpinChoiceCB(ui->offset, sp_explorer_cb, eui);
    
    fr = CreateFrame(ui->top, "Options");
    rc = CreateVContainer(fr);
    ui->draw_bar    = CreateToggleButton(rc, "Draw axis bar");
    AddToggleButtonCB(ui->draw_bar, tb_explorer_cb, eui);
    ui->draw_ticks  = CreateToggleButton(rc, "Draw tick marks");
    AddToggleButtonCB(ui->draw_ticks, tb_explorer_cb, eui);
    ui->draw_labels = CreateToggleButton(rc, "Draw tick labels");
    AddToggleButtonCB(ui->draw_labels, tb_explorer_cb, eui);
    
    return ui;
}
Exemple #2
0
ObjectUI *create_object_ui(ExplorerUI *eui)
{    
    ObjectUI *ui;
    Widget tab, fr, rc, rc1;

    ui = xmalloc(sizeof(ObjectUI));

    /* ------------ Tabs -------------- */
    tab = CreateTab(eui->scrolled_window);        
    AddHelpCB(tab, "doc/UsersGuide.html#dobject-properties");

    /* ------------ Main tab -------------- */
    ui->main_tp = CreateTabPage(tab, "General");

    fr = CreateFrame(ui->main_tp, "Anchor point");
    rc = CreateHContainer(fr);
    ui->x = CreateText2(rc, "X:", 10);
    AddTextActivateCB(ui->x, text_explorer_cb, eui);
    ui->y = CreateText2(rc, "Y:", 10);
    AddTextActivateCB(ui->y, text_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "Placement");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->offsetx = CreateViewCoordInput(rc1, "dX:");
    AddSpinChoiceCB(ui->offsetx, sp_explorer_cb, eui);
    ui->offsety = CreateViewCoordInput(rc1, "dY:");
    AddSpinChoiceCB(ui->offsety, sp_explorer_cb, eui);
    ui->angle = CreateAngleChoice(rc, "Angle:");
    AddSpinChoiceCB(ui->angle, sp_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "Drawing properties");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->linew = CreateLineWidthChoice(rc1, "Line width:");
    AddSpinChoiceCB(ui->linew, sp_explorer_cb, eui);
    ui->lines = CreateLineStyleChoice(rc1, "Line style:");
    AddOptionChoiceCB(ui->lines, oc_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->linepen = CreatePenChoice(rc1, "Outline pen:");
    AddPenChoiceCB(ui->linepen, pen_explorer_cb, eui);
    ui->fillpen = CreatePenChoice(rc1, "Fill pen:");
    AddPenChoiceCB(ui->fillpen, pen_explorer_cb, eui);

    /* ------------ Object data tab -------------- */
    ui->odata_tp = CreateTabPage(tab, "Object data");

    ui->line_ui = create_line_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->line_ui->top);
    ui->box_ui = create_box_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->box_ui->top);
    ui->arc_ui = create_arc_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->arc_ui->top);

    SelectTabPage(tab, ui->main_tp);
    
    ui->top = tab;
    
    return ui;
}
Exemple #3
0
static void Initialize(void)
{
    controls[0] = CreateLabel("Your drive has been optimized.",
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              FRAME_X, DIALOG_Y+1);

    controls[1] = CreateFrame(&ActionsFrame,
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              FRAME_X, DIALOG_Y+3);

    controls[2] = CreateSelectionButton(&SelectButtons[0],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+4);

    controls[3] = CreateSelectionButton(&SelectButtons[1],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+5);

    controls[4] = CreateSelectionButton(&SelectButtons[2],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+6);

    controls[5] = CreateCommandButton(&OkButton,
                                      BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                      BUTTON_X, BUTTON_Y, TRUE, FALSE,
                                      FALSE);
}
RefPtr<MediaDataDecoder::DecodePromise>
GMPVideoDecoder::Decode(MediaRawData* aSample)
{
  MOZ_ASSERT(IsOnGMPThread());

  RefPtr<MediaRawData> sample(aSample);
  if (!mGMP) {
    return DecodePromise::CreateAndReject(
      MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                  RESULT_DETAIL("mGMP not initialized")),
      __func__);
  }

  mLastStreamOffset = sample->mOffset;

  GMPUniquePtr<GMPVideoEncodedFrame> frame = CreateFrame(sample);
  if (!frame) {
    return DecodePromise::CreateAndReject(
      MediaResult(NS_ERROR_OUT_OF_MEMORY,
                  RESULT_DETAIL("CreateFrame returned null")),
      __func__);
  }
  RefPtr<DecodePromise> p = mDecodePromise.Ensure(__func__);
  nsTArray<uint8_t> info; // No codec specific per-frame info to pass.
  nsresult rv = mGMP->Decode(std::move(frame), false, info, 0);
  if (NS_FAILED(rv)) {
    mDecodePromise.Reject(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                                      RESULT_DETAIL("mGMP->Decode:%" PRIx32,
                                                    static_cast<uint32_t>(rv))),
                          __func__);
  }
  return p;
}
Exemple #5
0
wxObject * MaxMdiXmlHandler::DoCreateResource()
{
    wxWindow *frame = CreateFrame();

    if (HasParam(wxT("size")))
        frame->SetClientSize(GetSize());
    if (HasParam(wxT("pos")))
        frame->Move(GetPosition());
    if (HasParam(wxT("icon")))
    {
        wxFrame* f = wxDynamicCast(frame, wxFrame);
        if (f)
            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
    }

    SetupWindow(frame);

    CreateChildren(frame);

    if (GetBool(wxT("centered"), false))
        frame->Centre();

    return frame;

}
Exemple #6
0
static ArcUI *create_arc_ui(Widget parent, ExplorerUI *eui)
{
    ArcUI *ui;
    Widget rc, rc1;
    LabelOptionItem opitems[] = {
        {ARCCLOSURE_CHORD,    "Chord"    },
        {ARCCLOSURE_PIESLICE, "Pie slice"}
    };
    
    ui = xmalloc(sizeof(ArcUI));
    
    ui->top = CreateFrame(parent, "Arc properties");
    rc = CreateVContainer(ui->top);

    ui->width = CreateSpinChoice(rc, "Width: ",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->width, sp_explorer_cb, eui);
    ui->height = CreateSpinChoice(rc, "Height:",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->height, sp_explorer_cb, eui);
    
    ui->angle1 = CreateAngleChoice(rc, "Start angle:");
    AddSpinChoiceCB(ui->angle1, sp_explorer_cb, eui);
    ui->angle2 = CreateAngleChoice(rc, "Extent angle:");
    AddSpinChoiceCB(ui->angle2, sp_explorer_cb, eui);
    
    rc1 = CreateHContainer(rc);
    ui->closure_type = CreateLabelOptionChoice(rc1, "Closure type:", 1, 2, opitems);
    AddOptionChoiceCB(ui->closure_type, oc_explorer_cb, eui);
    ui->draw_closure = CreateToggleButton(rc1, "Draw closure");
    AddToggleButtonCB(ui->draw_closure, tb_explorer_cb, eui);
    
    return ui;
}
Exemple #7
0
VOID MakeDebugFrameThree(HWND hWnd){
    int i;
    int count = 48;
    PBYTE		data	= (PBYTE) malloc (sizeof(BYTE)*MAX_PAYLOAD_SIZE);
    FRAME		frame	= {0};
    PWNDDATA    pwd     = NULL;

    pwd = (PWNDDATA) GetWindowLongPtr(hWnd, 0);


    for (i =0;i<MAX_PAYLOAD_SIZE;i++){
        if ((i+5) % 16 == 0) {
            data[i] = count++;
            if (count == 58) {
                count = 48;
            }
        } else {
            data[i] = (i%26)+65;
        }
    }
    frame = CreateFrame(hWnd,data,MAX_PAYLOAD_SIZE);
    frame.crc = 4;	// not the right crc
    AddToFrameQueue(&pwd->FTPBuffHead,&pwd->FTPBuffTail,frame);
    pwd->FTPQueueSize+=1;
}
CLegendDisplay::CLegendDisplay(CADLayerGroup* pLayerGroup,CADGraphics* pGraphics)
{
	m_pLayerGroup=pLayerGroup;
	m_pGraphics=pGraphics;
	m_pGraphics->m_pLayerGroup=pLayerGroup;
//initialize
	m_FrameLeft = m_pGraphics->m_Extmin.x+20;
	m_FrameTop = m_pGraphics->m_Extmax.y-10;
	m_FrameWidth = A3_WIDTH-20-10;
	m_FrameHeight = A3_HEIGHT-10-10;
//set lengend display---------------------------
	m_LegendWidth = 15;
	m_LegendHeight = 10;

	m_LegendRowNum = 6;
	m_LegendSpaceX = 45;
	m_LegendSpaceY = 15;

	m_LegendRectLeft = m_FrameWidth-(m_LegendWidth*m_LegendRowNum+m_LegendSpaceX*m_LegendRowNum);
	m_LegendRectLeft = m_FrameLeft + m_LegendRectLeft/2;
	m_LegendRectTop = m_FrameTop-35;
	m_LegendRectWidth = m_FrameWidth-40*2;
	m_LegendRectHeight = m_FrameHeight-20-10;
	m_MTextWidth = 33;
//-----------------------------------------------
	CreateFrame();
}
void
GMPVideoDecoder::Input(MediaRawData* aSample)
{
  MOZ_ASSERT(IsOnGMPThread());

  RefPtr<MediaRawData> sample(aSample);
  if (!mGMP) {
    mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                 RESULT_DETAIL("mGMP not initialized")));
    return;
  }

  mAdapter->SetLastStreamOffset(sample->mOffset);

  GMPUniquePtr<GMPVideoEncodedFrame> frame = CreateFrame(sample);
  if (!frame) {
    mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY,
                                 RESULT_DETAIL("CreateFrame returned null")));
    return;
  }
  nsTArray<uint8_t> info; // No codec specific per-frame info to pass.
  nsresult rv = mGMP->Decode(Move(frame), false, info, 0);
  if (NS_FAILED(rv)) {
    mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                                 RESULT_DETAIL("mGMP->Decode:%x", rv)));
  }
}
Exemple #10
0
void FrameManager::LoadConfig(DrawFrame *frame) {
	ConfigDialog *config_dialog = new ConfigDialog(frame, config_manager->GetConfigTitles(), DefinedDrawsSets::DEF_PREFIX);

	int ret = config_dialog->ShowModal();
	if (ret != wxID_OK) {
		config_dialog->Destroy();
		return;
	}

	wxString prefix = config_dialog->GetSelectedPrefix();

	if (prefix == DefinedDrawsSets::DEF_PREFIX) {
		DrawsSets *cfg = config_manager->GetConfigByPrefix(prefix);
		if (cfg == NULL || cfg->GetDrawsSets().size() == 0) {
			int ret = wxMessageBox(_("The are no user defined sets. Do you want to create one?"), _("Question"), wxICON_QUESTION | wxOK | wxCANCEL, frame);
			if (ret == wxOK)  {
				DrawPicker* dp = new DrawPicker(frame, config_manager, database_manager, remarks_handler);
				if (dp->NewSet(prefix, false) == wxID_OK)
					frame->AddDrawPanel(prefix, wxEmptyString, PERIOD_T_YEAR, 0);
				dp->Destroy();
			}
			config_dialog->Destroy();
			return;
		}
	}

	if (frame)
		frame->AddDrawPanel(prefix, wxEmptyString, PERIOD_T_YEAR, 0);
	else
		CreateFrame(prefix, wxEmptyString, PERIOD_T_YEAR, time_t(-1), wxDefaultSize, wxDefaultPosition);
	config_dialog->Destroy();
}
Exemple #11
0
void BasicMessageBox( TEXTCHAR *title, TEXTCHAR *content )
{
    PCOMMON msg;
    TEXTCHAR *start, *end;
    TEXTCHAR msgtext[256];
    int done = 0, okay = 0;
    int y = 5;
    msg = CreateFrame( title, 0, 0, 312, 120, 0, frame );
    end = start = content;
    do
    {
        while( end[0] && end[0] != '\n' )
            end++;
        if( end[0] )
        {
            MemCpy( msgtext, start, end-start );
            msgtext[end-start] = 0;
            //end[0] = 0;
            MakeTextControl( msg, 5, y, 302, 16, -1
                             , msgtext, 0 );
            //end[0] = '\n';
            end = start = end+1;
            y += 18;
        }
        else
            MakeTextControl( msg, 5, y, 302, 16, -1
                             , start, 0 );
    } while( end[0] );
    //AddExitButton( msg, &done );
    AddCommonButtons( msg, NULL, &okay );
    DisplayFrame( msg );
    CommonLoop( &okay, NULL );
    DestroyFrame( &msg );
}
Exemple #12
0
static void png_gui_setup(const Canvas *canvas, void *data)
{
    PNG_UI_data *ui = (PNG_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget fr, rc;
        
	ui->frame = CreateDialog(app_shell, "PNG options");

	fr = CreateFrame(ui->frame, "PNG options");
        rc = CreateVContainer(fr);
	ui->interlaced = CreateToggleButton(rc, "Interlaced");
	ui->transparent = CreateToggleButton(rc, "Transparent");
	ui->compression = CreateSpinChoice(rc,
            "Compression:", 1, SPIN_TYPE_INT,
            (double) Z_NO_COMPRESSION, (double) Z_BEST_COMPRESSION, 1.0);

	CreateAACDialog(ui->frame, fr, set_png_setup_proc, ui);
    }
    update_png_setup_frame(ui);
    
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemple #13
0
static void pnm_gui_setup(const Canvas *canvas, void *data)
{
    PNM_UI_data *ui = (PNM_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget fr, rc;
        
	ui->frame = CreateDialog(app_shell, "PNM options");

	fr = CreateFrame(ui->frame, "PNM options");
        rc = CreateVContainer(fr);
	ui->format = CreateOptionChoiceVA(rc, "Format: ",
            "1-bit mono (PBM)",      PNM_FORMAT_PBM,
            "8-bit grayscale (PGM)", PNM_FORMAT_PGM,
            "8-bit color (PPM)",     PNM_FORMAT_PPM,
            NULL);
	ui->rawbits = CreateToggleButton(rc, "\"Rawbits\"");

	CreateAACDialog(ui->frame, fr, set_pnm_setup_proc, ui);
    }
    update_pnm_setup_frame(ui);

    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemple #14
0
void hpdf_gui_setup(const Canvas *canvas, void *data)
{
    HPDF_UI_data *ui = (HPDF_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget fr, rc;
        OptionItem colorspace_ops[3] = {
            {HPDF_COLORSPACE_GRAYSCALE, "Grayscale"},
            {HPDF_COLORSPACE_RGB,       "RGB"      },
            {HPDF_COLORSPACE_CMYK,      "CMYK"     }
        };
    
	ui->frame = CreateDialog(app_shell, "hPDF options");

	fr = CreateFrame(ui->frame, "hPDF options");
        rc = CreateVContainer(fr);
        ui->colorspace =
            CreateOptionChoice(rc, "Colorspace:", 1, 3, colorspace_ops);
	ui->compression = CreateToggleButton(rc, "Compression");

	CreateAACDialog(ui->frame, fr, set_hpdf_setup_proc, ui);
    }
    update_hpdf_setup_frame(ui);
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemple #15
0
void create_points_frame(void *data)
{
    set_wait_cursor();
    
    if (points_frame == NULL) {
        Widget dialog, wbut, rc, fr;
        
	points_frame = CreateDialogForm(app_shell, "Point explorer");
	
	fr = CreateFrame(points_frame, NULL);
        AddDialogFormChild(points_frame, fr);
	locate_point_message = CreateLabel(fr, "Point explorer");
        
        dialog = CreateVContainer(points_frame);
        AddDialogFormChild(points_frame, dialog);

        track_set_sel = CreateSetChoice(dialog,
            "Restrict to set:", LIST_TYPE_SINGLE, TRUE);
        AddListChoiceCB(track_set_sel, track_set_cbproc, NULL);
        
	rc = CreateHContainer(dialog);
	goto_index_item = CreateTextItem(rc, 6, "Point location:");
	wbut = CreateButton(rc, "Goto point");
	AddButtonCB(wbut, do_gotopt_proc, NULL);

	locate_point_item = CreateTextInput(dialog, "Point data:");

	CreateSeparator(dialog);

	rc = CreateHContainer(dialog);

	wbut = CreateButton(rc, "Track");
	AddButtonCB(wbut, do_track_proc, NULL);

	wbut = CreateButton(rc, "Move");
	AddButtonCB(wbut, do_ptsmove_proc, (void *) MOVE_POINT_XY);
	wbut = CreateButton(rc, "Move X");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_X);
	wbut = CreateButton(rc, "Move Y");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_Y);

	wbut = CreateButton(rc, "Prepend");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_BEGINNING);
	wbut = CreateButton(rc, "Append");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_END);
	wbut = CreateButton(rc, "Insert");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_NEAREST);

	wbut = CreateButton(rc, "Delete");
	AddButtonCB(wbut, do_del_proc, NULL);

	wbut = CreateButton(rc, "Close");
	AddButtonCB(wbut, points_done_proc, (void *) points_frame);
        
        ManageChild(points_frame);
    }
    
    RaiseWindow(GetParent(points_frame));
    unset_wait_cursor();
}
Exemple #16
0
static LineUI *create_line_ui(Widget parent, ExplorerUI *eui)
{
    LineUI *ui;
    Widget fr, rc, rc1;
    
    ui = xmalloc(sizeof(LineUI));
    
    ui->top = CreateVContainer(parent);
    fr = CreateFrame(ui->top, "Vector");
    rc = CreateHContainer(fr);
    ui->v_x = CreateSpinChoice(rc, "X: ",
        8, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.05);
    AddSpinChoiceCB(ui->v_x, sp_explorer_cb, eui);
    ui->v_y = CreateSpinChoice(rc, "Y:",
        8, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.05);
    AddSpinChoiceCB(ui->v_y, sp_explorer_cb, eui);

    fr = CreateFrame(ui->top, "Arrows");
    rc = CreateVContainer(fr);
    ui->arrow_end = CreatePanelChoice(rc, "Place at:",
				      "None",
				      "Start",
				      "End",
				      "Both ends",
				      NULL);
    AddOptionChoiceCB(ui->arrow_end, oc_explorer_cb, eui);

    rc1 = CreateHContainer(rc);
    ui->a_type = CreateLabelOptionChoiceVA(rc1, "Type:",
        "Line",   ARROW_TYPE_LINE,
        "Filled", ARROW_TYPE_FILLED,
        "Circle", ARROW_TYPE_CIRCLE,
        NULL);
    AddOptionChoiceCB(ui->a_type, oc_explorer_cb, eui);
    ui->a_length = CreateSpinChoice(rc1, "Length:",
        4, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.5);
    AddSpinChoiceCB(ui->a_length, sp_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->a_dL_ff = CreateSpinChoice(rc1, "d/L FF:",
        4, SPIN_TYPE_FLOAT, 0.0, 10.0, 0.1);
    AddSpinChoiceCB(ui->a_dL_ff, sp_explorer_cb, eui);
    ui->a_lL_ff = CreateSpinChoice(rc1, "l/L FF:",
        4, SPIN_TYPE_FLOAT, -1.0, 1.0, 0.1);
    AddSpinChoiceCB(ui->a_lL_ff, sp_explorer_cb, eui);
    
    return ui;
}
Exemple #17
0
void CDoubleSidedPrintPrePrint1::CreateLeftFrame(CPmwView* pView, LPCSTR pszText)
{
	PBOX Bound;
	Bound.x0 = PAGE_RESOLUTION/2;
	Bound.x1 = PAGE_RESOLUTION*4;
	Bound.y0 = PAGE_RESOLUTION/2;
	Bound.y1 = PAGE_RESOLUTION*4;

	CreateFrame(pView, pszText, Bound, ALIGN_left, ALIGN_top);
}
Exemple #18
0
void CreateGPSGridDisplay( void )
{
	PSI_CONTROL frame;
	frame = CreateFrame( WIDE("GPS Grid Display"), 640, 480, 640, 480, BORDER_RESIZABLE|BORDER_NORMAL, NULL );

	AddCommonDraw( frame, DrawGrid) ;

	AddTimer( 300, UpdateGrid, (uintptr_t)frame );
	DisplayFrame( frame );
	return;
}
Exemple #19
0
bool MyApp::OnInit()
{
#if !START_WITH_MFC_WINDOW
    // as we're not inside wxWidgets main loop, the default logic doesn't work
    // in our case and we need to do this explicitly
    SetExitOnFrameDelete(true);

    (void) CreateFrame();
#endif

    return true;
}
Exemple #20
0
void CDoubleSidedPrintPrePrint2::CreateRightFrame(CPmwView* pView, LPCSTR pszText)
{
	PPNT Dims = pView->GetDocument()->get_dimensions();

	PBOX Bound;
	Bound.x0 = Dims.x - PAGE_RESOLUTION*4;
	Bound.x1 = Dims.x - PAGE_RESOLUTION/2;
	Bound.y0 = PAGE_RESOLUTION/2;
	Bound.y1 = PAGE_RESOLUTION*4;

	CreateFrame(pView, pszText, Bound, ALIGN_right, ALIGN_top);
}
Exemple #21
0
PSI_NAMESPACE 

PSI_PROC( void, SimpleMessageBox )( PCOMMON parent, CTEXTSTR title, CTEXTSTR content )
{
	PCOMMON msg;
	CTEXTSTR start, end;
	TEXTCHAR msgtext[256];
	int okay = 0;
	int y = 5;
	uint32_t width, height;
	uint32_t title_width, greatest_width;
#ifdef USE_INTERFACES
	GetMyInterface();
#endif
	GetStringSize( content, &width, &height );
	title_width = GetStringSize( title, NULL, NULL );
	if( title_width > width )
		greatest_width = title_width;
	else
		greatest_width = width;
	msg = CreateFrame( title, 0, 0
						 , greatest_width + 10, height + (COMMON_BUTTON_PAD * 3) + COMMON_BUTTON_HEIGHT
						 , 0, parent );
	end = start = content;
	do
	{
		while( end[0] && end[0] != '\n' )
			end++;
		if( end[0] )
		{
			MemCpy( msgtext, (POINTER)start, end-start );
			msgtext[end-start] = 0;
			//end[0] = 0;
			MakeTextControl( msg, COMMON_BUTTON_PAD, y
							  , greatest_width, height
							  , -1, msgtext, 0 );
			//end[0] = '\n';
			end = start = end+1;
			y += height;
		}
		else
			MakeTextControl( msg, COMMON_BUTTON_PAD, y
							  , greatest_width, height
							  , -1, start, 0 );
	} while( end[0] );
	//AddExitButton( msg, &done );
	AddCommonButtons( msg, NULL, &okay );
	lprintf( WIDE("show message box") );
	DisplayFrame( msg );
	CommonWait( msg );
	DestroyFrame( &msg );
}
Exemple #22
0
/*
 * This function allocates images and frames
 * And a Worm Object
 *
 * And a Parameter Object
 * For internal manipulation
 *
 *
 */
void InitializeExperiment(Experiment* exp) {

	/*** Create IplImage **/
	IplImage* SubSampled = cvCreateImage(cvSize(NSIZEX / 2, NSIZEY / 2),
			IPL_DEPTH_8U, 1);
	IplImage* HUDS = cvCreateImage(cvSize(NSIZEX, NSIZEY), IPL_DEPTH_8U, 1);


	exp->CurrentSelectedImg= cvCreateImage(cvSize(NSIZEX,NSIZEY), IPL_DEPTH_8U,1);

	exp->SubSampled = SubSampled;
	exp->HUDS = HUDS;

	/*** Create Frames **/
	Frame* fromCCD = CreateFrame(cvSize(NSIZEX, NSIZEY));
	Frame* forDLP = CreateFrame(cvSize(NSIZEX, NSIZEY));
	Frame* IlluminationFrame = CreateFrame(cvSize(NSIZEX, NSIZEY));

	exp->fromCCD = fromCCD;
	exp->forDLP = forDLP;
	exp->IlluminationFrame = IlluminationFrame;

	/** Create Worm Data Struct and Worm Parameter Struct **/
	WormAnalysisData* Worm = CreateWormAnalysisDataStruct();
	WormAnalysisParam* Params = CreateWormAnalysisParam();
	InitializeEmptyWormImages(Worm, cvSize(NSIZEX, NSIZEY));
	InitializeWormMemStorage(Worm);

	/** Create SegWormDLP object using memory from the worm object **/
	exp->segWormDLP = CreateSegmentedWormStruct();

	exp->Worm = Worm;
	exp->Params = Params;

	/** Setup Previous Worm **/
	WormGeom* PrevWorm = CreateWormGeom();
	exp->PrevWorm = PrevWorm;

}
Exemple #23
0
static void jpg_gui_setup(const Canvas *canvas, void *data)
{
    JPG_UI_data *ui = (JPG_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget rc, fr, rc1;
        
	ui->frame = CreateDialog(app_shell, "JPEG options");

        rc = CreateVContainer(ui->frame);

	fr = CreateFrame(rc, "JPEG options");
        rc1 = CreateVContainer(fr);
	ui->quality = CreateSpinChoice(rc1,
            "Quality:", 3, SPIN_TYPE_INT, 0.0, 100.0, 5.0);
	ui->optimize = CreateToggleButton(rc1, "Optimize");
	ui->progressive = CreateToggleButton(rc1, "Progressive");
	ui->grayscale = CreateToggleButton(rc1, "Grayscale");

	fr = CreateFrame(rc, "JPEG advanced options");
        rc1 = CreateVContainer(fr);
	ui->smoothing = CreateSpinChoice(rc1,
            "Smoothing:", 3, SPIN_TYPE_INT, 0.0, 100.0, 10.0);
	ui->baseline = CreateToggleButton(rc1, "Force baseline");
	ui->dct = CreateOptionChoiceVA(rc, "DCT: ",
            "Fast integer", JPEG_DCT_IFAST,
            "Slow integer", JPEG_DCT_ISLOW,
            "Float",        JPEG_DCT_FLOAT,
            NULL);

	CreateAACDialog(ui->frame, rc, set_jpg_setup_proc, ui);
    }
    update_jpg_setup_frame(ui);

    DialogRaise(ui->frame);
    unset_wait_cursor();
}
void wxSkinFrame::OnSize(wxSizeEvent& e)
{	
  if( CreateFrame(GetClientSize()))
  {	SetWindowShape(m_bmpSkin);
  }
  /*if(m_sizeMode == 0)
  {*/
    Refresh();
    Layout();
  //}
    
  e.Skip();
}
Exemple #25
0
/*------------------------------------------------------------------------------
-- FUNCTION:    ReadFromFile
--
-- DATE:        Dec 2, 2010
--
-- REVISIONS:
--
-- DESIGNER:    Daniel Wright
--
-- PROGRAMMER:  Daniel Wright
--
-- INTERFACE:   ReadFromFile(HWND hWnd)
--                      hWnd			- a handle to the window
--
-- RETURNS:     VOID.
--
-- NOTES:       While the File to Port queue is not full, reads in increments
--				of 1019 bytes from the file to be transmitted, calls CreateFrame
--				to frame them and adds them to the File to Port queue.
------------------------------------------------------------------------------*/
VOID ReadFromFile(HWND hWnd){
    PWNDDATA pwd = {0};
    DWORD dwBytesRead = 0;
    DWORD dwBytesWritten = 0;
    DWORD	dwSizeOfFile = 0;
    BOOL	eof	= FALSE;
    FRAME frame;
    HANDLE hMutex = {0};
    int i;
    PBYTE ReadBuffer = (PBYTE) malloc(sizeof(BYTE) *1019);

    pwd = (PWNDDATA)GetWindowLongPtr(hWnd, 0);
    
    if (!(dwSizeOfFile = GetFileSize(pwd->hFileTransmit, NULL))) {
        return;
    }

    while(pwd->FTPQueueSize < FULL_BUFFER && pwd->hFileTransmit != NULL){

        if((i =dwSizeOfFile - ((pwd->NumOfReads) * 1019)) > 0){
            if(!ReadFile(pwd->hFileTransmit, ReadBuffer, 1019, &dwBytesRead, NULL)){
                DISPLAY_ERROR("Failed to read from file");
            }
            ++pwd->NumOfReads;
            frame = CreateFrame(hWnd, ReadBuffer, dwBytesRead);

        } else if((dwSizeOfFile - ((pwd->NumOfReads) * 1019)) == 0){
            CloseFileTransmit(hWnd);
            ++pwd->NumOfReads;
            

            frame = CreateNullFrame(hWnd);
            MessageBox(hWnd, TEXT("Transmit File Buffering Complete"), 
				       TEXT("File Read Complete"), MB_OK);

        } else {
            
            CloseFileTransmit(hWnd);
            MessageBox(hWnd, TEXT("Transmit File Buffering Complete"), 
				       TEXT("File Read Complete"), MB_OK);
            return;
        } 
                
        hMutex = CreateMutex(NULL, FALSE, TEXT("FTPMutex"));
        WaitForSingleObject(hMutex,INFINITE);
        AddToFrameQueue(&pwd->FTPBuffHead, &pwd->FTPBuffTail, frame);
        pwd->FTPQueueSize+=1;

        ReleaseMutex(hMutex);
    }
}
Exemple #26
0
uintptr_t CPROC Thread1( PTHREAD thread )
{
   while( 1 )
	if( !pc )
	{
      EnterCriticalSec( &cs );
		pc = CreateFrame( "test frame", 0, 0, 256, 256, 0, NULL );
      DisplayFrame( pc );
      LeaveCriticalSec( &cs );
	}
	else
      Relinquish();
   return 0;
}
Exemple #27
0
int SimpleUserQueryEx( TEXTSTR result, int reslen, CTEXTSTR question, PSI_CONTROL pAbove, void (CPROC*query_success_callback)(uintptr_t, LOGICAL), uintptr_t query_user_data )
{
	PSI_CONTROL pf, pc;
	struct user_query_info *query_state = New( struct user_query_info );
	int32_t mouse_x, mouse_y;

	//int Done = FALSE, Okay = FALSE;
	pf = CreateFrame( NULL, 0, 0, 280, 65, 0, pAbove );
	SetCommonUserData( pf, (uintptr_t)query_state );
	query_state->pf = pf;
	query_state->Done = FALSE;
	query_state->Okay = FALSE;
	query_state->result = result;
	query_state->reslen = reslen;
	pc = MakeTextControl( pf, 5, 2, 320, 18, TXT_STATIC, question, TEXT_NORMAL );

	query_state->edit = MakeEditControl( pf, 5, 23, 270, 14, TXT_STATIC, NULL, 0 );
	AddCommonButtons( pf, &query_state->Done, &query_state->Okay );
	SetButtonPushMethod( GetControl( pf, IDOK ), OkayClicked, (uintptr_t)query_state );
	SetButtonPushMethod( GetControl( pf, IDCANCEL ), CancelClicked, (uintptr_t)query_state );
	GetMousePosition( &mouse_x, &mouse_y );
	MoveFrame( pf, mouse_x - 140, mouse_y - 30 );
	//lprintf( WIDE("Show query....") );
	DisplayFrame( pf );
	SetCommonFocus( query_state->edit );

	query_state->query_success = query_success_callback;
	if( !query_success_callback )
	{
		int okay;
		CommonWait( pf );
		if( query_state->Okay )
		{
			GetControlText( query_state->edit, result, reslen );
		}
		DestroyFrame( &pf );
		okay = query_state->Okay;
		Release( query_state );
		return okay;
	}
	else
	{
		query_state->query_success = query_success_callback;
		query_state->query_user_data = query_user_data;
		return 0;
	}

}
Exemple #28
0
int main( void )
{
	PSI_CONTROL frame = CreateFrame( WIDE("test scrolling texts"), 0, 0, 1024, 768, 0, NULL );
	if( frame )
	{
		t1 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 5, 300, 15, -1, WIDE("Scroll This Text...") );
		t2 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 25, 300, 15, -1, WIDE("Scroll This Text...") );
		t3 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 45, 300, 15, -1, WIDE("Scroll This Text...") );
		SetControlAlignment( t3, TEXT_CENTER );
		t4 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 65, 300, 15, -1, WIDE("Scroll This Text...") );
		SetControlAlignment( t4, TEXT_CENTER );
		DisplayFrame( frame );
		AddTimer( 50, DoScroll, 0 );
		CommonWait( frame );
	}
}
Exemple #29
0
VOID MakeDebugFrameOne(HWND hWnd){
    int i;
    PBYTE		data	= (PBYTE) malloc (sizeof(BYTE)*25);
    FRAME		frame	= {0};
    PWNDDATA    pwd     = NULL;

    pwd = (PWNDDATA) GetWindowLongPtr(hWnd, 0);


    for (i =0;i<25;i++){
        data[i] = i+65;
    }
    frame = CreateFrame(hWnd,data,25);
    frame.sequence = 0;
    AddToFrameQueue(&pwd->FTPBuffHead,&pwd->FTPBuffTail,frame);
    pwd->FTPQueueSize+=1;
}
Exemple #30
0
int InitCamera(){

	
	printf("Initializing framegrabber... \n");
	
	// Create device data structure 
	
	if (CreateDeviceV4L2(&fg_v4l2,DEFAULT_V4L2_DEVICE_NAME) != 0 ) {		
		return -1;
	}
	
	// Open v4l2 standard device 
	
	if ( OpenDeviceV4L2( fg_v4l2 ) != 0 ) {
		printf("Unexpexted error when opening v4l2 device \n");	
		return -1;
	}
	
	// Init device with standard format and requested window size 
	
	if ( InitDeviceV4L2(fg_v4l2,DEFAULT_HOR_RESOLUTION,DEFAULT_VERT_RESOLUTION,DEFAULT_V4L2_FMT,DEFAULT_FPS) !=0 ){
		printf("Unexpexted error when initializing v4l2 device \n");	
		return -1;
	}	
	
	// Start acquisition			
	
	if ( StartCapturingV4L2(fg_v4l2) != 0 ) {	
		printf("Unexpexted error when starting to capture frames \n");	
		return -1;
	}

	// Prepare frame buffer and bwImage buffer
	
	if ( CreateFrame(&fr, DEFAULT_HOR_RESOLUTION, DEFAULT_VERT_RESOLUTION , DEFAULT_V4L2_FMT) != 0 ) {
		return -1;
	}
	
	if ( CreateBWImage(&bwIm,fr->height+1,fr->width) != 0 ) {
		return -1;
	}
	
	
return 0;
}