TrackGit
ConflictsWindow.cpp
Go to the documentation of this file.
1 
8 #include "ConflictsWindow.h"
9 
10 #include <stdio.h>
11 
12 #include <LayoutBuilder.h>
13 
14 enum {
16 };
17 
22  :
23  BWindow(BRect(0, 0, 300, 300), "TrackGit - Conflicts",
24  B_DOCUMENT_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
25 {
26  fConflictsTextView = new BTextView("ConflictsText");
27  fConflictsTextView->SetText("Loading...");
28  fConflictsTextView->MakeEditable(false);
29 
30  BScrollView* fScrollView = new BScrollView("ConflictsScrollView",
31  fConflictsTextView, B_WILL_DRAW | B_FRAME_EVENTS, false, true,
32  B_PLAIN_BORDER);
33 
34  BButton* fOK = new BButton("ok", "OK", new BMessage(kOK));
35 
36  BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
37  .SetInsets(10)
38  .Add(fScrollView)
39  .Add(fOK);
40 
41  CenterOnScreen();
42  Show();
43 }
44 
45 
50 void
52 {
53  if (LockLooper()) {
54  fConflictsTextView->SetText(text.String());
55  UnlockLooper();
56  }
57 }
58 
59 
64 void
66 {
67  switch (msg->what) {
68  case kOK:
69  Quit();
70  break;
71  default:
72  BWindow::MessageReceived(msg);
73  }
74 }
ConflictsWindow()
ConflictsWindow Constructor.
BTextView * fConflictsTextView
The Conflicts Text View.
virtual void MessageReceived(BMessage *)
Handler to received messages.
void SetText(BString)
Sets Text of the View in Window.
Header file of Conflicts window.