Posted by: hs2
« on: July 28, 2006, 06:20:41 AM »I've written these little ones:
Although the 'temp_view' approach is more versatile.
HS2
Code: [Select]
// clipboard_type == 'CHAR' , 'LINE' or 'BLOCK'
_command int text_to_clipboard (_str text = '', _str clipboard_type = 'CHAR', _str clipboard_name = '')
{
if ( length ( text ) )
{
push_clipboard_itype (clipboard_type,clipboard_name,1,true);
append_clipboard_text (text);
return(0);
}
else
return(TEXT_NOT_SELECTED_RC);
}
_command void ccb,copy_current_buffer () name_info (','VSARG2_MARK|VSARG2_TEXT_BOX|VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
text_to_clipboard (strip_filename (p_buf_name,'DP'));
message ( "'" strip_filename (p_buf_name,'DP') "' copied to clipboard")
}
_command void ccbf_copy_current_buffer_full () name_info (','VSARG2_MARK|VSARG2_TEXT_BOX|VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
hs2_text_to_clipboard (p_buf_name);
message ( "'" p_buf_name "' copied to clipboard")
}
_command void ccp,copy_current_proc () name_info (','VSARG2_MARK|VSARG2_TEXT_BOX|VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
_str cur_proc = '', cur_class = '';
cur_proc = current_proc ( false );
cur_class = current_class ( false );
if ( length ( cur_class ) )
cur_proc = cur_class :+ '::' :+ cur_proc;
text_to_clipboard ( cur_proc );
message ( "'" cur_proc "' copied to clipboard")
}
Although the 'temp_view' approach is more versatile.
HS2