...

Source file src/github.com/gdamore/tcell/v2/views/constants.go

Documentation: github.com/gdamore/tcell/v2/views

     1  // Copyright 2015 The Tops'l Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use file except in compliance with the License.
     5  // You may obtain a copy of the license at
     6  //
     7  //    http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package views
    16  
    17  // Alignment represents the alignment of an object, and consists of
    18  // either or both of horizontal and vertical alignment.
    19  type Alignment int
    20  
    21  const (
    22  	// HAlignLeft indicates alignment on the left edge.
    23  	HAlignLeft Alignment = 1 << iota
    24  
    25  	// HAlignCenter indicates horizontally centered.
    26  	HAlignCenter
    27  
    28  	// HAlignRight indicates alignment on the right edge.
    29  	HAlignRight
    30  
    31  	// VAlignTop indicates alignment on the top edge.
    32  	VAlignTop
    33  
    34  	// VAlignCenter indicates vertically centered.
    35  	VAlignCenter
    36  
    37  	// VAlignBottom indicates alignment on the bottom edge.
    38  	VAlignBottom
    39  )
    40  const (
    41  	// AlignBegin indicates alignment at the top left corner.
    42  	AlignBegin = HAlignLeft | VAlignTop
    43  
    44  	// AlignEnd indicates alignment at the bottom right corner.
    45  	AlignEnd = HAlignRight | VAlignBottom
    46  
    47  	// AlignMiddle indicates full centering.
    48  	AlignMiddle = HAlignCenter | VAlignCenter
    49  )
    50  
    51  // Orientation represents the direction of a widget or layout.
    52  type Orientation int
    53  
    54  const (
    55  	// Horizontal indicates left to right orientation.
    56  	Horizontal Orientation = iota
    57  
    58  	// Vertical indicates top to bottom orientation.
    59  	Vertical
    60  )
    61  

View as plain text