Open Metallicow opened 10 years ago
On Startup...
Stitching the logo when workspace is empty, that's cool idea! lol :+1:
I could do this easily enough in python. I use wxPython mainly for GUI of choice, but could snuff up a basic proof of concept if I look into PySide or PyQt(umm, which one???). It could be easier ported into C++ that way. And faster with python as a prototype tool in this instance.
I think I will play with PyQt too, since I installed QT in my PC. Here is a directory named 'experimental' within the root project. so you can create 'python' dir there and let's rock !?
RE2 Startup: Whadya mean NO!??? dot period. You didn't provide a reason, just an excuse. Are you intent on users not being able to read the logo or are you bad with simple math or was the image I posted somehow corrupted by github? What I meant is the logo needs to be proportionally scalable. The background Texture should be pannable at the very least like a drag scroller with a optional setting for scaling within for example 25% to 400%. Or did I miss all that code in the repo that someone wrote already for this type of stuff.
Here let me help you out a bit...
If I cut the readability out I achieved this in 4 lines of code. 2 of which are if and else lines. The logo text only scales down if it is smaller than the frame size. The same calculation in C++ takes 4 lines. Maybe truth checking before posting isn't as important.
See attached GUI pics.
def OnPaint(self, event):
"""
Handles the ``wx.EVT_PAINT`` event for :class:`EmbroidermodderPanel`.
:param `event`: a `wx.PaintEvent` event to be processed.
"""
event.Skip()
cSizeX, cSizeY = self.GetClientSize()
pdc = wx.BufferedPaintDC(self)
pdc.Clear()
pdc.DrawBitmap(self.displaySizeBackgroundBmp, 0, 0)
if self.backgroundLogoW > cSizeX:
# Proportional Scaling an Image.
#
# newWidth/oldWidth = newHeight/oldHeight
#
# Plug in the values that you know and solve
# for the new dimension that you don't know.
# Like this:
#
# newWidth/oldWidth = newHeight/oldHeight
# oldHeight * newWidth/oldWidth = newHeight
# newHeight = 300
#
# 400/800 = newHeight/600
# 600 * 400/800 = newHeight
# newHeight = 300
newHeight = self.backgroundLogoH * cSizeX//self.backgroundLogoW
scaledBmp = self.backgroundLogo.ConvertToImage().Scale(cSizeX, newHeight, wx.IMAGE_QUALITY_HIGH).ConvertToBitmap()
pdc.DrawBitmap(scaledBmp, 0, cSizeY // 2 - scaledBmp.GetHeight() // 2)
else:
pdc.DrawBitmap(self.backgroundLogo, cSizeX // 2 - self.backgroundLogoW // 2, cSizeY // 2 - self.backgroundLogoH // 2)
wxPython like a guru. Oh, and looky! PySide/PyQt GUI too. Done in 3 hours with SourceCoder and Notepad++. Better refresh/renew up that algebra book again. :)~
Sorry no Tkinter GUI.
RE2 Sugg: Does QT have a KeyboardShortcuts Dialog? I know wxPy has one that I use for my projects. If Qt doesn't try looking at it. I believe it is a dict implementation as it iterates over all the menubar menus/items.
RE5 Sugg: Not sure. Qt isn't my cup of soup. I think I am still on day QT one 0 one. You will have to wait until at least QT day one 0 three, which might be a few... XD Just look at the Assistant code... XD. It is self documenting it looks like. What No! Nokia wrote that in JavaFX. XD
RE6 Sugg: It just isn't working for me. I know any color is cool as long as its black, but gee cant see a thing. Lets suggest renaming it Darkness or Pitch Black. If rendered in something such as blender, you at least have a certain percent of color variation, so that it is visible/readable. Not 1:1 Maybe make a simple color similarity warner widget, so when colors are close, it doesn't interfere with productivity.
RE7: I'll check it when I build next. Maybe in a few days.
RE11: Ok, I missed it. It's all the way at the bottom. It doesn't do foreground color tho...
RE5 Startup: I can manage to do this and optimize everything for the ico easily enough. I was looking more for a reply as to whether it was worked on already, so ok, got that cleared up.
RE9 Startup: Simple implementation in python GUIs
RE13 Sugg: Ok, so is there a plugins dialog.panel planned?
Regarding the Dropdown ToolButton. Here is the docs link. It even specifically references the Assistant. http://srinikom.github.io/pyside-docs/PySide/QtGui/QToolButton.html
Here is a PySide sample I whipped up.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from PySide import QtGui, QtCore
except ImportError:
from PyQt4 import QtGui, QtCore
class Window(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
layout = QtGui.QHBoxLayout(self)
self.button = QtGui.QToolButton(self)
self.button.setIcon(QtGui.QIcon('shapedbitmapbutton-hover.png'))
self.button.setIconSize(QtCore.QSize(100, 100))
self.button.setToolTip('I have a DropDown arrow!')
self.button.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
self.button.setMenu(QtGui.QMenu(self.button))
## self.button.setArrowType(QtCore.Qt.ArrowType.DownArrow)
self.listBox = QtGui.QListWidget(self)
self.listBox.addItems(['Undo Item %d' % i for i in range(10)])
action = QtGui.QWidgetAction(self.button)
action.setDefaultWidget(self.listBox)
self.button.menu().addAction(action)
layout.addWidget(self.button)
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
window = Window()
window.resize(200, 200)
window.setWindowTitle('QToolButton_With_DropDown')
window.show()
sys.exit(app.exec_())
My suggestions in the python version GUI mockups should be taken with charm and respect to the dissenting individuals.
NOTE: Jon's original design I believe had to do with the main "panel" size being the minimum size (scale) for the actual working cnc table(embroidermachine). That is why he EXPLICITLY stated in GUI code that no artistic scaling down should occur. This would be correct in his design.
Although, if users was just designing(seperately from a Embroidermodder(TM) machine), then maybe my more "artistic approach" to scaling the MainFrame smaller than really necessary would even appeal to the actual user. Being a dynamic rendering user interface to what is already being stitched out in front of your eyes, plays another mega modding aspect that can be only a drool... Render the whole stitching out as if it was real-time(Delta), but try to avoid the game engine aspects, as this is a machine and meant for production sotherefore 'game-engines' need to play ABSOLUTLY NO PART in this repository here. That such fantasy absolutely needs to reside in it's own repository elsewhere within the organization. This is a MACHINE EMBROIDERY repository.
Thoughts on the Machine GUI and whatever are welcome... Please keep other game-ish things elsewhere. This is the Business-User end where people need to make results efficiently.
Making a thread for Users/Developers GUI Enhancements/Suggestions.
Round One. Ding!