资源简介
Scroll View 控件显示一个文件夹的缩略图,类似图片浏览器
代码片段和文件信息
//
// Document.m
// Created 2014-11-13 by DMD
// ShenZhen In China
#import “Document.h“
#import “ImageDataSource.h“
extern ImageDataSource *g_ImageDataSource;
Document *g_Document;
@implementation Document
@synthesize m_LB1;
- (id)init
{
self = [super init];
if (self)
{
g_Document = self;
}
return self;
}
- (NSString *)windowNibName
{
// Override returning the nib file name of the document
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers you should remove this method and override -makeWindowControllers instead.
return @“Document“;
}
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
{
[super windowControllerDidLoadNib:aController];
// Add any code here that needs to be executed once the windowController has loaded the document‘s window.
}
+ (BOOL)autosavesInPlace
{
return YES;
}
- (IBAction)OnBT_SelectFolder:(id)sender
{
NSOpenPanel *panel = [NSOpenPanel openPanel];
NSString *msg=[NSString stringWithFormat:@“Select a folder“];
//不让新打开的窗口在新窗口出现标题
[panel setMessage:msg];
[panel setPrompt:@“OK“];
[panel setCanChooseDirectories:YES];
[panel setCanCreateDirectories:YES];
[panel setCanChooseFiles:NO];
[panel beginSheetModalForWindow:[NSApp mainWindow] completionHandler:^(NSInteger result)
{
NSString *selected_folder=@““;
if (result == NSFileHandlingPanelOKButton)
{
selected_folder=[[panel URL] path];
[g_ImageDataSource Show_ThumbnailImages:selected_folder];
}
}];
}
- (IBAction)OnBT_SelectedAll:(id)sender
{
[g_ImageDataSource SetSelected_All_or_None];
}
- (IBAction)OnBT_Changetitle:(id)sender
{
//picture_id
[g_ImageDataSource setID];
//picture_path
NSMutableArray *array_image_id = [[NSMutableArray alloc] init];
NSMutableArray *array_image_path = [[NSMutableArray alloc] init];
NSMutableArray *array_image_file_size = [[NSMutableArray alloc] init];
int i=0;
int i_pic_count = 10;//file_count need you change
NSString *picture_id=nil;
NSString *picture_path=nil;
NSString *picture_file_size = nil;
for (; i {
picture_id =[NSString stringWithFormat:@“ID%d“i+1];
picture_path =[NSString stringWithFormat:@“Path%d“i+1];
picture_file_size=[NSString stringWithFormat:@“Size%d“i+1];
[array_image_id addobject:picture_id];
[array_image_path addobject:picture_path];
[array_image_file_size addobject:picture_file_size];
}
[g_ImageDataSource setImagesPath:array_image_id
PhotoPath:array_image_path
PhotoFileSize:array_image_file_size];
}
-(void)ShowMessageInBottom:(NSString *)msg
{
m_LB1.stringValue = msg;
}
@end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-11-13 15:03 learn_pictures_browser\
文件 6148 2014-11-13 15:45 learn_pictures_browser\.DS_Store
目录 0 2014-11-13 15:45 __MACOSX\
目录 0 2014-11-13 15:45 __MACOSX\learn_pictures_browser\
文件 82 2014-11-13 15:45 __MACOSX\learn_pictures_browser\._.DS_Store
目录 0 2014-11-13 15:44 learn_pictures_browser\learn_pictures_browser\
文件 6148 2014-11-13 14:14 learn_pictures_browser\learn_pictures_browser\.DS_Store
目录 0 2014-11-13 15:45 __MACOSX\learn_pictures_browser\learn_pictures_browser\
文件 82 2014-11-13 14:14 __MACOSX\learn_pictures_browser\learn_pictures_browser\._.DS_Store
文件 188 2014-11-13 14:55 learn_pictures_browser\learn_pictures_browser\Document.h
文件 171 2014-11-13 14:55 __MACOSX\learn_pictures_browser\learn_pictures_browser\._Document.h
文件 2938 2014-11-13 15:02 learn_pictures_browser\learn_pictures_browser\Document.m
文件 171 2014-11-13 15:02 __MACOSX\learn_pictures_browser\learn_pictures_browser\._Document.m
目录 0 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\
文件 261 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\.xccurrentversion
目录 0 2014-11-13 15:45 __MACOSX\learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\
文件 171 2014-11-13 14:13 __MACOSX\learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\._.xccurrentversion
目录 0 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\Document.xcdatamodel\
文件 350 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\Document.xcdatamodel\contents
目录 0 2014-11-13 15:45 __MACOSX\learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\Document.xcdatamodel\
文件 171 2014-11-13 14:13 __MACOSX\learn_pictures_browser\learn_pictures_browser\Document.xcdatamodeld\Document.xcdatamodel\._contents
目录 0 2014-11-13 14:57 learn_pictures_browser\learn_pictures_browser\en.lproj\
文件 436 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\en.lproj\Credits.rtf
目录 0 2014-11-13 15:45 __MACOSX\learn_pictures_browser\learn_pictures_browser\en.lproj\
文件 171 2014-11-13 14:13 __MACOSX\learn_pictures_browser\learn_pictures_browser\en.lproj\._Credits.rtf
文件 47909 2014-11-13 14:57 learn_pictures_browser\learn_pictures_browser\en.lproj\Document.xib
文件 45 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\en.lproj\InfoPlist.strings
文件 171 2014-11-13 14:13 __MACOSX\learn_pictures_browser\learn_pictures_browser\en.lproj\._InfoPlist.strings
文件 207921 2014-11-13 14:13 learn_pictures_browser\learn_pictures_browser\en.lproj\MainMenu.xib
文件 171 2014-11-13 14:13 __MACOSX\learn_pictures_browser\learn_pictures_browser\en.lproj\._MainMenu.xib
目录 0 2014-11-13 15:28 learn_pictures_browser\learn_pictures_browser\ImageBrowserView\
............此处省略58个文件信息
- 上一篇:数据库系统概论第五版课后习题答案王珊.doc
- 下一篇:汇编代码直接转换二进制数据
评论
共有 条评论