Ejemplo n.º 1
0
void WorkspaceWork::DoMove(int b, bool drag)
{
	int fi = filelist.GetCursor();
	if(fi < 0 || fi >= fileindex.GetCount())
		return;
	int a = fileindex[fi];
	if(a < 0 || b < 0 || a >= actual.file.GetCount() ||
	   (drag ? b > actual.file.GetCount() : b >= actual.file.GetCount()))
		return;
	int s = filelist.GetSbPos();
	ShowFile(a);
	ShowFile(b);
	if(drag) {
		actual.file.Move(a, b);
		if(b >= a)
			b--;
	}
	else
		Swap(actual.file[a], actual.file[b]);
	ShowFile(a);
	ShowFile(b);
	SavePackage();
	LoadActualPackage();
	filelist.SetSbPos(s);
	for(int i = 0; i < fileindex.GetCount(); i++)
		if(fileindex[i] == b) {
			filelist.SetCursor(i);
			break;
		}
	filelist.Sync();
}
Ejemplo n.º 2
0
/** \fn     GalleryView::ItemSelected(MythUIButtonListItem *)
 *  \brief  A new MythUIButtonListItem has been selected
 *  \param  item The given button item that has been selected
 *  \return void
 */
void GalleryView::ItemSelected(MythUIButtonListItem *item)
{
    if (!item)
        return;

    ImageMetadata *dm = GetImageMetadataFromButton(item);
    if (!dm)
        return;

    switch (dm->m_type)
    {
    case kSubDirectory:
        DirSelectDown();
        break;
    case kUpDirectory:
        DirSelectUp();
        break;
    case kImageFile:
        ShowFile();
        break;
    case kVideoFile:
        ShowFile();
        break;
    default:
        break;
    };
}
Ejemplo n.º 3
0
void __fastcall TForm1::Image1DblClick(TObject *Sender)
{
    myThreadShow->ShowFile("S:\\IMG_5733.JPG");
return;
    ShowFile("S:\\IMG_5435.JPG");

}
Ejemplo n.º 4
0
/** \fn     GalleryView::ShowFiles()
 *  \brief  Starts a slideshow with the images in normal order
 *  \return void
 */
void GalleryView::ShowFiles()
{
    GalleryWidget *widget = ShowFile();

    if (widget)
        widget->StartNormalSlideShow();
}
Ejemplo n.º 5
0
/** \fn     GalleryView::FileDetails()
 *  \brief  Shows details about the single file
 *  \return void
 */
void GalleryView::FileDetails()
{
    GalleryWidget *widget = ShowFile();

    if (widget)
        widget->ShowFileDetails();
}
Ejemplo n.º 6
0
/** \fn     GalleryView::ShowRandomFiles()
 *  \brief  Starts a slide show with the images in random order
 *  \return void
 */
void GalleryView::ShowRandomFiles()
{
    GalleryWidget *widget = ShowFile();

    if (widget)
        widget->StartRandomSlideShow();
}
Ejemplo n.º 7
0
bool QuickView::UpdateIfChanged(bool Idle)
{
	if (IsVisible() && !strCurFileName.empty() && Directory==2)
	{
		string strViewName = strCurFileName;
		ShowFile(strViewName, m_TemporaryFile, nullptr);
		return true;
	}

	return false;
}
Ejemplo n.º 8
0
static void CatalogPage(FILE *ifile, unsigned short page)
{
	TCatalog catalog;
	int i, k, fpos;

	fpos = page * PAGE_LENGTH;
	fseek (ifile, fpos, SEEK_SET);
	k = fread (catalog.page, 1, PAGE_LENGTH, ifile);
	for (i = 0; i < FILEMAP_LENGTH; i++)
	{
		ShowFile(ifile, catalog.filemap[i]);
	}
}
Ejemplo n.º 9
0
void __fastcall TForm1::Image1Click(TObject *Sender)
{
    if (random(2)==0) {
        myThreadShow->ShowFile("S:\\IMG_6344.JPG");
    }
    else {
        myThreadShow->ShowFile("S:\\IMG_5435.JPG");
    }
return;

    ShowFile("S:\\IMG_5733.JPG");
return;
    this->ShowNextImage(Image1);
}
void ScreenRecoveryUI::ShowFile(const char* filename) {
    FILE* fp = fopen_path(filename, "re");
    if (fp == nullptr) {
        Print("  Unable to open %s: %s\n", filename, strerror(errno));
        return;
    }

    char** old_text = text_;
    size_t old_text_col = text_col_;
    size_t old_text_row = text_row_;
    size_t old_text_top = text_top_;

    // Swap in the alternate screen and clear it.
    text_ = file_viewer_text_;
    ClearText();

    ShowFile(fp);
    fclose(fp);

    text_ = old_text;
    text_col_ = old_text_col;
    text_row_ = old_text_row;
    text_top_ = old_text_top;
}
Ejemplo n.º 11
0
VirtScreen::VirtScreen(World * const world_, Player * const player_) :
        w(world_),
        player(player_),
        settings(home_path + "freg.ini", QSettings::IniFormat),
        previousCommand(settings.value("last_command", "moo").toString())
{
    connect(     w, SIGNAL(Notify(QString)), SLOT(Notify(QString)),
        Qt::DirectConnection);
    connect(player, SIGNAL(Notify(QString)), SLOT(Notify(QString)),
        Qt::DirectConnection);
    connect(player, SIGNAL(ShowFile(QString)), SLOT(DisplayFile(QString)));
    connect(player, SIGNAL(GetFocus(int *, int *, int *)),
        SLOT(ActionXyz(int *, int *, int *)), Qt::DirectConnection);

    connect(     w, SIGNAL(GetString(QString &)),
        SLOT(PassString(QString &)), Qt::DirectConnection);
    connect(player, SIGNAL(GetString(QString &)),
        SLOT(PassString(QString &)), Qt::DirectConnection);

    connect(player, SIGNAL(Updated()), SLOT(UpdatePlayer()),
        Qt::DirectConnection);
    connect(w, SIGNAL(UpdatedAll()), SLOT(UpdateAll()),
        Qt::DirectConnection);
    connect(w, SIGNAL(Moved(int)), SLOT(Move(int)),
        Qt::DirectConnection);
    connect(w, SIGNAL(Updated(int, int, int)), SLOT(Update(int, int, int)),
        Qt::DirectConnection);
    connect(w, SIGNAL(UpdatedAround(int, int, int, int)),
        SLOT(UpdateAround(int, int, int, int)),
        Qt::DirectConnection);
    connect(w, SIGNAL(UpdatesEnded()), SLOT(UpdatesEnd()),
        Qt::DirectConnection);

    connect(player, SIGNAL(Destroyed()), SLOT(DeathScreen()),
        Qt::DirectConnection );
}
Ejemplo n.º 12
0
Archivo: dialog.c Proyecto: Mirppc/twin
static byte InitTextBox(void) {
    return ShowFile() && InitButtons(" EXIT ", NULL); 
}