Commit Graph

686 Commits

Author SHA1 Message Date
John Scipione
64182ccb20 Menu and Deskbar: Remove _SetMenuLayout() method
and remove TExpandoMenuBar as a friend class to BMenu hack.

In Deskbar, call the newly added MenuPrivate::SetLayout() method instead.

This is a much cleaner way to implement this, thanks Stefano Ceccherini
for the tip!
2015-02-20 14:38:43 -05:00
John Scipione
deaae5fc20 Deskbar: Persist ExpandoMenuBar
Add private BMenu::_SetMenuLayout() method. Set TExpandoMenuBar
as a friend class in BMenu to call this method. A little hacky,
but, this keeps SetMenuLayout() from being exposed as part of
the public API.

Don't destroy and rebuild the ExpandoMenuBar when switching from
horizontal to vertical mode. Instead build the TExpandoMenuBar
when the application starts and then switch it from B_ITEMS_IN_ROW
to B_ITEMS_IN_COLUMNS by using the newly added _SetMenuLayout()
method.

When we resize from vertical to horizontal, recalc the max
menu item widths, this resizes the application menu items so
that they take up the right amount of space.

Since we no longer destroy the menu bar we no longer have to
save whether menu items are expanded or not in a separate list.
Instead we can store that information in directly in
TExpandoMenuBar. This removes a lot of code.

Fixes #9350
2015-02-19 19:02:39 -05:00
Axel Dörfler
794c227e83 BView: fixed RemoveSelf() layout item handling.
* When RemoveSelf() is called, we do not own our own layout items, so
  we must not delete them.
* However, we do own them when we still have layout items left when
  we get deleted ourselves.
* This fixes removing/adding a child view to a view without deleting
  it inbetween (like the new Network preferences will do).
* Optimized item removal -- not a good idea to always remove item 0.
2015-02-13 22:34:34 +01:00
Axel Dörfler
95fdee0bc0 BStringView: added truncation support.
* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
  however, there was no B_NO_TRUNCATION.
2015-01-23 21:00:28 +01:00
Axel Dörfler
1bfa46f230 BLayoutBuilder::Grid: added spacing setters. 2015-01-23 21:00:26 +01:00
John Scipione
b825666f3f Rename method parameter in header to match implementation 2014-12-19 19:58:56 -05:00
John Scipione
65dfd2c67c Documentation fixes for BTab and BTabView 2014-12-19 19:51:42 -05:00
John Scipione
f466445917 Changes to BTextControl for docs.
Also remove the non-ControlLook drawing code.
2014-12-18 20:45:44 -05:00
John Scipione
5ae0cde363 Style fixes to BStringView related to docs 2014-12-04 17:56:24 -05:00
Adrien Destugues
3d06e082bc BOptionPopUp: move mennu setup to AttachedToWindow
* There is no need to delay this to AllAttached
* Apps may want to override the SetDivider, and doing it as late as
AllAttached can be annoying.

Fixes #10734.
2014-11-27 09:00:23 +01:00
Adrien Destugues
bdb4ae32fd Fix unarchiving of BScrollView with layout
* We archive views using "managed" archives, and the children are not
attached in the BView(BMessage*) constructor, but later. So it's not
possible to find the target and scrollbars in the constructor of
BScrollView.
* Make BScrollView override AllUnarchived and find the target and
scrollbars again there. The code is slightly different as there is no
guarantee that the first child will be the target in that case. The
existing code in the constructor is preserved for non-managed archives.
2014-10-12 16:02:34 +02:00
Adrien Destugues
4cada3807c BDragger: add layout-aware constructor.
Somehow no one needed this yet.
2014-10-11 11:18:56 +02:00
Adrien Destugues
13d147b12b Introduce "invalid" text controls.
* MarkAsInvalid is used to enable or disable the mark
* The B_INVALID BControlLook flag is used
* invalid BTextControls are drawn with a red border.
* You ar encouraged to let the user know more precisely what's wrong, by
showing an helpful error message next to the control or in a tooltip.
2014-10-01 12:12:16 +02:00
Adrien Destugues
e94bd4810e Fix "strict aliasing rules" warnings
Treated as errors when trying to build the test_app_server for x86_64.
2014-09-02 10:16:01 +02:00
John Scipione
d11a323120 TextView: Fix FBC size breakage, take 2
Double checked BeOS R5 & Haiku R1/A4 and BTextView should be 356
bytes, somewhere since then we've added 4 bytes. So, this commit
reduces the class size from 360 back to 356 by removing 1 reserved
int32 (instead of 2).

