How to make a professional looking UI?

Dear Friends,
Attached photo shows a professional UI. I wish to learn how can we make such UI. Can you let me know how can I start?

1 Like

You can start with e.g.:

1 Like

As @dezmo said, you can create a UI with an HtmlDialog.

For the information communication between SketchUp and the UI you can apply JSON.
With JavaScript you can make specific functions on the UI functional.

1 Like
dlg =
	dialog_title:    'MAJ Stair',
	scrollable:       true,
	resizable:        false,
	width:            600,
	height:           450,
	style:            UI::HtmlDialog::STYLE_WINDOW

  html = <<-HTML
	<!DOCTYPE html> 
    <select style="width:204px;height:24px;">
    <option>Steps Number</option>
    <option>Steps Riser</option>
    <input style="width:200px;height:20px;" type="text"/>


I hope you can help me to start learning. As I understand it is possible to write HTML code in Ruby Code Editor and run it. Now I can improve window. As I understood for receiving data from window, we need JSON. Is it possible to write JS code in Ruby Code Editor? In my code example how can I read a number from text box?

Try to think of it not to “get” and read the number but rather to “send” the number. It’s only a minor difference but important for finding the right solution to such tasks. Imagine SketchUp like a web server and the dialog like a website in a browser. The dialog invokes the action (by a button press of the user), reads the form values, builds JSON data and sends it to a Ruby action callback.

JSON is a subset of JavaScript data types that is also valid in other languages. That makes is very universal. Wherever you can write JavaScript or Ruby, you can also write JSON.


If someone have such problem I suggest visit following forum.
[Example]An example to help you how to write SketchUp Ruby code with HtmlDialog.
Especial thanks to Camlaman.

My window in HTML show stair size but also it depend on system unit. Instead of sending system unit to HTML and show right numbers there, we can write HTML code for each unit. In this way we just need send data from HTML to Ruby and now I know how to do it. Also I find following forums. Your information in this forum is so useful. Thank you.