topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 6:12 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Small utility for quick prototyping GridMove layouts  (Read 24159 times)

Xitsa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 8
    • View Profile
    • Donate to Member
Small utility for quick prototyping GridMove layouts
« on: August 23, 2008, 12:39 PM »
I've wrote small utility for creating simple GridMove layouts.
It's main task to make easy calculating grid's coordinates (I was bored after making two grids :)).
GridStack is a command line application accepting definition of a grid layout and outputing GridMove's template.

You can get it here.

How to use:
GridStack input.stack output.grid
input.stack — definition of grid in series of subdivisions
output.grid — input template for GridMove.

input.stack is a sequence of definitions of monitors

Each monitor has region which can be divided in several regions vertically or horizontally. Each region can be divided vertically or horizontally also. There where division ends is window.

Each region can be divided either horizontally or vertically. Definition of each subregion includes Dimension: relative dimension of a subregion.

For example: if we use definition
HStack ( Window 1 Window 2)
we get two windows of same height with sizes 33% and 66% of upper region width respectively.

To set absolute (not relative) size use size! (warning: between number and exclamation mark shouldn't be any spaces!).

If size not specified assumed value 1.

Example:
For generating 3-part.grid one should provide following input:

Monitor 1
 HStack
   (
     Window 2
     VStack
       (
         Window
         Window
       )
   )
Monitor 2
 HStack
   (
     Window 2
     VStack
       (
         Window
         Window
       )
   )
Monitor 3
 HStack
   (
     Window 2
     VStack
       (
         Window
         Window
       )
   )

One more example:

Monitor 1
 VStack
   (
     HStack 1
       (
         Window
         Window
         Window
         Window
       )
     HStack 3
       (
         Window
         VStack  300! #300 pixels for width
          (
            Window 3
            Window 5
          )
         Window
       )
   )



Please test

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #1 on: August 26, 2008, 05:05 PM »
holy cow no one responded to this post yet?!?!
It's such a fun gesture and gift to gridmove users.  Thank you.

Time to test it!

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #2 on: August 26, 2008, 05:43 PM »
This really looks good, and seriously simpler than the current method for creating grids.

I really hate the fact that it's such a pain to learn how to make grids, it's great that you took the time to make it easier for everyone :D
Thanks xitsa!

PS: did you make this with ahk? Maybe you could post the source code too? ;)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #3 on: August 26, 2008, 05:50 PM »
I just gave it a quick spin, and it's VERY impressive!
It's easy to get the hang of it (or at least, way easier than I anticipated ;) ), and I was able to make 3 grids in like.. 20 seconds? :D
Congrats on a great work, xitsa :D

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #4 on: August 26, 2008, 07:41 PM »
The KISS principle is not used here  :(  or I am at a level of stupidity that would even put Mr. Bean to shame  ;D

How does it work?

When i used the example in the following lines inside the WinXP SP1 DOSbox it always returns the same message:
"Use: gridstack input.stack output.grid"

The lines:
e:\downloads\gridstack HStack ( Window 1 Window 2) e:\grid.grid
e:\downloads\gridstack "HStack ( Window 1 Window 2)" e:\grid.grid
e:\downloads\gridstack ( Window 1 Window 2) e:\grid.grid
e:\downloads\gridstack HStack (Window 1 Window 2) e:\grid.grid
e:\downloads\gridstack HStack ( Window1 Window2) e:\grid.grid
e:\downloads\gridstack HStack ( Window 1,Window 2) grid.grid
e:\downloads\gridstack VStack ( Window 1 Window 2) e:\grid.grid








jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #5 on: August 26, 2008, 08:02 PM »
Shades: put the lines inside a file, and pass that file as the second argument ;)

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #6 on: August 26, 2008, 08:22 PM »
 :-[

Xitsa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #7 on: August 28, 2008, 12:55 PM »

PS: did you make this with ahk? Maybe you could post the source code too? ;)
I'm glad you like it too :)
Here new version and sources.
I fixed some things in output (missed some rare case).

Program is wriitten in mix of C and C++ and quite straightforward:
Firstly developed in Borland C++ Builder and later ported to Visual C++ (to achieve more small size).
Comments are in russian but everything should be easy to understand.
One thing that can be confusing is using a combo Flex+Bison, but without them I would write parser more longer :)

P.S. please keep an empty line at the end in *.grid files: it seems lexer needs it for some reason.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #8 on: August 28, 2008, 03:04 PM »
Here new version and sources.
Cool!  :Thmbsup:

One thing that can be confusing is using a combo Flex+Bison, but without them I would write parser more longer :)
Flex+Bison? I've used that at school, interesting way of solving this problem, I must say. I wouldn't say it's code for begginers, though ;)
I see you had some serious work doing this (the fact you did it just proves that making grids for gridmove really is insanelly hard!), thanks a lot!!

patteo

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 437
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #9 on: February 02, 2009, 11:40 AM »
Shades: put the lines inside a file, and pass that file as the second argument ;)

I guess I'm not that smart as well as I can't get it to work.

What does put the lines inside a file mean - like creating a batch file with the commands in it ?

e:\downloads\gridstack HStack ( Window 1 Window 2) e:\grid.grid

But that produces the same error message as well.

Or do you mean create a text file such as parameters.txt containing the text
HStack ( Window 1 Window 2) e:\grid.grid

Then I execute the command

e:\downloads\gridstack parameters.txt

----------
I just get the same error message
Use: gridstack input.stack output.grid

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #10 on: February 02, 2009, 01:24 PM »
Hi patteo!

In your example, e:\downloads\gridstack HStack ( Window 1 Window 2) e:\grid.grid, the text HStack ( Window 1 Window 2) should be the contents of the file in the first argument.
Thus, if you write HStack ( Window 1 Window 2) in a file named input.stack, you then use the program with the command:
e:\downloads\gridstack input.stack output.grid

ps: the name of the input and output file can be any that you choose.

Xitsa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #11 on: February 05, 2009, 02:50 AM »
I tried to explain here with a picture, step by step.

didier69

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Small utility for quick prototyping GridMove layouts
« Reply #12 on: February 28, 2009, 04:28 AM »
Thanks for this tool, it's very simple to use ! And I can make exactely the layout I want. The tutorial in your code.google site is very clear.