I believe the class size changed in hrev46798 as a result of adding
2 bools (1 byte each padded out to 4 bytes).

Sorry for the noise.
2014-07-24 13:55:09 -04:00
John Scipione
fb224a9f14 Revert "TextView: Fix FBC size breakage"
This reverts commit 8e268f7552.
2014-07-24 13:15:30 -04:00
John Scipione
8e268f7552 TextView: Fix FBC size breakage
In hrev46796 I added two new private methods: _PreviousLineStart(),
and _NextLineEnd() which increased the size of the class breaking
binary compatability because I forgot to decrement the reserved array.

This commit decrements the reserved array restoring the class size
to the original size fixing the binary compat issue.

Thanks Axel for noticing.
2014-07-24 10:29:06 -04:00
John Scipione
fef862eb20 TextView.h rearrage virtual methods for FBC
The order is updated so the virtual methods appear in the same order
that they did in BeOS R5 with methods new to Haiku added to the bottom.

Perform() moves up, all other methods move below GetDragParameters(),
the last virtual method in BeOS R5's TextView.h.
2014-07-24 10:29:04 -04:00
John Scipione
24588f6b80 BShape: Rename these params back in header.
Accidentally renamed these in the header, rename them back to
match the cpp file. These param names might not be very good but
they match the struct variable names. They are private methods
anyway. No functional change intended in either commit.
2014-07-14 19:15:13 -04:00
John Scipione
db1ef05aef BShape: Style fixes for docs 2014-07-14 19:02:44 -04:00
Adrien Destugues
33d60fa21f BRegion: add ScaleBy(BSize) and user documentation. 2014-06-19 19:23:31 +02:00
Adrien Destugues
669ac9d6f5 BRegion: add ScaleBy method.
* Is there a reason to not have it?
2014-06-19 18:05:14 +02:00
John Scipione
1f424632be Style fixes to IK, focus on docs 2014-06-13 17:27:01 -04:00
John Scipione
daabbbe5f9 BRegion: Style fix, update parameter name
No functional change.

Trying to indentify each kind of object uniquely and consistently.

... update docs as well.
2014-06-04 11:58:07 -04:00
John Scipione
44cee34013 BRegion: Style updates for documentation.
No functional changes intended.

* Updated copyright information.
* Reduced doxygen documentation down to a helpful summary
  in a regular comment, the documentation has been moved into
  the Haiku Book.
* Some parameter renaming for consistency and clarity.
* A few other style fixes.
2014-06-03 20:26:45 -04:00
John Scipione
1f46fc6d52 BRect: Style fixes for documentation 2014-05-30 19:31:10 -04:00
John Scipione
8ad6baf789 BButton style fixes for docs.
No functional change intended.
2014-05-28 14:21:06 -04:00
John Scipione
b29d84a85a BRadioButton style fixes for docs. 2014-05-28 14:10:35 -04:00
John Scipione
7ad8e674de BCheckBox: Style fixes, variable renaming for consistency, docs.
Also some other style fixes, no functional changes intended.
2014-05-28 14:06:32 -04:00
John Scipione
092e3093c3 BControl: Style fixes, variable renaming for consistency, docs.
Also some other style fixes, no functional changes intended.
2014-05-28 14:05:22 -04:00
John Scipione
f4870e1cf4 BView: Rename parameters for consistency, docs.
No functional change.
2014-05-28 12:11:57 -04:00
John Scipione
b955a4ca6b BPolygon: Style fixes for documentation. 2014-05-21 16:12:47 -04:00
John Scipione
c109d7e06f BPictureButton: Style fixes related to documentation
Some variable renaming for consistency.
2014-05-19 20:13:38 -04:00
John Scipione
df48d3f9a8 BPicture: Style fixes related to documentation.
Mostly pointer style adjustments
2014-05-19 20:13:38 -04:00
Adrien Destugues
1d09e9cee3 BScrollbar: remove unused field.
* Nothing ever reads fTargetName in the scrollbar code, so remove the
field.
* Frees one reserved slot, and a little memory, as the target name was
copied with strdup.
2014-04-29 16:46:00 +02:00
John Scipione
e439b00397 Fix button label position, try number 2
Create and use BLayoutUtils::AlignOnRect() to position the button label
in BControlLook::DrawLabel().

