Jump to content

Search the Community

Showing results for tags 'listbox'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

There are no results to display.

Forums

  • Welcome to Smart Mobile Studio
    • News and Information
    • Pre-Sales Questions
    • Smart In the Media
    • Smart Contests
    • Meta
  • Smart Mobile Studio Discussion
    • General
    • IDE
    • RTL
    • Code
    • Client Server
    • Platform
    • Graphics
    • Deployment
    • Suggestion box
  • Smart Mobile Studio support
    • Support
    • Bug report
  • General Discussion
    • Pascal
    • Delphi
    • Javascript
    • HTML/HTML5
    • CSS
  • Resources
    • Website
    • Download Smart Mobile Studio

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Company name


Position

Found 4 results

  1. Hello again. Is there any way to show a grid with the resizeable columns? I have tried TW3Grid adding columns and assigning their sizes. In resize I have assigned a percentage to each column (colCode = 5, colName = 80, colState = 15, for example) and I change the width to each of the columns: Grid1.Columns [n] .Width: = Grid.ClientWidth * colCode div 100, etc. The new columns are displayed correctly but those that already exist do not (it seems that the rows are simple concatenations of text). I do not know if it can be done with TW3CustomDBgrid, but I have not found examples. It is also important that they respond to the onClick event (if it can be per cell better than per row, if possible). Maybe it is possible to use listview with several columns?
  2. I am still having a hard time with a Listbox and distinguishing between "touch" to select and item in a listbox on a desktop/laptop browser.....and "touch" to begin scrolling (e.g. on a phone/tablet) Using a basic example listbox with 100 items procedure TForm1.Resize; var i: integer; begin inherited; W3ListBox1.Clear; for i:= 1 to 100 do W3ListBox1.Add('Item ' + inttostr(i)); W3ListBox1.SetBounds(0,0,width,height); end; When a user is using the desktop/laptop browser, I need them to be able to use both mouse and touch (case their monitor is touch) to "scroll" and "select" item.....else if using their phone or tablet, need them to be able to use "touch" to scroll and "tap" to select item I assume we dont want to use the standard OnSelected event ? W3ListBox1..OnSelected := HandleLBItemSelected; and probably want to use the OnTouchBegin & OnTouchEnd, as well as the OnMouseDown & OnMouseUp events?????? If So, how? And how do you then handle the scrolling?
  3. IElite

    Listbox Items from custom class

    I am trying to create a listbox that has an Image and Label on each item. The image is aligned left, and the label is aligned client. Why doesn't the code below work? I never get anything on the ListBox items (no images or labels) unit Main; interface uses SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms, SmartCL.Fonts, SmartCL.Borders, SmartCL.Application, SmartCL.Layout, SmartCL.Controls.Listbox, System.Colors; type TfrmMain = class(TW3Form) private {$I 'Main:intf'} fLayout: TLayout; procedure AddItem(Caption: String; Image: String); protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; implementation uses LBItem; { TForm1 } procedure TfrmMain.AddItem(Caption: String; Image: String); begin var lbItem := W3ListBox.Items[W3ListBox.Add] as TLBItem; lbItem.Caption:= Caption; lbItem.Image:= Image; end; procedure TfrmMain.InitializeForm; begin inherited; // this is a good place to initialize components FLayout:= Layout.Client(W3ListBox); end; procedure TfrmMain.InitializeObject; begin inherited; {$I 'Main:impl'} W3ListBox.ItemClass := TLBItem; W3ListBox.ItemHeight := 32; W3ListBox.Styles.SelectedColor := clSilver; AddItem('One', 'res\1.png'); AddItem('Two', 'res\2.png'); AddItem('Three', 'res\3.png'); AddItem('Four', 'res\4.png'); AddItem('Five', 'res\5.png'); end; procedure TfrmMain.Resize; begin inherited; if Assigned(FLayout) then begin FLayout.Resize(self); end; end; initialization Forms.RegisterForm({$I %FILE%}, TfrmMain); end. unit LBItem; interface uses System.Types, SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms, SmartCL.Fonts, SmartCL.Borders, SmartCL.Application, SmartCL.Controls.Header, SmartCL.Controls.CheckBox, SmartCL.Controls.Image, SmartCL.Layout, SmartCL.Controls.Label; type TLBItem = class(TW3Form) private {$I 'LBItem:intf'} fLayout: TLayout; procedure SetImage(Value: String); function GetImage: String; procedure SetCaption(Value: String); function GetCaption: String; protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; public property Image: String read GetImage write SetImage; property Caption: String read GetCaption write SetCaption; end; implementation { TLBItem } procedure TLBItem.SetCaption(Value: String); begin W3Label.Caption:= Value; end; function TLBItem.GetCaption: String; begin result:= W3Label.Caption; end; procedure TLBItem.SetImage(Value: String); begin W3Image.LoadFromUrl(Value); end; function TLBItem.GetImage: String; begin result:= W3Image.Url; end; procedure TLBItem.InitializeForm; begin inherited; // this is a good place to initialize components Layout.Client([Layout.Left(W3Image), Layout.Left(W3Label)]); end; procedure TLBItem.InitializeObject; begin inherited; {$I 'LBItem:impl'} W3Image.Width:= 32; W3Image.Height:= 32; W3Label.Height:= 32; W3Label.Width:= 32; end; procedure TLBItem.Resize; begin inherited; if Assigned(FLayout) then begin FLayout.Resize(self); end; end; initialization Forms.RegisterForm({$I %FILE%}, TLBItem); end.
  4. rocedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components W3ListBox1.Add('One'); W3ListBox1.Add('Two'); W3ListBox1.Add('Three'); W3ListBox1.Font.Name:= 'sans-serif'; //does not work W3ListBox1.Font.Size:= 8; //does not work //how do you center text? W3ListBox1.Font.Weight:= 'Bold'; W3ListBox1.Font.Color:= clRed; W3ListBox1.Styles.HighlightedColor:= clCyan; W3ListBox1.Styles.SelectedColor:= clYellow; end;
×