No description
Find a file
2024-01-10 17:15:37 -06:00
.github/workflows Update pages.yml 2024-01-10 17:15:37 -06:00
docs Create index.html 2023-01-08 11:07:19 -06:00
examples 0.2.0!!!! 2024-01-10 21:54:42 +00:00
src 0.2.0!!!! 2024-01-10 21:54:42 +00:00
tests 0.2.0!!!! 2024-01-10 21:54:42 +00:00
.gitignore Sync .gitignore 2023-01-08 20:37:48 +00:00
docs.sh Gen docs 2023-01-08 16:59:54 +00:00
fqa.md Create fqa.md 2023-01-10 15:05:33 -06:00
LICENSE Initial commit 2023-01-08 16:44:49 +00:00
README.md Badges! 2023-01-29 10:49:36 -06:00
xgui.nimble 0.2.0!!!! 2024-01-10 21:54:42 +00:00

xgui-nim

nimble Build Status

XGui is a tool for nigui that imports xml files and turns them into nim at compile-time.

You can install it using the command below:

nimble install https://github.com/thatrandomperson5/xgui-nim.git

Examples

These examples are all the equivalent from nigui exmaples

Running tests

Run the comannds below

git clone https://github.com/thatrandomperson5/xgui-nim.git
cd xgui-nim
nimble test

Docs

The docs are here: thatrandomperson5.github.io/xgui-nim

XGui-specific features

  • Parent pointer, points to the parent of the script tag
  • Tags, allow flagging and finding of elements
  • Border-crossing with the link tag

Tracing

I know becuase of compile time and remote code and other factors, the tracbacks can be really confusing, so i made a tool. Just run nimble install terminaltables and compile with -d:xguiTrace, the expanded code will be dumped along with a trace table. (Expanded code is not easy on the eyes)

The trace table looks something like this:

Printing trace: 
+--------------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Tag                      | Tag-Flags | Attrs                                                                                                                                                         |
+--------------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|  <Window />              |           | width: 100, title: "xgui w/ nigui"                                                                                                                            |
|    <LayoutContainer />   |           | layout: Layout_Horizontal                                                                                                                                     |
|      <l />               |           |                                                                                                                                                               |
|      <Container />       |           |                                                                                                                                                               |
|        <TextArea />      | txt       |                                                                                                                                                               |
|        <Button />        | thebutton |                                                                                                                                                               |
|    <LayoutContainer />   |           |                                                                                                                                                               |
|      <LayoutContainer /> |           | frame: newFrame("Row 1: Auto-sized"), layout: Layout_Horizontal                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|      <LayoutContainer /> |           | frame: newFrame("Row 2: Auto-sized, more padding"), layout: Layout_Horizontal, padding: 10                                                                    |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|      <LayoutContainer /> |           | frame: newFrame("Row 3: Auto-sized, more spacing"), spacing: 15, layout: Layout_Horizontal                                                                    |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|      <LayoutContainer /> |           | frame: newFrame("Row 4: Controls expanded"), layout: Layout_Horizontal                                                                                        |
|        <Button />        |           | widthMode: WidthMode_Expand                                                                                                                                   |
|        <Button />        |           | widthMode: WidthMode_Expand                                                                                                                                   |
|        <Button />        |           | widthMode: WidthMode_Expand                                                                                                                                   |
|      <LayoutContainer /> |           | frame: newFrame("Row 5: Controls centered"), widthMode: WidthMode_Expand, xAlign: XAlign_Center, layout: Layout_Horizontal, yAlign: YAlign_Center, height: 80 |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
|        <Button />        |           |                                                                                                                                                               |
---------------------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------

Future

Add more exmaples