Giter Club home page Giter Club logo

Comments (10)

bergel avatar bergel commented on June 2, 2024

We should import RTAlignment from Roassal2, and maybe, define some utility methods, in the same spirit of TRConstraint

from roassal3.

akevalion avatar akevalion commented on June 2, 2024

There is a version of RTAligment and RTResize that works pretty well on Roassal3

from roassal3.

bergel avatar bergel commented on June 2, 2024

But we need RSLocate...

from roassal3.

akevalion avatar akevalion commented on June 2, 2024

We have RSLocate

	| v shape e1 e2 |
	v := RSView new.
	shape := RSShapeBuilder box
		@ RSDraggable;
		onElement;
		color: TSColorPalette sequential blues3;
		size: 100.
		
	e1 := shape element.
	"e1 @ RSDraggable."
	e2 := shape element.
	e2 size: 20.
	RSLocate new
		padding: 1;
		fix: e1;
		movable: e2;
		inner;
		bottom;
		left;
		stick.
	v addAll: {e1. e2}.
	v @ RSControlsView.
	v open

image

from roassal3.

bergel avatar bergel commented on June 2, 2024

Looks really good!
Do you think that RSLocate can be a subclass of RSAbstractElementHandling?

from roassal3.

akevalion avatar akevalion commented on June 2, 2024

I do not thing so, RSLocate do es not need any method of that class

from roassal3.

bergel avatar bergel commented on June 2, 2024

But RSAbstractElementHandling has fixedElement:, and you have it again in RSLocate

from roassal3.

akevalion avatar akevalion commented on June 2, 2024
example10Locate
	<script: 'self new example10Locate'>
	| v shape e1 e2 |
	v := RSView new.
	shape := RSShapeBuilder box
		@ RSDraggable;
		onElement;
		color: TSColorPalette sequential blues3;
		size: 100.
	e1 := shape element.
	"e1 @ RSDraggable."
	e2 := shape element.
	e2 size: 20.
	RSLocate new
		padding: 1;
		inner;
		bottom;
		left;
		stick: e2 on: e1.
	v addAll:{e1. e2}.
	v @ RSControlsView.
	v open

I have change the code of RSLocate, fixedElement and movableElement are not instance variables in RSLocate, instead they are arguments in methods stick:on: and move:on. The main reason to change that is because RSLocate can be use in a lot of elements and not only in a couple. This is useful for RSLabeled, because RSLabeled uses an instance of RSLotate, you can use the same instance for multiple elements

from roassal3.

akevalion avatar akevalion commented on June 2, 2024

I have added a new animated example of this
image
Click on buttons to modify RSLocate.
click on big box to modify the padding of RSLocate

from roassal3.

bergel avatar bergel commented on June 2, 2024

Well done!

from roassal3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.