Subversion Repositories Filer-Free

Compare Revisions

Ignore whitespace Rev 28 → Rev 29

/trunk/filer/filer_window.h
50,8 → 50,9
/** Destroy filer window. */
~filer_window();
 
virtual void handle_redraw_request(wimp_draw& block);
virtual void handle_open_request(wimp_open& block);
virtual void handle_redraw_request(wimp_draw& block);
virtual void handle_close_request(wimp_close& block);
 
/** Get pathname.
* @return the pathname of the directory viewed by this filer window
80,6 → 81,13
* @param xsize the required width
*/
void reformat(int xsize);
 
/** Open filer window for parent directory.
* @param offset the position at which to open the top left-hand
* corner of the new filer window, with respect to the top left-hand
* corner of this one
*/
void open_parent(const os_coord& offset) const;
};
 
#endif
/trunk/filer/filer_window.cc
146,6 → 146,22
if (_xccount!=xccount||_yccount!=yccount) force_redraw();
}
 
void filer_window::handle_close_request(wimp_close& block)
{
wimp_pointer pointer;
xwimp_get_pointer_info(&pointer);
 
if (pointer.buttons&wimp_CLICK_ADJUST)
{
os_coord offset;
offset.x=0;
offset.y=0;
open_parent(offset);
}
 
delete this;
}
 
void filer_window::reload()
{
static int buffer[256];
211,3 → 227,28
extent.y1=0;
set_extent(extent);
}
 
void filer_window::open_parent(const os_coord& offset) const
{
// Determine whether there is a parent directory.
char* lastdot=strrchr(_pathname,'.');
if (lastdot&&strcmp(lastdot+1,"$"))
{
// Find top-left corner of this window.
wimp_window_state state;
get_window_state(state);
 
// Add offset to give top-left corner of new window.
os_box box;
box.x0=state.visible.x0+offset.x;
box.y1=state.visible.y1+offset.y;
box.x1=box.x0;
box.y0=box.y1;
 
// Open new window.
*lastdot=0;
new filer_window((filer_application*)parent_application(),
_pathname,box,_options);
*lastdot='.';
}
}