patches from Mattias Sundblad
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1836 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
66ebd69087
commit
15db9de07f
@ -10,7 +10,12 @@
|
||||
#include <SupportDefs.h>
|
||||
#endif
|
||||
|
||||
#define APP_SIGNATURE "application/x-vnd.obos-stylededit"
|
||||
//See if this takes care of some problems with closing the application
|
||||
//by clicking the windowtab
|
||||
//#define APP_SIGNATURE "application/x-vnd.obos-stylededit"
|
||||
//application signature consistent with with the one in StyledEdit.rdef
|
||||
//seems to work, 021021
|
||||
#define APP_SIGNATURE "application/x-vnd.obos.styled-edit"
|
||||
|
||||
const float MENU_BAR_HEIGHT= 19.0;
|
||||
const float TEXT_INSET= 3.0;
|
||||
|
@ -57,6 +57,7 @@ FindWindow::FindWindow(BRect frame, BHandler *_handler, BString *searchString, b
|
||||
const char *text= searchString->String();
|
||||
|
||||
fSearchString->SetText(text);
|
||||
fSearchString-> MakeFocus(true); //021021
|
||||
|
||||
if(*caseState== true)
|
||||
fCaseSensBox->SetValue(B_CONTROL_ON);
|
||||
|
@ -30,11 +30,13 @@ ReplaceWindow::ReplaceWindow(BRect frame, BHandler *_handler, BString *searchStr
|
||||
: BWindow(frame, "", B_MODAL_WINDOW, B_NOT_RESIZABLE,B_CURRENT_WORKSPACE)
|
||||
{
|
||||
|
||||
fReplaceView=new BView(Bounds(),"",B_FOLLOW_ALL_SIDES,B_WILL_DRAW);
|
||||
fReplaceView= new BView(Bounds(),"",B_FOLLOW_ALL_SIDES,B_WILL_DRAW);
|
||||
fReplaceView->SetViewColor(216,216,216);
|
||||
|
||||
fReplaceView->AddChild (fSearchString= new BTextControl(BRect(5,10,290,50), "", "Find:",NULL, NULL,
|
||||
B_FOLLOW_LEFT|B_FOLLOW_TOP,B_WILL_DRAW|B_NAVIGABLE));
|
||||
fSearchString->SetDivider(65);
|
||||
fSearchString-> SetDivider(65);
|
||||
|
||||
fReplaceView->AddChild(fReplaceString=new BTextControl(BRect(5,35,290,50), "", "Replace with:",NULL,
|
||||
NULL,B_FOLLOW_LEFT|B_FOLLOW_TOP,B_WILL_DRAW|B_NAVIGABLE));
|
||||
fReplaceString->SetDivider(65);
|
||||
@ -59,13 +61,14 @@ ReplaceWindow::ReplaceWindow(BRect frame, BHandler *_handler, BString *searchStr
|
||||
fReplaceButton->MakeDefault(true);
|
||||
|
||||
AddChild(fReplaceView);
|
||||
fHandler=_handler;
|
||||
fHandler= _handler;
|
||||
|
||||
const char *searchtext= searchString->String();
|
||||
const char *replacetext= replaceString->String();
|
||||
|
||||
fSearchString->SetText(searchtext);
|
||||
fReplaceString->SetText(replacetext);
|
||||
fSearchString-> MakeFocus(true); //021021
|
||||
|
||||
if(*caseState== true)
|
||||
fCaseSensBox->SetValue(B_CONTROL_ON);
|
||||
|
Binary file not shown.
@ -128,8 +128,9 @@ void StyledEditWindow::InitWindow(){
|
||||
|
||||
viewFrame= Bounds();
|
||||
|
||||
viewFrame.top = MENU_BAR_HEIGHT+1;
|
||||
viewFrame.top = MENU_BAR_HEIGHT; //021021
|
||||
viewFrame.right -= B_V_SCROLL_BAR_WIDTH;
|
||||
viewFrame.left = B_V_SCROLL_BAR_WIDTH-15; //021021
|
||||
viewFrame.bottom -= B_H_SCROLL_BAR_HEIGHT;
|
||||
|
||||
|
||||
@ -141,11 +142,11 @@ void StyledEditWindow::InitWindow(){
|
||||
fTextView= new StyledEditView(viewFrame, textBounds, this);
|
||||
fTextView-> SetDoesUndo(true);
|
||||
fTextView-> SetStylable(true);
|
||||
fTextView-> MakeFocus(true);
|
||||
|
||||
|
||||
fScrollView= new BScrollView("scrollview", fTextView, B_FOLLOW_ALL, 0, true, true, B_NO_BORDER);
|
||||
AddChild(fScrollView);
|
||||
|
||||
fTextView-> MakeFocus(true);
|
||||
|
||||
|
||||
//Add "File"-menu:
|
||||
@ -157,17 +158,17 @@ void StyledEditWindow::InitWindow(){
|
||||
fMenuBar-> AddItem(menu);
|
||||
|
||||
menu-> AddItem(menuItem= new BMenuItem("New", new BMessage(MENU_NEW), 'N'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Open..", new BMessage(MENU_OPEN)));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Open...", new BMessage(MENU_OPEN), 'O'));
|
||||
menuItem->SetTarget(be_app);
|
||||
menu-> AddSeparatorItem();
|
||||
|
||||
menu-> AddItem(fSaveItem= new BMenuItem("Save", new BMessage(MENU_SAVE), 'S'));
|
||||
fSaveItem-> SetEnabled(false);
|
||||
menu-> AddItem(menuItem= new BMenuItem("Save as", new BMessage(MENU_SAVEAS)));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Save as...", new BMessage(MENU_SAVEAS)));
|
||||
menuItem-> SetEnabled(true);
|
||||
|
||||
menu-> AddItem(menuItem= new BMenuItem("Revert to Saved", new BMessage(MENU_REVERT)));
|
||||
menuItem-> SetEnabled(true);
|
||||
menu-> AddItem(fRevertItem= new BMenuItem("Revert to Saved", new BMessage(MENU_REVERT)));
|
||||
fRevertItem-> SetEnabled(false);
|
||||
menu-> AddItem(menuItem= new BMenuItem("Close", new BMessage(MENU_CLOSE), 'W'));
|
||||
|
||||
menu-> AddSeparatorItem();
|
||||
@ -206,10 +207,10 @@ void StyledEditWindow::InitWindow(){
|
||||
menuItem-> SetTarget(fTextView);
|
||||
|
||||
menu-> AddSeparatorItem();
|
||||
menu-> AddItem(menuItem= new BMenuItem("Find", new BMessage(MENU_FIND),'F'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Find...", new BMessage(MENU_FIND),'F'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Find Again",new BMessage(MENU_FIND_AGAIN),'G'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Find Selection", new BMessage(MENU_FIND_SELECTION),'H'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Replace", new BMessage(MENU_REPLACE),'R'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Replace...", new BMessage(MENU_REPLACE),'R'));
|
||||
menu-> AddItem(menuItem= new BMenuItem("Replace Same", new BMessage(MENU_REPLACE_SAME),'T'));
|
||||
|
||||
//Add the "Font"-menu:
|
||||
@ -312,7 +313,7 @@ void StyledEditWindow::InitWindow(){
|
||||
|
||||
fSavePanel= new BFilePanel(B_SAVE_PANEL, new BMessenger(this), NULL, B_FILE_NODE, false);
|
||||
Register(true);
|
||||
Minimize(true);
|
||||
|
||||
} /***StyledEditWindow::Initwindow()***/
|
||||
|
||||
void StyledEditWindow::MessageReceived(BMessage *message){
|
||||
@ -654,6 +655,7 @@ status_t StyledEditWindow::Save(BMessage *message){
|
||||
|
||||
fSaveItem-> SetEnabled(false);
|
||||
fTextSaved= true;
|
||||
fRevertItem-> SetEnabled(true);
|
||||
return err;
|
||||
} /***Save()***/
|
||||
|
||||
@ -682,6 +684,7 @@ void StyledEditWindow::OpenFile(entry_ref *ref){
|
||||
fSaveMessage->AddRef("directory",&parentRef);
|
||||
fSaveMessage->AddString("name", name);
|
||||
SetTitle(name);
|
||||
fRevertItem-> SetEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ class StyledEditWindow: public BWindow{
|
||||
BMessage *fPrintSettings;
|
||||
BMessage *fSaveMessage;
|
||||
BMenuItem *fSaveItem;
|
||||
BMenuItem *fRevertItem;
|
||||
BMenuItem *fUndoItem;
|
||||
BMenuItem *fCutItem;
|
||||
BMenuItem *fCopyItem;
|
||||
|
Loading…
Reference in New Issue
Block a user