AlignOnRect(), unlike AlignInFrame(), provides the possibility to return
a rectangle with dimensions greater than the available size.

Add some comments above the methods in LayoutUtils that indicate such.

Also update copyright headers in LayoutUtils and ControlLook
2014-04-08 14:10:10 -04:00
Adrien Destugues
eb43166326 app_server & interface kit: support fill rules.
* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.
2014-03-11 17:27:42 +01:00
John Scipione
ab5c74422e BView: ScrollWithMouseWheelDelta return status code 2014-03-07 19:11:44 -05:00
John Scipione
5d10a74cfb BSeparatorItem: Style fix, rename archive to data
... missed it in a few places, trying to make variables names consistent.

Update hrev in docs
2014-03-04 14:28:20 -05:00
John Scipione
4479c8fda7 Style fixes to BSeparatorItem class.
Mostly meant for documentation with a few other style corrections as well.

Update copyright header.
2014-03-04 14:15:20 -05:00
John Scipione
fa412b5fd9 BMenuItem: Style fixes related to documentation. 2014-02-28 19:05:34 -05:00
Adrien Destugues
b8c44b4c3f BAffineTransform: C++11 compatibility fix
inline const floats are a gcc extension. It is possible to do it in a
standard way in C++11 using constexpr, but then gcc will reject the
previously accepted nonstandard syntax.
2014-02-07 14:42:51 +01:00
Stephan Aßmus
a6db6bd40f Added WIP support for affine transformations to BViews.
Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.
2014-02-04 22:53:06 +01:00
John Scipione
77acb43273 TextView: Remove Cmd+Up and Cmd+Down Shortcuts
to go to the beginning and end of the document.
2014-02-01 11:04:34 -05:00
John Scipione
0875173246 TextView: Update nav shortcuts again
Make Cmd+Left and Cmd+Right work the same as Option+Left and
Option+Right, that is, they do word-wise navigation.

Make Option+Up go to beginning of paragraph and Option+Down go to end
of paragraph like Cmd+Left and Cmd+Right used to.

Unfortunately option shortcuts are currently eaten by S&T until #9431
gets fixed.
2014-01-31 18:30:07 -05:00
John Scipione
eb774c2948 TextView: Update navigation shortcuts
* Command+Left goes to beginning of line, ignoring softwrap
* Command+Right goes to the end of line, ignoring softwrap
* Home goes to beginning of line, accounting for softwrap
* End goes to end of line, accounting for softwrap
* Option+Left goes to previous word
* Option+Right goes to next word
* Command+Home and Command+Up go to beginning of document
* Command+End and Command+Down go to end of document

Shift with any of the above also selects the text.

This is similar to how the text editor Eddie works.
2014-01-30 19:48:31 -05:00
Ingo Weinhold
a0848a1916 BButton: Add optional pop-up marker
* Add behavior constant B_POP_UP_BEHAVIOR which adds a pop-up marker
  to the button (similar to that of BMenuField).
* Add methods [Set]PopUpMessage(). To set/get the the message that is
  sent to the button's target when the pop-up marker is clicked.
2013-12-30 04:42:52 +01:00
Ingo Weinhold
813c5772c9 BButton: Removed dead code
Remove methods _DrawDefault() and _DrawFocusLine() which were used for
the non-BControlLook drawing.
2013-12-30 04:18:33 +01:00
Ingo Weinhold
b998f9f02f BButton: Add support for toggle button behavior
Add methods SetBehavior(), Behavior(). Supported behavior constants are
B_BUTTON_BEHAVIOR -- normal button behavior -- and B_TOGGLE_BEHAVIOR
-- toggle button behavior.
2013-12-29 01:21:45 +01:00
Ingo Weinhold
b181fabe57 BButton: Remove left over attributes 2013-12-29 00:43:25 +01:00